本文整理匯總了Java中com.arjuna.ats.arjuna.coordinator.TxControl類的典型用法代碼示例。如果您正苦於以下問題:Java TxControl類的具體用法?Java TxControl怎麽用?Java TxControl使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
TxControl類屬於com.arjuna.ats.arjuna.coordinator包,在下文中一共展示了TxControl類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: stopTM
import com.arjuna.ats.arjuna.coordinator.TxControl; //導入依賴的package包/類
public static void stopTM() {
try {
TransactionReaper.terminate(true);
TxControl.disable(true);
} catch (Exception e) {
e.printStackTrace();
}
tm = null;
}
示例2: setUp
import com.arjuna.ats.arjuna.coordinator.TxControl; //導入依賴的package包/類
@Override
@Before
public void setUp() throws Exception {
super.setUp();
Iterator<ServerGroup> iter = groups.values().iterator();
while (iter.hasNext()) {
iter.next().start();
}
TxControl.enable();
}
示例3: tearDown
import com.arjuna.ats.arjuna.coordinator.TxControl; //導入依賴的package包/類
@Override
@After
public void tearDown() throws Exception {
Iterator<ServerGroup> iter = groups.values().iterator();
while (iter.hasNext()) {
iter.next().stop();
}
TxControl.disable(true);
TransactionReaper.terminate(false);
super.tearDown();
}
示例4: tearDown
import com.arjuna.ats.arjuna.coordinator.TxControl; //導入依賴的package包/類
@Override
@After
public void tearDown() throws Exception {
if (TxUtils.isUncommitted(tm)) {
// roll it back
try {
tm.rollback();
} catch (Throwable ignore) {
// The connection will probably be closed so this may well throw an exception
}
}
if (tm.getTransaction() != null) {
Transaction tx = tm.suspend();
if (tx != null) {
ExtrasTestLogger.LOGGER.warn("Transaction still associated with thread " + tx +
" at status " +
TxUtils.getStatusAsString(tx.getStatus()));
}
}
if (suspendedTx != null) {
tm.resume(suspendedTx);
}
TxControl.disable(true);
TransactionReaper.terminate(false);
super.tearDown();
}
示例5: setUp
import com.arjuna.ats.arjuna.coordinator.TxControl; //導入依賴的package包/類
@Override
@Before
public void setUp() throws Exception {
super.setUp();
xacf = ActiveMQJMSClient.createConnectionFactory("tcp://localhost:61616", "test");
queue1 = createQueue("queue1");
topic1 = createTopic("topic1");
TxControl.enable();
}
示例6: startTM
import com.arjuna.ats.arjuna.coordinator.TxControl; //導入依賴的package包/類
public static void startTM() {
tm = new TransactionManagerImple();
TxControl.enable();
}
示例7: tearDown
import com.arjuna.ats.arjuna.coordinator.TxControl; //導入依賴的package包/類
@Override
@After
public void tearDown() throws Exception {
checkEmpty(sourceQueue, 0);
checkEmpty(localTargetQueue, 0);
checkEmpty(targetQueue, 1);
// Check no subscriptions left lying around
checkNoSubscriptions(sourceTopic, 0);
if (cff0 instanceof ActiveMQConnectionFactory) {
((ActiveMQConnectionFactory) cff0).close();
}
if (cff1 instanceof ActiveMQConnectionFactory) {
((ActiveMQConnectionFactory) cff1).close();
}
stopComponent(jmsServer0);
stopComponent(jmsServer1);
cff0 = cff1 = null;
cff0xa = cff1xa = null;
cf0 = cf1 = null;
cf0xa = cf1xa = null;
sourceQueueFactory = targetQueueFactory = localTargetQueueFactory = sourceTopicFactory = null;
sourceQueue = targetQueue = localTargetQueue = null;
sourceTopic = null;
server0 = null;
jmsServer0 = null;
server1 = null;
jmsServer1 = null;
if (context0 != null)
context0.close();
context0 = null;
if (context1 != null)
context1.close();
context1 = null;
// Shutting down Arjuna threads
TxControl.disable(true);
TransactionReaper.terminate(false);
super.tearDown();
}
示例8: setUp
import com.arjuna.ats.arjuna.coordinator.TxControl; //導入依賴的package包/類
@Override
@Before
public void setUp() throws Exception {
super.setUp();
xacf = ActiveMQJMSClient.createConnectionFactory("tcp://localhost:61616", "test");
queue1 = createQueue("queue1");
TxControl.enable();
tm = new TransactionManagerImple();
Assert.assertTrue(tm instanceof TransactionManagerImple);
suspendedTx = tm.suspend();
}
示例9: tearDown
import com.arjuna.ats.arjuna.coordinator.TxControl; //導入依賴的package包/類
@Override
@After
public void tearDown() throws Exception {
TxControl.disable(true);
TransactionReaper.terminate(false);
super.tearDown();
}
示例10: setUp
import com.arjuna.ats.arjuna.coordinator.TxControl; //導入依賴的package包/類
@Override
@Before
public void setUp() throws Exception {
super.setUp();
// Start the servers
Configuration conf0 = createBasicConfig().setJournalDirectory(getJournalDir(0, false)).setBindingsDirectory(getBindingsDir(0, false)).addAcceptorConfiguration(new TransportConfiguration(INVM_ACCEPTOR_FACTORY));
server0 = addServer(ActiveMQServers.newActiveMQServer(conf0, false));
context0 = new InVMNamingContext();
jmsServer0 = new JMSServerManagerImpl(server0);
jmsServer0.setRegistry(new JndiBindingRegistry(context0));
jmsServer0.start();
params1 = new HashMap<>();
params1.put(TransportConstants.SERVER_ID_PROP_NAME, 1);
Configuration conf1 = createBasicConfig().setJournalDirectory(getJournalDir(1, false)).setBindingsDirectory(getBindingsDir(1, false)).addAcceptorConfiguration(new TransportConfiguration(INVM_ACCEPTOR_FACTORY, params1));
server1 = addServer(ActiveMQServers.newActiveMQServer(conf1, false));
context1 = new InVMNamingContext();
jmsServer1 = new JMSServerManagerImpl(server1);
jmsServer1.setRegistry(new JndiBindingRegistry(context1));
jmsServer1.start();
createQueue("sourceQueue", 0);
jmsServer0.createTopic(false, "sourceTopic", "/topic/sourceTopic");
createQueue("localTargetQueue", 0);
createQueue("targetQueue", 1);
setUpAdministeredObjects();
TxControl.enable();
// We need a local transaction and recovery manager
// We must start this after the remote servers have been created or it won't
// have deleted the database and the recovery manager may attempt to recover transactions
}