Search in sources :

Example 16 with HOWLLog

use of org.apache.geronimo.transaction.log.HOWLLog in project aries by apache.

the class TransactionControlImpl method getLog.

private HOWLLog getLog(BundleContext ctx) throws Exception {
    Object recovery = config.getOrDefault("recovery.log.enabled", false);
    if (recovery instanceof Boolean ? (Boolean) recovery : Boolean.valueOf(recovery.toString())) {
        String logFileExt = "log";
        String logFileName = "transaction";
        String logFileDir;
        Object o = config.get("recovery.log.dir");
        if (o == null) {
            logFileDir = ctx.getDataFile("recoveryLog").getAbsolutePath();
        } else {
            logFileDir = o.toString();
        }
        File f = new File(logFileDir);
        if (f.exists() && !f.isDirectory()) {
            throw new IllegalArgumentException("The recovery log directory " + logFileDir + " is not a directory.");
        }
        HOWLLog log = new HOWLLog("org.objectweb.howl.log.BlockLogBuffer", 4, true, true, 50, logFileDir, logFileExt, logFileName, -1, 0, 2, 4, -1, true, xidFactory, null);
        return log;
    }
    // null means a non-recoverable log
    return null;
}
Also used : HOWLLog(org.apache.geronimo.transaction.log.HOWLLog) File(java.io.File)

Aggregations

HOWLLog (org.apache.geronimo.transaction.log.HOWLLog)16 File (java.io.File)14 RandomAccessFile (java.io.RandomAccessFile)11 Test (org.junit.Test)11 Hashtable (java.util.Hashtable)10 XidFactory (org.apache.geronimo.transaction.manager.XidFactory)3 GeronimoTransactionManager (org.apache.geronimo.transaction.manager.GeronimoTransactionManager)2 TransactionLog (org.apache.geronimo.transaction.manager.TransactionLog)2 ConfigurationException (org.osgi.service.cm.ConfigurationException)2 FilenameFilter (java.io.FilenameFilter)1 IOException (java.io.IOException)1 Field (java.lang.reflect.Field)1 HashMap (java.util.HashMap)1 Matcher (java.util.regex.Matcher)1 XAException (javax.transaction.xa.XAException)1 XAResource (javax.transaction.xa.XAResource)1 UnrecoverableLog (org.apache.geronimo.transaction.log.UnrecoverableLog)1 NamedXAResource (org.apache.geronimo.transaction.manager.NamedXAResource)1 Recovery (org.apache.geronimo.transaction.manager.Recovery)1 TransactionBranchInfo (org.apache.geronimo.transaction.manager.TransactionBranchInfo)1