public void begin(int timeout) throws WrongStateException, SystemException { ((UserBusinessActivityImple)UserBusinessActivityImple.getUserBusinessActivity()).beginSubordinate(timeout); }
public String transactionIdentifier() { return ((UserBusinessActivityImple)UserBusinessActivityImple.getUserBusinessActivity()).transactionIdentifier(); } }
public void begin (int timeout) throws WrongStateException, SystemException { try { if (_ctxManager.currentTransaction() != null) throw new WrongStateException(); Context ctx = startTransaction(timeout, null); _ctxManager.resume(new TxContextImple(ctx)); } catch (InvalidCreateParametersException ex) { tidyup(); throw new SystemException(ex.toString()); } catch (UnknownTransactionException ex) { tidyup(); throw new SystemException(ex.toString()); } catch (SystemException ex) { tidyup(); throw ex; } }
final W3CEndpointReference terminatorCoordinator = getTerminationCoordinator(ctx) ; tidyup();
public void beginSubordinate(int timeout) throws WrongStateException, SystemException { try { TxContext current = _ctxManager.currentTransaction(); if ((current == null) || !(current instanceof TxContextImple)) throw new WrongStateException(); TxContextImple currentImple = (TxContextImple) current; Context ctx = startTransaction(timeout, currentImple); _ctxManager.resume(new TxContextImple(ctx)); // n.b. we don't enlist the subordinate transaction for completion // that ensures that any attempt to commit or rollback will fail } catch (com.arjuna.wsc.InvalidCreateParametersException ex) { tidyup(); throw new SystemException(ex.toString()); } catch (com.arjuna.wst.UnknownTransactionException ex) { tidyup(); throw new SystemException(ex.toString()); } catch (SystemException ex) { tidyup(); throw ex; } }
public String toString () { return transactionIdentifier(); }
private W3CEndpointReference getTerminationCoordinator(final TxContextImple ctx) throws SystemException { final CoordinationContextType coordinationContext = ctx.context().getCoordinationContext() ; final String messageId = MessageId.getMessageId() ; try { return RegistrationCoordinator.register(coordinationContext, messageId, getParticipantProtocolService(ctx.identifier(), ctx.isSecure()), com.arjuna.webservices.wsarjtx.ArjunaTXConstants.WSARJTX_PROTOCOL_TERMINATION) ; } catch (final Throwable th) { throw new SystemException(wstxLogger.i18NLogger.get_mwlabs_wst11_ba_remote_UserBusinessActivityImple_3()); } }
/** * fetch the coordination context type stashed in the current BA context implememtation * and use it to construct an instance of the coordination context extension type we need to * send down the wire to the activation coordinator * @param current the current AT context implememtation * @return an instance of the coordination context extension type */ private CoordinationContext getContext(TxContextImple current) { CoordinationContextType contextType = getContextType(current); CoordinationContext context = new CoordinationContext(); context.setCoordinationType(contextType.getCoordinationType()); context.setExpires(contextType.getExpires()); context.setIdentifier(contextType.getIdentifier()); context.setRegistrationService(contextType.getRegistrationService()); return context; }
private final Context startTransaction (int timeout, TxContextImple current) throws InvalidCreateParametersException, SystemException { try { final Long expires = (timeout > 0 ? new Long(timeout) : null) ; final String messageId = MessageId.getMessageId() ; final CoordinationContext currentContext = (current != null ? getContext(current) : null); final CoordinationContextType coordinationContext = ActivationCoordinator.createCoordinationContext( _activationCoordinatorService, messageId, BusinessActivityConstants.WSBA_PROTOCOL_ATOMIC_OUTCOME, expires, currentContext) ; if (coordinationContext == null) { throw new SystemException( wstxLogger.i18NLogger.get_mwlabs_wst11_ba_remote_UserBusinessActivityImple_2()); } return new ContextImple(coordinationContext) ; } catch (final InvalidCreateParametersException icpe) { throw icpe ; } catch (final SoapFault sf) { throw new SystemException(sf.getMessage()) ; } catch (final Exception ex) { throw new SystemException(ex.toString()); } }
public void complete () throws UnknownTransactionException, SystemException, WrongStateException { try { final TxContextImple ctx = ((TxContextImple) _ctxManager.currentTransaction()) ; if (ctx == null) { throw new WrongStateException(); } final String id = ctx.identifier() ; final W3CEndpointReference terminatorCoordinator = getTerminationCoordinator(ctx) ; BusinessActivityTerminatorStub terminatorStub = new BusinessActivityTerminatorStub(id, terminatorCoordinator); terminatorStub.complete(); } catch (SystemException ex) { throw ex; } catch (UnknownTransactionException ex) { throw ex; } catch (WrongStateException ex) { throw ex; } catch (Exception ex) { throw new SystemException(ex.toString()); } }
public void begin (int timeout) throws WrongStateException, SystemException { try { if (_ctxManager.currentTransaction() != null) throw new WrongStateException(); Context ctx = startTransaction(timeout, null); _ctxManager.resume(new TxContextImple(ctx)); } catch (InvalidCreateParametersException ex) { tidyup(); throw new SystemException(ex.toString()); } catch (UnknownTransactionException ex) { tidyup(); throw new SystemException(ex.toString()); } catch (SystemException ex) { tidyup(); throw ex; } }
final W3CEndpointReference terminatorCoordinator = getTerminationCoordinator(ctx) ; tidyup();
public void beginSubordinate(int timeout) throws WrongStateException, SystemException { try { TxContext current = _ctxManager.currentTransaction(); if ((current == null) || !(current instanceof TxContextImple)) throw new WrongStateException(); TxContextImple currentImple = (TxContextImple) current; Context ctx = startTransaction(timeout, currentImple); _ctxManager.resume(new TxContextImple(ctx)); // n.b. we don't enlist the subordinate transaction for completion // that ensures that any attempt to commit or rollback will fail } catch (com.arjuna.wsc.InvalidCreateParametersException ex) { tidyup(); throw new SystemException(ex.toString()); } catch (com.arjuna.wst.UnknownTransactionException ex) { tidyup(); throw new SystemException(ex.toString()); } catch (SystemException ex) { tidyup(); throw ex; } }
public String toString () { return transactionIdentifier(); }
private W3CEndpointReference getTerminationCoordinator(final TxContextImple ctx) throws SystemException { final CoordinationContextType coordinationContext = ctx.context().getCoordinationContext() ; final String messageId = MessageId.getMessageId() ; try { return RegistrationCoordinator.register(coordinationContext, messageId, getParticipantProtocolService(ctx.identifier(), ctx.isSecure()), com.arjuna.webservices.wsarjtx.ArjunaTXConstants.WSARJTX_PROTOCOL_TERMINATION) ; } catch (final Throwable th) { throw new SystemException(wstxLogger.i18NLogger.get_mwlabs_wst11_ba_remote_UserBusinessActivityImple_3()); } }
/** * fetch the coordination context type stashed in the current BA context implememtation * and use it to construct an instance of the coordination context extension type we need to * send down the wire to the activation coordinator * @param current the current AT context implememtation * @return an instance of the coordination context extension type */ private CoordinationContext getContext(TxContextImple current) { CoordinationContextType contextType = getContextType(current); CoordinationContext context = new CoordinationContext(); context.setCoordinationType(contextType.getCoordinationType()); context.setExpires(contextType.getExpires()); context.setIdentifier(contextType.getIdentifier()); context.setRegistrationService(contextType.getRegistrationService()); return context; }
private final Context startTransaction (int timeout, TxContextImple current) throws InvalidCreateParametersException, SystemException { try { final Long expires = (timeout > 0 ? new Long(timeout) : null) ; final String messageId = MessageId.getMessageId() ; final CoordinationContext currentContext = (current != null ? getContext(current) : null); final CoordinationContextType coordinationContext = ActivationCoordinator.createCoordinationContext( _activationCoordinatorService, messageId, BusinessActivityConstants.WSBA_PROTOCOL_ATOMIC_OUTCOME, expires, currentContext) ; if (coordinationContext == null) { throw new SystemException( wstxLogger.i18NLogger.get_mwlabs_wst11_ba_remote_UserBusinessActivityImple_2()); } return new ContextImple(coordinationContext) ; } catch (final InvalidCreateParametersException icpe) { throw icpe ; } catch (final SoapFault sf) { throw new SystemException(sf.getMessage()) ; } catch (final Exception ex) { throw new SystemException(ex.toString()); } }
public void complete () throws UnknownTransactionException, SystemException, WrongStateException { try { final TxContextImple ctx = ((TxContextImple) _ctxManager.currentTransaction()) ; if (ctx == null) { throw new WrongStateException(); } final String id = ctx.identifier() ; final W3CEndpointReference terminatorCoordinator = getTerminationCoordinator(ctx) ; BusinessActivityTerminatorStub terminatorStub = new BusinessActivityTerminatorStub(id, terminatorCoordinator); terminatorStub.complete(); } catch (SystemException ex) { throw ex; } catch (UnknownTransactionException ex) { throw ex; } catch (WrongStateException ex) { throw ex; } catch (Exception ex) { throw new SystemException(ex.toString()); } }
public void begin (int timeout) throws WrongStateException, SystemException { try { if (_ctxManager.currentTransaction() != null) throw new WrongStateException(); Context ctx = startTransaction(timeout, null); _ctxManager.resume(new TxContextImple(ctx)); } catch (InvalidCreateParametersException ex) { tidyup(); throw new SystemException(ex.toString()); } catch (UnknownTransactionException ex) { tidyup(); throw new SystemException(ex.toString()); } catch (SystemException ex) { tidyup(); throw ex; } }
public void begin() throws WrongStateException, SystemException { ((UserBusinessActivityImple)UserBusinessActivityImple.getUserBusinessActivity()).beginSubordinate(0); }