geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject cvs commit: incubator-geronimo/modules/transaction/src/test/org/apache/geronimo/transaction/manager HOWLLogRecoveryTest.java
Date Fri, 25 Jun 2004 21:29:34 GMT
djencks     2004/06/25 14:29:34

  Modified:    modules/assembly project.xml
               modules/assembly/src/plan j2ee-server-plan.xml
               modules/transaction project.xml
               modules/transaction/src/java/org/apache/geronimo/transaction/log
                        HOWLLog.java
               modules/transaction/src/test/org/apache/geronimo/transaction/log
                        HOWLLogTest.java
               modules/transaction/src/test/org/apache/geronimo/transaction/manager
                        HOWLLogRecoveryTest.java
  Log:
  Put tx log files in place based on serverInfo.  Use howl 0.1.3
  
  Revision  Changes    Path
  1.28      +2 -2      incubator-geronimo/modules/assembly/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/assembly/project.xml,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- project.xml	24 Jun 2004 20:59:47 -0000	1.27
  +++ project.xml	25 Jun 2004 21:29:34 -0000	1.28
  @@ -208,7 +208,7 @@
           <dependency>
                <groupId>howl</groupId>
               <artifactId>howl-logger</artifactId>
  -            <version>0.1.1</version>
  +            <version>0.1.3</version>
               <url>http://forge.objectweb.org/projects/howl</url>
               <properties>
                   <repository>true</repository>
  
  
  
  1.32      +4 -4      incubator-geronimo/modules/assembly/src/plan/j2ee-server-plan.xml
  
  Index: j2ee-server-plan.xml
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/assembly/src/plan/j2ee-server-plan.xml,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- j2ee-server-plan.xml	25 Jun 2004 10:57:34 -0000	1.31
  +++ j2ee-server-plan.xml	25 Jun 2004 21:29:34 -0000	1.32
  @@ -69,7 +69,7 @@
           <uri>activemq/jars/activemq-1.0-SNAPSHOT.jar</uri>
       </dependency>
       <dependency>
  -        <uri>howl/jars/howl-logger-0.1.1.jar</uri>
  +        <uri>howl/jars/howl-logger-0.1.3.jar</uri>
       </dependency>
   
       <!-- required for rar 1.5 to load realms -->
  @@ -145,7 +145,7 @@
           <attribute name="bufferSizeKBytes" type="int">4096</attribute>
           <attribute name="checksumEnabled" type="boolean">true</attribute>
           <attribute name="flushSleepTimeMilliseconds" type="int">50</attribute>
  -        <attribute name="logFileDir" type="java.lang.String">txlog</attribute>
  +        <attribute name="logFileDir" type="java.lang.String">var/txlog</attribute>
           <attribute name="logFileExt" type="java.lang.String">log</attribute>
           <attribute name="logFileName" type="java.lang.String">howl</attribute>
           <attribute name="maxBlocksPerFile" type="int">-1</attribute>
  @@ -153,14 +153,14 @@
           <attribute name="maxLogFiles" type="int">2</attribute>
           <attribute name="minBuffers" type="int">4</attribute>
           <attribute name="threadsWaitingForceThreshold" type="int">-1</attribute>
  -
  +        <reference name="serverInfo">geronimo.system:role=ServerInfo</reference>
       </gbean>
   
       <gbean name="geronimo.server:type=TransactionManager" class="org.apache.geronimo.transaction.GeronimoTransactionManager">
           <reference name="transactionLog">geronimo.server:type=HOWLTransactionLog</reference>
           <references name="resourceManagers">
               <pattern>geronimo.server:j2eeType=JCAManagedConnectionFactory,*</pattern>
  -            <pattern>geronimo.server:j2eeType=MessageDrivenBean,*</pattern>
  +            <pattern>geronimo.server:j2eeType=ActivationSpec,*</pattern>
           </references>
       </gbean>
   
  
  
  
  1.19      +10 -3     incubator-geronimo/modules/transaction/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/transaction/project.xml,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- project.xml	24 Jun 2004 20:59:52 -0000	1.18
  +++ project.xml	25 Jun 2004 21:29:34 -0000	1.19
  @@ -43,6 +43,13 @@
   
       <dependencies>
           <!-- Module Dependencies -->
  +        <!-- temp, for ServerInfo. Remove when it is moved to Kernel-->
  +        <dependency>
  +            <groupId>geronimo</groupId>
  +            <artifactId>geronimo-system</artifactId>
  +            <version>${pom.currentVersion}</version>
  +        </dependency>
  +
           <dependency>
               <groupId>geronimo</groupId>
               <artifactId>geronimo-kernel</artifactId>
  @@ -78,9 +85,9 @@
   
           <!--compiled by David Jencks, but tagged version-->
           <dependency>
  -             <groupId>howl</groupId>
  +            <groupId>howl</groupId>
               <artifactId>howl-logger</artifactId>
  -            <version>0.1.1</version>
  +            <version>0.1.3</version>
               <url>http://forge.objectweb.org/projects/howl</url>
           </dependency>
   
  
  
  
  1.4       +125 -104  incubator-geronimo/modules/transaction/src/java/org/apache/geronimo/transaction/log/HOWLLog.java
  
  Index: HOWLLog.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/transaction/src/java/org/apache/geronimo/transaction/log/HOWLLog.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- HOWLLog.java	22 Jun 2004 18:41:00 -0000	1.3
  +++ HOWLLog.java	25 Jun 2004 21:29:34 -0000	1.4
  @@ -28,26 +28,27 @@
   
   import javax.transaction.xa.Xid;
   
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogFactory;
  +import org.apache.geronimo.gbean.GBeanInfo;
  +import org.apache.geronimo.gbean.GBeanInfoFactory;
   import org.apache.geronimo.gbean.GBeanLifecycle;
   import org.apache.geronimo.gbean.WaitingException;
  -import org.apache.geronimo.gbean.GBeanInfoFactory;
  -import org.apache.geronimo.gbean.GBeanInfo;
  +import org.apache.geronimo.system.serverinfo.ServerInfo;
   import org.apache.geronimo.transaction.manager.LogException;
   import org.apache.geronimo.transaction.manager.TransactionBranchInfo;
   import org.apache.geronimo.transaction.manager.TransactionBranchInfoImpl;
   import org.apache.geronimo.transaction.manager.TransactionLog;
   import org.apache.geronimo.transaction.manager.XidFactory;
  -import org.apache.commons.logging.Log;
  -import org.apache.commons.logging.LogFactory;
  +import org.objectweb.howl.log.Configuration;
   import org.objectweb.howl.log.LogClosedException;
   import org.objectweb.howl.log.LogConfigurationException;
   import org.objectweb.howl.log.LogFileOverflowException;
   import org.objectweb.howl.log.LogRecord;
   import org.objectweb.howl.log.LogRecordSizeException;
  +import org.objectweb.howl.log.LogRecordType;
   import org.objectweb.howl.log.Logger;
   import org.objectweb.howl.log.ReplayListener;
  -import org.objectweb.howl.log.LogRecordType;
  -import org.objectweb.howl.log.Configuration;
   
   /**
    *
  @@ -64,8 +65,12 @@
   
       private static final Log log = LogFactory.getLog(HOWLLog.class);
   
  +    private final ServerInfo serverInfo;
  +    private String logFileDir;
  +
       private final Logger logger;
       private final Configuration configuration = new Configuration();
  +    private boolean started = false;
   
       public HOWLLog(
               String bufferClassName,
  @@ -79,13 +84,16 @@
               int maxBuffers,
               int maxLogFiles,
               int minBuffers,
  -            int threadsWaitingForceThreshold
  +            int threadsWaitingForceThreshold,
  +            ServerInfo serverInfo
               ) throws IOException {
  +        this.serverInfo = serverInfo;
           setBufferClassName(bufferClassName);
           setBufferSizeKBytes(bufferSize);
           setChecksumEnabled(checksumEnabled);
           setFlushSleepTimeMilliseconds(flushSleepTimeMilliseconds);
  -        setLogFileDir(logFileDir);
  +        //setLogFileDir(logFileDir);
  +        this.logFileDir = logFileDir;
           setLogFileExt(logFileExt);
           setLogFileName(logFileName);
           setMaxBlocksPerFile(maxBlocksPerFile);
  @@ -97,107 +105,117 @@
       }
   
       public String getLogFileDir() {
  -         return configuration.getLogFileDir();
  -     }
  +        return logFileDir;
  +    }
   
  -     public void setLogFileDir(String logDir) {
  -         configuration.setLogFileDir(logDir);
  -     }
  -
  -     public String getLogFileExt() {
  -         return configuration.getLogFileExt();
  -     }
  -
  -     public void setLogFileExt(String logFileExt) {
  -         configuration.setLogFileExt(logFileExt);
  -     }
  -
  -     public String getLogFileName() {
  -         return configuration.getLogFileName();
  -     }
  -
  -     public void setLogFileName(String logFileName) {
  -         configuration.setLogFileName(logFileName);
  -     }
  -
  -     public boolean isChecksumEnabled() {
  -         return configuration.isChecksumEnabled();
  -     }
  -
  -     public void setChecksumEnabled(boolean checksumOption) {
  -         configuration.setChecksumEnabled(checksumOption);
  -     }
  -
  -     public int getBufferSizeKBytes() {
  -         return configuration.getBufferSize();
  -     }
  -
  -     public void setBufferSizeKBytes(int bufferSize) {
  -         configuration.setBufferSize(bufferSize);
  -     }
  -
  -     public String getBufferClassName() {
  -         return configuration.getBufferClassName();
  -     }
  -
  -     public void setBufferClassName(String bufferClassName) {
  -         configuration.setBufferClassName(bufferClassName);
  -     }
  -
  -     public int getMaxBuffers() {
  -         return configuration.getMaxBuffers();
  -     }
  -
  -     public void setMaxBuffers(int maxBuffers) {
  -         configuration.setMaxBuffers(maxBuffers);
  -     }
  -
  -     public int getMinBuffers() {
  -         return configuration.getMinBuffers();
  -     }
  -
  -     public void setMinBuffers(int minBuffers) {
  -         configuration.setMinBuffers(minBuffers);
  -     }
  -
  -     public int getFlushSleepTimeMilliseconds() {
  -         return configuration.getFlushSleepTime();
  -     }
  -
  -     public void setFlushSleepTimeMilliseconds(int flushSleepTime) {
  -         configuration.setFlushSleepTime(flushSleepTime);
  -     }
  -
  -     public int getThreadsWaitingForceThreshold() {
  -         return configuration.getThreadsWaitingForceThreshold();
  -     }
  -
  -     public void setThreadsWaitingForceThreshold(int threadsWaitingForceThreshold) {
  -         configuration.setThreadsWaitingForceThreshold(threadsWaitingForceThreshold ==
-1? Integer.MAX_VALUE: threadsWaitingForceThreshold);
  -     }
  -
  -     public int getMaxBlocksPerFile() {
  -         return configuration.getMaxBlocksPerFile();
  -     }
  -
  -     public void setMaxBlocksPerFile(int maxBlocksPerFile) {
  -         configuration.setMaxBlocksPerFile(maxBlocksPerFile == -1? Integer.MAX_VALUE: maxBlocksPerFile);
  -     }
  -
  -     public int getMaxLogFiles() {
  -         return configuration.getMaxLogFiles();
  -     }
  -
  -     public void setMaxLogFiles(int maxLogFiles) {
  -         configuration.setMaxLogFiles(maxLogFiles);
  -     }
  +    public void setLogFileDir(String logDir) {
  +        this.logFileDir = logDir;
  +        if (started) {
  +            configuration.setLogFileDir(serverInfo.resolvePath(logDir));
  +        }
  +    }
   
  +    public String getLogFileExt() {
  +        return configuration.getLogFileExt();
  +    }
  +
  +    public void setLogFileExt(String logFileExt) {
  +        configuration.setLogFileExt(logFileExt);
  +    }
  +
  +    public String getLogFileName() {
  +        return configuration.getLogFileName();
  +    }
  +
  +    public void setLogFileName(String logFileName) {
  +        configuration.setLogFileName(logFileName);
  +    }
  +
  +    public boolean isChecksumEnabled() {
  +        return configuration.isChecksumEnabled();
  +    }
  +
  +    public void setChecksumEnabled(boolean checksumOption) {
  +        configuration.setChecksumEnabled(checksumOption);
  +    }
  +
  +    public int getBufferSizeKBytes() {
  +        return configuration.getBufferSize();
  +    }
  +
  +    public void setBufferSizeKBytes(int bufferSize) {
  +        configuration.setBufferSize(bufferSize);
  +    }
  +
  +    public String getBufferClassName() {
  +        return configuration.getBufferClassName();
  +    }
  +
  +    public void setBufferClassName(String bufferClassName) {
  +        configuration.setBufferClassName(bufferClassName);
  +    }
  +
  +    public int getMaxBuffers() {
  +        return configuration.getMaxBuffers();
  +    }
  +
  +    public void setMaxBuffers(int maxBuffers) {
  +        configuration.setMaxBuffers(maxBuffers);
  +    }
  +
  +    public int getMinBuffers() {
  +        return configuration.getMinBuffers();
  +    }
  +
  +    public void setMinBuffers(int minBuffers) {
  +        configuration.setMinBuffers(minBuffers);
  +    }
  +
  +    public int getFlushSleepTimeMilliseconds() {
  +        return configuration.getFlushSleepTime();
  +    }
  +
  +    public void setFlushSleepTimeMilliseconds(int flushSleepTime) {
  +        configuration.setFlushSleepTime(flushSleepTime);
  +    }
  +
  +    public int getThreadsWaitingForceThreshold() {
  +        return configuration.getThreadsWaitingForceThreshold();
  +    }
  +
  +    public void setThreadsWaitingForceThreshold(int threadsWaitingForceThreshold) {
  +        configuration.setThreadsWaitingForceThreshold(threadsWaitingForceThreshold == -1
? Integer.MAX_VALUE : threadsWaitingForceThreshold);
  +    }
  +
  +    public int getMaxBlocksPerFile() {
  +        return configuration.getMaxBlocksPerFile();
  +    }
  +
  +    public void setMaxBlocksPerFile(int maxBlocksPerFile) {
  +        configuration.setMaxBlocksPerFile(maxBlocksPerFile == -1 ? Integer.MAX_VALUE :
maxBlocksPerFile);
  +    }
  +
  +    public int getMaxLogFiles() {
  +        return configuration.getMaxLogFiles();
  +    }
  +
  +    public void setMaxLogFiles(int maxLogFiles) {
  +        configuration.setMaxLogFiles(maxLogFiles);
  +    }
  +
  +    public ServerInfo getServerInfo() {
  +        return serverInfo;
  +    }
   
       public void doStart() throws WaitingException, Exception {
  +        started = true;
  +        setLogFileDir(logFileDir);
  +
           logger.open();
       }
   
       public void doStop() throws WaitingException, Exception {
  +        started = false;
           logger.close();
       }
   
  @@ -405,9 +423,11 @@
           infoFactory.addAttribute("minBuffers", Integer.TYPE, true);
           infoFactory.addAttribute("threadsWaitingForceThreshold", Integer.TYPE, true);
   
  +        infoFactory.addReference("serverInfo", ServerInfo.class);
  +
           infoFactory.addInterface(TransactionLog.class);
   
  -        infoFactory.setConstructor(new String[] {
  +        infoFactory.setConstructor(new String[]{
               "bufferClassName",
               "bufferSizeKBytes",
               "checksumEnabled",
  @@ -419,7 +439,8 @@
               "maxBuffers",
               "maxLogFiles",
               "minBuffers",
  -            "threadsWaitingForceThreshold"});
  +            "threadsWaitingForceThreshold",
  +            "serverInfo"});
           GBEAN_INFO = infoFactory.getBeanInfo();
       }
   
  
  
  
  1.3       +5 -3      incubator-geronimo/modules/transaction/src/test/org/apache/geronimo/transaction/log/HOWLLogTest.java
  
  Index: HOWLLogTest.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/transaction/src/test/org/apache/geronimo/transaction/log/HOWLLogTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- HOWLLogTest.java	22 Jun 2004 18:41:00 -0000	1.2
  +++ HOWLLogTest.java	25 Jun 2004 21:29:34 -0000	1.3
  @@ -23,6 +23,7 @@
   import junit.framework.Test;
   import junit.framework.TestSuite;
   import org.apache.geronimo.transaction.manager.TransactionLog;
  +import org.apache.geronimo.system.serverinfo.ServerInfo;
   
   /**
    *
  @@ -49,14 +50,15 @@
                   4, //                "bufferSizeKBytes",
                   true, //                "checksumEnabled",
                   20, //                "flushSleepTime",
  -                "target", //                "logFileDir",
  +                "txlog", //                "logFileDir",
                   "log", //                "logFileExt",
                   LOG_FILE_NAME, //                "logFileName",
                   200, //                "maxBlocksPerFile",
                   10, //                "maxBuffers",
                   2, //                "maxLogFiles",
                   2, //                "minBuffers",
  -                10//                "threadsWaitingForceThreshold"});
  +                10,//                "threadsWaitingForceThreshold"});
  +                new ServerInfo("target")
           );
           howlLog.doStart();
           return howlLog;
  
  
  
  1.4       +5 -3      incubator-geronimo/modules/transaction/src/test/org/apache/geronimo/transaction/manager/HOWLLogRecoveryTest.java
  
  Index: HOWLLogRecoveryTest.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/transaction/src/test/org/apache/geronimo/transaction/manager/HOWLLogRecoveryTest.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- HOWLLogRecoveryTest.java	22 Jun 2004 18:41:00 -0000	1.3
  +++ HOWLLogRecoveryTest.java	25 Jun 2004 21:29:34 -0000	1.4
  @@ -20,6 +20,7 @@
   import java.io.File;
   
   import org.apache.geronimo.transaction.log.HOWLLog;
  +import org.apache.geronimo.system.serverinfo.ServerInfo;
   import junit.framework.Test;
   import junit.framework.TestSuite;
   import junit.extensions.TestSetup;
  @@ -47,14 +48,15 @@
                   4, //                "bufferSizeKBytes",
                   true, //                "checksumEnabled",
                   20, //                "flushSleepTime",
  -                "target", //                "logFileDir",
  +                "txlog", //                "logFileDir",
                   "log", //                "logFileExt",
                   LOG_FILE_NAME, //                "logFileName",
                   200, //                "maxBlocksPerFile",
                   10, //                "maxBuffers",                       log
                   2, //                "maxLogFiles",
                   2, //                "minBuffers",
  -                10//                "threadsWaitingForceThreshold"});
  +                10,//                "threadsWaitingForceThreshold"});
  +                new ServerInfo("target")
           );
           howlLog.doStart();
           txLog = howlLog;
  
  
  

Mime
View raw message