Save This Page
Home » geronimo-2.2-source-release » org.apache.geronimo.transaction.log » [javadoc | source]
    1   /**
    2    *  Licensed to the Apache Software Foundation (ASF) under one or more
    3    *  contributor license agreements.  See the NOTICE file distributed with
    4    *  this work for additional information regarding copyright ownership.
    5    *  The ASF licenses this file to You under the Apache License, Version 2.0
    6    *  (the "License"); you may not use this file except in compliance with
    7    *  the License.  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: 698441 $ $Date: 2008-09-24 00:10:08 -0700 (Wed, 24 Sep 2008) $
   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, GBeanInfoBuilder.DEFAULT_J2EE_TYPE);
   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   }

Save This Page
Home » geronimo-2.2-source-release » org.apache.geronimo.transaction.log » [javadoc | source]