1 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 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 } 85 | Popular Tags |