use of org.jboss.tm.ExtendedJBossXATerminator in project narayana by jbosstm.
the class ServerImpl method locateOrImportTransactionThenResumeIt.
@Override
public Xid locateOrImportTransactionThenResumeIt(int remainingTimeout, Xid toResume) throws XAException, IllegalStateException, SystemException, IOException {
JBossXATerminator xaTerminator = transactionManagerService.getJbossXATerminator();
if (!ExtendedJBossXATerminator.class.isInstance(xaTerminator)) {
System.out.printf("ExtendedJBossXATerminator: FAIL not an instance");
return null;
}
ExtendedJBossXATerminator extendedJBossXATerminator = (ExtendedJBossXATerminator) xaTerminator;
boolean subordinateCreated = false;
Transaction transaction = extendedJBossXATerminator.getTransaction(toResume);
if (transaction == null) {
TransactionImportResult transactionImportResult = extendedJBossXATerminator.importTransaction(toResume, remainingTimeout);
subordinateCreated = transactionImportResult.isNewImportedTransaction();
transaction = transactionImportResult.getTransaction();
}
transactionManagerService.getTransactionManager().resume(transaction);
return subordinateCreated ? ((com.arjuna.ats.jta.transaction.Transaction) transaction).getTxId() : null;
}
Aggregations