01: /**
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * 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: */package org.apache.geronimo.transaction.log;
17:
18: import java.io.IOException;
19:
20: import org.apache.geronimo.gbean.GBeanInfo;
21: import org.apache.geronimo.gbean.GBeanInfoBuilder;
22: import org.apache.geronimo.gbean.GBeanLifecycle;
23: import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
24: import org.apache.geronimo.system.serverinfo.ServerInfo;
25: import org.apache.geronimo.transaction.manager.TransactionLog;
26: import org.apache.geronimo.transaction.manager.XidFactory;
27: import org.objectweb.howl.log.LogConfigurationException;
28:
29: /**
30: * @version $Rev: 476049 $ $Date: 2006-11-16 20:35:17 -0800 (Thu, 16 Nov 2006) $
31: */
32: public class HOWLLogGBean extends HOWLLog implements GBeanLifecycle {
33: public HOWLLogGBean(String bufferClassName, int bufferSize,
34: boolean checksumEnabled, boolean adler32Checksum,
35: int flushSleepTimeMilliseconds, String logFileDir,
36: String logFileExt, String logFileName,
37: int maxBlocksPerFile, int maxBuffers, int maxLogFiles,
38: int minBuffers, int threadsWaitingForceThreshold,
39: XidFactory xidFactory, ServerInfo serverInfo)
40: throws IOException, LogConfigurationException {
41: super (bufferClassName, bufferSize, checksumEnabled,
42: adler32Checksum, flushSleepTimeMilliseconds,
43: logFileDir, logFileExt, logFileName, maxBlocksPerFile,
44: maxBuffers, maxLogFiles, minBuffers,
45: threadsWaitingForceThreshold, xidFactory, serverInfo
46: .resolveServer("."));
47: }
48:
49: public static final GBeanInfo GBEAN_INFO;
50:
51: static {
52: GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(
53: HOWLLogGBean.class, NameFactory.TRANSACTION_LOG);
54: infoFactory.addAttribute("bufferClassName", String.class, true);
55: infoFactory
56: .addAttribute("bufferSizeKBytes", Integer.TYPE, true);
57: infoFactory.addAttribute("checksumEnabled", Boolean.TYPE, true);
58: infoFactory.addAttribute("adler32Checksum", Boolean.TYPE, true);
59: infoFactory.addAttribute("flushSleepTimeMilliseconds",
60: Integer.TYPE, true);
61: infoFactory.addAttribute("logFileDir", String.class, true);
62: infoFactory.addAttribute("logFileExt", String.class, true);
63: infoFactory.addAttribute("logFileName", String.class, true);
64: infoFactory
65: .addAttribute("maxBlocksPerFile", Integer.TYPE, true);
66: infoFactory.addAttribute("maxBuffers", Integer.TYPE, true);
67: infoFactory.addAttribute("maxLogFiles", Integer.TYPE, true);
68: infoFactory.addAttribute("minBuffers", Integer.TYPE, true);
69: infoFactory.addAttribute("threadsWaitingForceThreshold",
70: Integer.TYPE, true);
71:
72: infoFactory.addReference("XidFactory", XidFactory.class,
73: NameFactory.XID_FACTORY);
74: infoFactory.addReference("ServerInfo", ServerInfo.class,
75: NameFactory.GERONIMO_SERVICE);
76:
77: infoFactory.addInterface(TransactionLog.class);
78:
79: infoFactory.setConstructor(new String[] { "bufferClassName",
80: "bufferSizeKBytes", "checksumEnabled",
81: "adler32ChecksumEnabled", "flushSleepTimeMilliseconds",
82: "logFileDir", "logFileExt", "logFileName",
83: "maxBlocksPerFile", "maxBuffers", "maxLogFiles",
84: "minBuffers", "threadsWaitingForceThreshold",
85: "XidFactory", "ServerInfo" });
86: GBEAN_INFO = infoFactory.getBeanInfo();
87: }
88:
89: public static GBeanInfo getGBeanInfo() {
90: return HOWLLogGBean.GBEAN_INFO;
91: }
92:
93: }
|