1 /** 2 * 3 * Copyright 2006 The Apache Software Foundation 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 package org.apache.geronimo.transaction.log; 18 19 import java.io.IOException; 20 21 import org.apache.geronimo.gbean.GBeanInfo; 22 import org.apache.geronimo.gbean.GBeanInfoBuilder; 23 import org.apache.geronimo.gbean.GBeanLifecycle; 24 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory; 25 import org.apache.geronimo.system.serverinfo.ServerInfo; 26 import org.apache.geronimo.transaction.manager.TransactionLog; 27 import org.apache.geronimo.transaction.manager.XidFactory; 28 import org.objectweb.howl.log.LogConfigurationException; 29 30 /** 31 * @version $Rev: 472646 $ $Date: 2006-11-08 13:11:28 -0800 (Wed, 08 Nov 2006) $ 32 */ 33 public class HOWLLogGBean extends HOWLLog implements GBeanLifecycle { 34 public HOWLLogGBean(String bufferClassName, int bufferSize, boolean checksumEnabled, boolean adler32Checksum, int flushSleepTimeMilliseconds, String logFileDir, String logFileExt, String logFileName, int maxBlocksPerFile, int maxBuffers, int maxLogFiles, int minBuffers, int threadsWaitingForceThreshold, XidFactory xidFactory, ServerInfo serverInfo) throws IOException, LogConfigurationException { 35 super(bufferClassName, bufferSize, checksumEnabled, adler32Checksum, flushSleepTimeMilliseconds, logFileDir, logFileExt, logFileName, maxBlocksPerFile, maxBuffers, maxLogFiles, minBuffers, threadsWaitingForceThreshold, xidFactory, serverInfo.resolveServer(".")); 36 } 37 38 public static final GBeanInfo GBEAN_INFO; 39 40 static { 41 GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(HOWLLogGBean.class, NameFactory.TRANSACTION_LOG); 42 infoFactory.addAttribute("bufferClassName", String.class, true); 43 infoFactory.addAttribute("bufferSizeKBytes", Integer.TYPE, true); 44 infoFactory.addAttribute("checksumEnabled", Boolean.TYPE, true); 45 infoFactory.addAttribute("adler32Checksum", Boolean.TYPE, true); 46 infoFactory.addAttribute("flushSleepTimeMilliseconds", Integer.TYPE, true); 47 infoFactory.addAttribute("logFileDir", String.class, true); 48 infoFactory.addAttribute("logFileExt", String.class, true); 49 infoFactory.addAttribute("logFileName", String.class, true); 50 infoFactory.addAttribute("maxBlocksPerFile", Integer.TYPE, true); 51 infoFactory.addAttribute("maxBuffers", Integer.TYPE, true); 52 infoFactory.addAttribute("maxLogFiles", Integer.TYPE, true); 53 infoFactory.addAttribute("minBuffers", Integer.TYPE, true); 54 infoFactory.addAttribute("threadsWaitingForceThreshold", Integer.TYPE, true); 55 56 infoFactory.addReference("XidFactory", XidFactory.class, NameFactory.XID_FACTORY); 57 infoFactory.addReference("ServerInfo", ServerInfo.class, NameFactory.GERONIMO_SERVICE); 58 59 infoFactory.addInterface(TransactionLog.class); 60 61 infoFactory.setConstructor(new String[]{ 62 "bufferClassName", 63 "bufferSizeKBytes", 64 "checksumEnabled", 65 "adler32ChecksumEnabled", 66 "flushSleepTimeMilliseconds", 67 "logFileDir", 68 "logFileExt", 69 "logFileName", 70 "maxBlocksPerFile", 71 "maxBuffers", 72 "maxLogFiles", 73 "minBuffers", 74 "threadsWaitingForceThreshold", 75 "XidFactory", 76 "ServerInfo"}); 77 GBEAN_INFO = infoFactory.getBeanInfo(); 78 } 79 80 public static GBeanInfo getGBeanInfo() { 81 return HOWLLogGBean.GBEAN_INFO; 82 } 83 84 }