Examples of XidFactoryImpl


Examples of org.apache.geronimo.transaction.manager.XidFactoryImpl

    private TransactionContextManager transactionContextManager;
    private XidFactory xidFactory = new XidFactoryImpl("geronimo.test.tm".getBytes());

    protected void setUp() throws Exception {
        TransactionManagerImpl tm = new TransactionManagerImpl(1000,
                new XidFactoryImpl("WHAT DO WE CALL IT?".getBytes()), null, null);
        transactionContextManager = new TransactionContextManager(tm, tm);
    }
View Full Code Here

Examples of org.apache.geronimo.transaction.manager.XidFactoryImpl

        XidFactory xidFactory = null;
        TransactionLog txLog = null;
        if (txRecovery) {
            SystemInstance.get().setComponent(XAResourceWrapper.class, new GeronimoXAResourceWrapper());

            xidFactory = new XidFactoryImpl(tmId == null ? DEFAULT_TM_ID : tmId);
            txLog = new HOWLLog(bufferClassName == null ? "org.objectweb.howl.log.BlockLogBuffer" : bufferClassName,
                bufferSizeKb == 0 ? DEFAULT_BUFFER_SIZE : bufferSizeKb,
                checksumEnabled,
                adler32Checksum,
                flushSleepTimeMilliseconds,
View Full Code Here

Examples of org.apache.geronimo.transaction.manager.XidFactoryImpl

        XidFactory xidFactory = null;
        TransactionLog txLog = null;
        if (txRecovery) {
            SystemInstance.get().setComponent(XAResourceWrapper.class, new GeronimoXAResourceWrapper());

            xidFactory = new XidFactoryImpl(tmId == null ? DEFAULT_TM_ID : tmId);
            txLog = new HOWLLog(bufferClassName == null ? "org.objectweb.howl.log.BlockLogBuffer" : bufferClassName,
                bufferSizeKb == 0 ? DEFAULT_BUFFER_SIZE : bufferSizeKb,
                checksumEnabled,
                adler32Checksum,
                flushSleepTimeMilliseconds,
View Full Code Here

Examples of org.apache.geronimo.transaction.manager.XidFactoryImpl

        int transactionTimeout = getInt(TRANSACTION_TIMEOUT, DEFAULT_TRANSACTION_TIMEOUT);
        if (transactionTimeout <= 0) {
            throw new ConfigurationException(TRANSACTION_TIMEOUT, "Property " + TRANSACTION_TIMEOUT + " must be > 0");
        }
        // XID factory
        XidFactory xidFactory = new XidFactoryImpl(pid.getBytes());
        // Transaction log
        if (getBool(RECOVERABLE, DEFAULT_RECOVERABLE)) {
            String bufferClassName = getString(HOWL_BUFFER_CLASS_NAME, "org.objectweb.howl.log.BlockLogBuffer");
            int bufferSizeKBytes = getInt(HOWL_BUFFER_SIZE, 32);
            if (bufferSizeKBytes < 1 || bufferSizeKBytes > 32) {
                throw new ConfigurationException(HOWL_BUFFER_SIZE, "bufferSize must be between 1 and 32");
            }
            boolean checksumEnabled = getBool(HOWL_CHECKSUM_ENABLED, true);
            boolean adler32Checksum = getBool(HOWL_ADLER32_CHECKSUM, true);
            int flushSleepTimeMilliseconds = getInt(HOWL_FLUSH_SLEEP_TIME, 50);
            String logFileExt = getString(HOWL_LOG_FILE_EXT, "log");
            String logFileName = getString(HOWL_LOG_FILE_NAME, "transaction");
            int maxBlocksPerFile = getInt(HOWL_MAX_BLOCKS_PER_FILE, -1);
            int maxLogFiles = getInt(HOWL_MAX_LOG_FILES, 2);
            int minBuffers = getInt(HOWL_MIN_BUFFERS, 4);
            if (minBuffers < 0) {
                throw new ConfigurationException(HOWL_MIN_BUFFERS, "minBuffers must be > 0");
            }
            int maxBuffers = getInt(HOWL_MAX_BUFFERS, 0);
            if (maxBuffers > 0 && minBuffers < maxBuffers) {
                throw new ConfigurationException(HOWL_MAX_BUFFERS, "minBuffers must be <= maxBuffers");
            }
            int threadsWaitingForceThreshold = getInt(HOWL_THREADS_WAITING_FORCE_THRESHOLD, -1);
            String logFileDir = getString(HOWL_LOG_FILE_DIR, null);
            if (logFileDir == null || logFileDir.length() == 0 || !new File(logFileDir).isAbsolute()) {
                throw new ConfigurationException(HOWL_LOG_FILE_DIR, "Property should be set to an absolute directory");
            }
            try {
                transactionLog = new HOWLLog(bufferClassName,
                                             bufferSizeKBytes,
                                             checksumEnabled,
                                             adler32Checksum,
                                             flushSleepTimeMilliseconds,
                                             logFileDir,
                                             logFileExt,
                                             logFileName,
                                             maxBlocksPerFile,
                                             maxBuffers,
                                             maxLogFiles,
                                             minBuffers,
                                             threadsWaitingForceThreshold,
                                             xidFactory != null ? xidFactory : new XidFactoryImpl(),
                                             null);
            } catch (LogConfigurationException e) {
                // This should not really happen as we've checked properties earlier
                throw new ConfigurationException(null, null, e);
            } catch (IOException e) {
View Full Code Here

Examples of org.apache.geronimo.transaction.manager.XidFactoryImpl

        super();
    }

    public void start() {
        try {
            XidFactory xidFactory = new XidFactoryImpl();
            howlLog =
                new HOWLLog(bufferClassName, bufferSizeKBytes, checksumEnabled, adler32Checksum,
                            flushSleepTimeMilliseconds, logFileDir, logFileExt, logFileName, maxBlocksPerFile,
                            maxBuffers, maxLogFiles, minBuffers, threadsWaitingForceThreshold, xidFactory,
                            serverBaseDir);
View Full Code Here

Examples of org.apache.geronimo.transaction.manager.XidFactoryImpl

        ((HOWLLog) transactionLog).doStop();
    }


    protected TransactionLog createTransactionLog() throws Exception {
        XidFactory xidFactory = new XidFactoryImpl();
        HOWLLog howlLog = new HOWLLog(
                "org.objectweb.howl.log.BlockLogBuffer", //                "bufferClassName",
                4, //                "bufferSizeKBytes",
                true, //                "checksumEnabled",
                true, //                "adler32Checksum",
View Full Code Here

Examples of org.apache.geronimo.transaction.manager.XidFactoryImpl

        super(getConstructorParams(defaultTransactionTimeoutSeconds, transactionLog, (ReferenceCollection)resourceManagers));
    }

    private static TransactionManagerProxy.ConstructorParams getConstructorParams(int defaultTransactionTimeoutSeconds, TransactionLog transactionLog, ReferenceCollection resourceManagers) throws SystemException {
        TransactionManagerProxy.ConstructorParams params = new TransactionManagerProxy.ConstructorParams();
        XidFactory xidFactory = new XidFactoryImpl("WHAT DO WE CALL IT?".getBytes());
        if (transactionLog == null) {
            transactionLog = new UnrecoverableLog();
        }
        ExtendedTransactionManager delegate = new TransactionManagerImpl(defaultTransactionTimeoutSeconds, transactionLog, xidFactory);
        Recovery recovery = new RecoveryImpl(transactionLog, xidFactory);
View Full Code Here

Examples of org.apache.geronimo.transaction.manager.XidFactoryImpl

        assertTrue(recovery.localRecoveryComplete());
    }

    public void testImportedXidRecovery() throws Exception {
        //create a transaction from an external transaction manager.
        XidFactory xidFactory2 = new XidFactoryImpl("tm2".getBytes());
        Xid xid = xidFactory2.createXid();
        Transaction tx = tm.importXid(xid, 0);
        tm.resume(tx);
        assertSame(tx, tm.getTransaction());
        tx.enlistResource(r1_2);
        tx.enlistResource(r2_2);
View Full Code Here

Examples of org.apache.geronimo.transaction.manager.XidFactoryImpl

        ((HOWLLog) transactionLog).doStop();
    }


    protected TransactionLog createTransactionLog() throws Exception {
        XidFactory xidFactory = new XidFactoryImpl();
        HOWLLog howlLog = new HOWLLog(
                "org.objectweb.howl.log.BlockLogBuffer", //                "bufferClassName",
                4, //                "bufferSizeKBytes",
                true, //                "checksumEnabled",
                20, //                "flushSleepTime",
View Full Code Here

Examples of org.apache.geronimo.transaction.manager.XidFactoryImpl

                                                    int minBuffers,
                                                    int threadsWaitingForceThreshold) throws Exception {
        XidFactory xidFactory = null;
        TransactionLog txLog = null;
        if (maxLogFiles > 0) {
            xidFactory = new XidFactoryImpl(tmId == null ? DEFAULT_TM_ID: tmId);
            txLog = new HOWLLog(bufferClassName == null ? "org.objectweb.howl.log.BlockLogBuffer" : bufferClassName,
                    bufferSizeKb == 0 ? DEFAULT_BUFFER_SIZE : bufferSizeKb,
                    checksumEnabled,
                    adler32Checksum,
                    flushSleepTimeMilliseconds,
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.