/** * <p> * Calling {@link JBossXATerminator} to cancel the work for us. * <p> * There should not be need any action to be processed by wildfly transaction client. */ @Override public void cancelWork(Work work, Xid xid) { jbossXATerminator.cancelWork(work, xid); }
/** * <p> * Interception of register work call to get transaction being imported to wildfly transacton client. * <p> * For importing a transaction Wildfly transaction client eventually calls {@link SubordinationManager} * as Narayana {@link XATerminator}s do. This wrapping then let wildfly transacton client to register the transaction * for itself, wildfly transacton client then import transaction to Narayana too and finally this method * uses Narayana's {@link XATerminator} to register all {@link Work}s binding.<br> * Narayana's {@link XATerminator} tries to import transaction too but as transaction is already * imported it just gets instance of transaction already imported via call of wildfly transacton client. */ @Override public void registerWork(Work work, Xid xid, long timeout) throws WorkCompletedException { try { // jca provides timeout in milliseconds, SubordinationManager expects seconds int timeout_seconds = (int) timeout/1000; // unlimited timeout for jca means -1 which fails in wfly client if(timeout_seconds <= 0) timeout_seconds = ContextTransactionManager.getGlobalDefaultTransactionTimeout(); localTransactionContext.findOrImportTransaction(xid, timeout_seconds); } catch (XAException xae) { throw TransactionLogger.ROOT_LOGGER.cannotFindOrImportInflowTransaction(xid, work, xae); } jbossXATerminator.registerWork(work, xid, timeout); }
workManager.getXATerminator().registerWork(work, xid, timeout); if (xid != null) workManager.getXATerminator().startWork(work, xid);
/** * Invoked when transaction inflow work ends * * @param work The work ending * @param xid The xid of the work */ public void endWork(Work work, Xid xid) { delegator.endWork(work, xid); }
/** * Invoked for transaction inflow of work * * @param work The work starting * @param xid The xid of the work * @throws WorkCompletedException With error code WorkException.TX_RECREATE_FAILED if it is unable * to recreate the transaction context */ public void startWork(Work work, Xid xid) throws WorkCompletedException { delegator.startWork(work, xid); }
/** * {@inheritDoc} */ public int prepare(Xid xid) throws XAException { return delegator.prepare(xid); }
/** * {@inheritDoc} */ public void commit(Xid xid, boolean onePhase) throws XAException { delegator.commit(xid, onePhase); }
/** * {@inheritDoc} */ public void forget(Xid xid) throws XAException { delegator.forget(xid); }
/** * End */ protected void end() { if (trace) { log.trace("Ending work " + this); } ExecutionContext ctx = getExecutionContext(); if (ctx != null) { Xid xid = ctx.getXid(); if (xid != null) { workManager.getXATerminator().endWork(work, xid); } } if (trace) { log.trace("Ended work " + this); } }
/** * <p> * Suspending transaction and canceling the work. * <p> * Suspend transaction has to be called on the wildfly transaction manager * and the we delegate work cancellation to {@link JBossXATerminator}.<br> * First we have to cancel the work for jboss terminator would not work with * suspended transaction. */ @Override public void endWork(Work work, Xid xid) { jbossXATerminator.cancelWork(work, xid); try { ContextTransactionManager.getInstance().suspend(); } catch (SystemException se) { throw TransactionLogger.ROOT_LOGGER.cannotSuspendInflowTransactionUnexpectedError(work, se); } }
/** * Invoked for transaction inflow of work * * @param work The work starting * @param xid The xid of the work * @param timeout The transaction timeout * @throws WorkCompletedException with error code WorkException.TX_CONCURRENT_WORK_DISALLOWED * when work is already present for the xid or whose completion is in progress, only * the global part of the xid must be used for this check. */ public void registerWork(Work work, Xid xid, long timeout) throws WorkCompletedException { delegator.registerWork(work, xid, timeout); }
/** * <p> * Calling {@link JBossXATerminator} to cancel the work for us. * <p> * There should not be need any action to be processed by wildfly transaction client. */ @Override public void cancelWork(Work work, Xid xid) { jbossXATerminator.cancelWork(work, xid); }
/** * <p> * Interception of register work call to get transaction being imported to wildfly transacton client. * <p> * For importing a transaction Wildfly transaction client eventually calls {@link SubordinationManager} * as Narayana {@link XATerminator}s do. This wrapping then let wildfly transacton client to register the transaction * for itself, wildfly transacton client then import transaction to Narayana too and finally this method * uses Narayana's {@link XATerminator} to register all {@link Work}s binding.<br> * Narayana's {@link XATerminator} tries to import transaction too but as transaction is already * imported it just gets instance of transaction already imported via call of wildfly transacton client. */ @Override public void registerWork(Work work, Xid xid, long timeout) throws WorkCompletedException { try { // jca provides timeout in milliseconds, SubordinationManager expects seconds int timeout_seconds = (int) timeout/1000; // unlimited timeout for jca means -1 which fails in wfly client if(timeout_seconds <= 0) timeout_seconds = ContextTransactionManager.getGlobalDefaultTransactionTimeout(); localTransactionContext.findOrImportTransaction(xid, timeout_seconds); } catch (XAException xae) { throw TransactionLogger.ROOT_LOGGER.cannotFindOrImportInflowTransaction(xid, work, xae); } jbossXATerminator.registerWork(work, xid, timeout); }
/** * Invoked when the work fails * * @param work The work ending * @param xid The xid of the work */ public void cancelWork(Work work, Xid xid) { delegator.cancelWork(work, xid); } }
/** * <p> * Interception of register work call to get transaction being imported to wildfly transacton client. * <p> * For importing a transaction Wildfly transaction client eventually calls {@link SubordinationManager} * as Narayana {@link XATerminator}s do. This wrapping then let wildfly transacton client to register the transaction * for itself, wildfly transacton client then import transaction to Narayana too and finally this method * uses Narayana's {@link XATerminator} to register all {@link Work}s binding.<br> * Narayana's {@link XATerminator} tries to import transaction too but as transaction is already * imported it just gets instance of transaction already imported via call of wildfly transacton client. */ @Override public void registerWork(Work work, Xid xid, long timeout) throws WorkCompletedException { try { // jca provides timeout in milliseconds, SubordinationManager expects seconds int timeout_seconds = (int) timeout/1000; // unlimited timeout for jca means -1 which fails in wfly client if(timeout_seconds <= 0) timeout_seconds = ContextTransactionManager.getGlobalDefaultTransactionTimeout(); localTransactionContext.findOrImportTransaction(xid, timeout_seconds); } catch (XAException xae) { throw TransactionLogger.ROOT_LOGGER.cannotFindOrImportInflowTransaction(xid, work, xae); } jbossXATerminator.registerWork(work, xid, timeout); }
/** * <p> * Calling {@link JBossXATerminator} to cancel the work for us. * <p> * There should not be need any action to be processed by wildfly transaction client. */ @Override public void cancelWork(Work work, Xid xid) { jbossXATerminator.cancelWork(work, xid); }
/** * Cancel */ protected void cancel() { if (trace) log.trace("Cancel work " + this); ExecutionContext ctx = getExecutionContext(); if (ctx != null) { Xid xid = ctx.getXid(); if (xid != null) { workManager.getXATerminator().cancelWork(work, xid); } } if (trace) log.trace("Canceled work " + this); }
/** * <p> * Suspending transaction and canceling the work. * <p> * Suspend transaction has to be called on the wildfly transaction manager * and the we delegate work cancellation to {@link JBossXATerminator}.<br> * First we have to cancel the work for jboss terminator would not work with * suspended transaction. */ @Override public void endWork(Work work, Xid xid) { jbossXATerminator.cancelWork(work, xid); try { ContextTransactionManager.getInstance().suspend(); } catch (SystemException se) { throw TransactionLogger.ROOT_LOGGER.cannotSuspendInflowTransactionUnexpectedError(work, se); } }
/** * <p> * Suspending transaction and canceling the work. * <p> * Suspend transaction has to be called on the wildfly transaction manager * and the we delegate work cancellation to {@link JBossXATerminator}.<br> * First we have to cancel the work for jboss terminator would not work with * suspended transaction. */ @Override public void endWork(Work work, Xid xid) { jbossXATerminator.cancelWork(work, xid); try { ContextTransactionManager.getInstance().suspend(); } catch (SystemException se) { throw TransactionLogger.ROOT_LOGGER.cannotSuspendInflowTransactionUnexpectedError(work, se); } }