Examples of XidFactory


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

        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.XidFactory

        ((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.XidFactory

                                                    int maxBlocksPerFile,
                                                    int maxBuffers,
                                                    int maxLogFiles,
                                                    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,
View Full Code Here

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

                                                    int maxBlocksPerFile,
                                                    int maxBuffers,
                                                    int maxLogFiles,
                                                    int minBuffers,
                                                    int threadsWaitingForceThreshold) throws Exception {
        XidFactory xidFactory = null;
        TransactionLog txLog = null;
        if (txRecovery) {
            SystemInstance.get().setComponent(XAResourceWrapper.class, new GeronimoXAResourceWrapper());
           
            xidFactory = new XidFactoryImpl(tmId == null ? DEFAULT_TM_ID: tmId);
View Full Code Here

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

        assertTrue(r2_2.isCommitted());
        assertTrue(recovery.localRecoveryComplete());
    }

    public void testImportedXidRecovery() throws Exception {
        XidFactory xidFactory2 = new XidFactoryImpl("tm2".getBytes());
        Xid xid = xidFactory2.createXid();
        tm.begin(xid, 1000);
        Transaction tx = tm.getTransaction();
        tx.enlistResource(r1_2);
        tx.enlistResource(r2_2);
        tx.delistResource(r1_2, XAResource.TMSUCCESS);
View Full Code Here

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

        }
        if (defaultTransactionTimeoutSeconds == null) {
            defaultTransactionTimeoutSeconds = (int) TimeUnit.SECONDS.convert(defaultTransactionTimeout.getTime(), defaultTransactionTimeout.getUnit());
        }

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

            xidFactory = new XidFactoryImpl(tmId == null ? DEFAULT_TM_ID : tmId);
View Full Code Here

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

        }
        if (defaultTransactionTimeoutSeconds == null) {
            defaultTransactionTimeoutSeconds = (int) TimeUnit.SECONDS.convert(defaultTransactionTimeout.getTime(), defaultTransactionTimeout.getUnit());
        }

        XidFactory xidFactory = null;
        TransactionLog txLog = null;
        if (txRecovery) {
            SystemInstance.get().setComponent(XAResourceWrapper.class, new GeronimoXAResourceWrapper());
           
            xidFactory = new XidFactoryImpl(tmId == null ? DEFAULT_TM_ID: tmId);
View Full Code Here

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

            throw new ConfigurationException(TRANSACTION_TIMEOUT, NLS.MESSAGES.getMessage("tx.timeout.greaterthan.zero"));
        }

        final String tmid = getString(TMID, pid);
        // the max length of the factory should be 64
        XidFactory xidFactory = new XidFactoryImpl(tmid.substring(0, Math.min(tmid.length(), 64)).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, 4);
            if (bufferSizeKBytes < 1 || bufferSizeKBytes > 32) {
View Full Code Here

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

        assertEquals(l1, l2);
    }

    @Test
    public void testAriesFactory() throws Exception {
        XidFactory factory = new XidFactoryImpl("hi".getBytes());
        Xid id1 = factory.createXid();
        Xid id2 = factory.createXid();

        assertFalse("Should not match new: " + id1, factory.matchesGlobalId(id1.getGlobalTransactionId()));
        assertFalse("Should not match new: " + id2, factory.matchesGlobalId(id2.getGlobalTransactionId()));

        Xid b_id1 = factory.createBranch(id1, 1);
        Xid b_id2 = factory.createBranch(id2, 1);

        assertFalse("Should not match new branch: " + b_id1, factory.matchesBranchId(b_id1.getBranchQualifier()));
        assertFalse("Should not match new branch: " + b_id2, factory.matchesBranchId(b_id2.getBranchQualifier()));

        Thread.sleep(5);

        XidFactory factory2 = new XidFactoryImpl("hi".getBytes());
        assertTrue("Should match old: " + id1, factory2.matchesGlobalId(id1.getGlobalTransactionId()));
        assertTrue("Should match old: " + id2, factory2.matchesGlobalId(id2.getGlobalTransactionId()));

        assertTrue("Should match old branch: " + b_id1, factory2.matchesBranchId(b_id1.getBranchQualifier()));
        assertTrue("Should match old branch: " + b_id2, factory2.matchesBranchId(b_id2.getBranchQualifier()));
    }
View Full Code Here

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

    @Test
    @Ignore
    public void testGeronimo() throws Exception {
        System.err.println("Geronimo");
        XidFactory xidFactory = new XidFactoryImpl("hi".getBytes());
        HOWLLog txLog = new HOWLLog("org.objectweb.howl.log.BlockLogBuffer",
                4,
                true,
                true,
                50,
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.