/** * obtain a resumable transaction context for the bridged-to transaction * @return a resumable transaction context * @throws UnknownTransactionException if this transaction has been recovered from the log and hence * has no associated transaction context. */ public TxContext getContext() throws UnknownTransactionException { if (context != null) { return context; } else { throw new UnknownTransactionException(); } }
private final void enlistCompletionParticipants () throws WrongStateException, UnknownTransactionException, SystemException { TransactionManagerImple tm = (TransactionManagerImple) TransactionManager.getTransactionManager(); final TxContextImple currentTx = (TxContextImple) tm.currentTransaction(); if (currentTx == null) throw new UnknownTransactionException(); final String id = currentTx.identifier(); W3CEndpointReference completionCoordinator = null; try { completionCoordinator = tm.registerParticipant(null, AtomicTransactionConstants.WSAT_SUB_PROTOCOL_COMPLETION_RPC); } catch (InvalidProtocolException ex) { ex.printStackTrace(); throw new SystemException(ex.toString()); } catch (InvalidStateException ex) { throw new WrongStateException(); } catch (CannotRegisterException ex) { // cause could actually be no activity or already registered throw new UnknownTransactionException(); } _completionCoordinators.put(id, completionCoordinator); }
private final void enlistCompletionParticipants () throws WrongStateException, UnknownTransactionException, SystemException { TransactionManagerImple tm = (TransactionManagerImple) TransactionManager.getTransactionManager(); final TxContextImple currentTx = (TxContextImple) tm.currentTransaction(); if (currentTx == null) throw new UnknownTransactionException(); final String id = currentTx.identifier(); W3CEndpointReference completionCoordinator = null; try { completionCoordinator = tm.registerParticipant(null, AtomicTransactionConstants.WSAT_SUB_PROTOCOL_COMPLETION_RPC); } catch (InvalidProtocolException ex) { ex.printStackTrace(); throw new SystemException(ex.toString()); } catch (InvalidStateException ex) { throw new WrongStateException(); } catch (CannotRegisterException ex) { // cause could actually be no activity or already registered throw new UnknownTransactionException(); } _completionCoordinators.put(id, completionCoordinator); }
public void rollback () throws UnknownTransactionException, SystemException { final MAP map = AddressingHelper.createNotificationContext(MessageId.getMessageId()) ; try { CompletionCoordinatorRPCClient.getClient().sendRollback(_completionCoordinator, map) ; } catch (final SoapFault soapFault) { if (ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME.equals(soapFault.getSubcode())) { throw new UnknownTransactionException(soapFault.getMessage()); } throw new SystemException(soapFault.getMessage()) ; } catch (final Throwable th) { th.printStackTrace() ; throw new SystemException(th.getMessage()) ; } } }
public void rollback () throws UnknownTransactionException, SystemException { final MAP map = AddressingHelper.createNotificationContext(MessageId.getMessageId()) ; try { CompletionCoordinatorRPCClient.getClient().sendRollback(_completionCoordinator, map) ; } catch (final SoapFault soapFault) { if (ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME.equals(soapFault.getSubcode())) { throw new UnknownTransactionException(soapFault.getMessage()); } throw new SystemException(soapFault.getMessage()) ; } catch (final Throwable th) { th.printStackTrace() ; throw new SystemException(th.getMessage()) ; } } }
public void rollback () throws UnknownTransactionException, SystemException { final MAP map = AddressingHelper.createNotificationContext(MessageId.getMessageId()) ; try { CompletionCoordinatorRPCClient.getClient().sendRollback(_completionCoordinator, map) ; } catch (final SoapFault soapFault) { if (ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME.equals(soapFault.getSubcode())) { throw new UnknownTransactionException(soapFault.getMessage()); } throw new SystemException(soapFault.getMessage()) ; } catch (final Throwable th) { th.printStackTrace() ; throw new SystemException(th.getMessage()) ; } } }
throw new UnknownTransactionException(); throw new UnknownTransactionException();
public void commit () throws TransactionRolledBackException, UnknownTransactionException, SystemException { final MAP map = AddressingHelper.createNotificationContext(MessageId.getMessageId()) ; boolean result; try { result = CompletionCoordinatorRPCClient.getClient().sendCommit(_completionCoordinator, map) ; } catch (final SoapFault soapFault) { if (ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME.equals(soapFault.getSubcode())) { throw new UnknownTransactionException(soapFault.getMessage()); } throw new SystemException(soapFault.getMessage()) ; } catch (final Exception e) { throw new SystemException(e.getMessage()) ; } catch (final Throwable th) { th.printStackTrace() ; throw new SystemException(th.getMessage()) ; } if (!result) { throw new TransactionRolledBackException() ; } }
/** * recreate a wrapper for a bridged-to WS-AT 1.1 transaction recovered from the log * @param identifier the identifier of a previously created bridged-to transaction * @return a wrapper for the bridged-to transaction or null if it may still be awaiting recovery * @throws UnknownTransactionException if recovery has been performed and no transaction with the * given identifier has been found in the log */ public static BridgeWrapper recover(String identifier) throws UnknownTransactionException { SubordinateATCoordinator coordinator = SubordinateATCoordinator.getRecoveredCoordinator(identifier); if (coordinator != null) { BridgeWrapper bridgeWrapper = new BridgeWrapper(); bridgeWrapper.context = null; bridgeWrapper.coordinator =coordinator; bridgeWrapper.id = identifier; bridgeWrapper.subordinateType = coordinator.getSubordinateType(); return bridgeWrapper; } else { XTSATRecoveryManager recoveryManager = XTSATRecoveryManager.getRecoveryManager(); if (recoveryManager != null && recoveryManager.isCoordinatorRecoveryStarted()) { throw new UnknownTransactionException(); } else { return null; } } }
public void close () throws TransactionRolledBackException, UnknownTransactionException, SystemException { final MAP map = AddressingHelper.createNotificationContext(MessageId.getMessageId()) ; try { TerminationCoordinatorRPCClient.getClient().sendClose(_terminationCoordinator, map, new InstanceIdentifier(_id)) ; } catch (SoapFault11 soapFault) { if ((ArjunaTXConstants.TRANSACTIONROLLEDBACK_ERROR_CODE_QNAME.equals(soapFault.getSubcode()))) { throw new TransactionRolledBackException(soapFault.getMessage()); } else if (ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME.equals(soapFault.getSubcode())) { throw new UnknownTransactionException(soapFault.getMessage()) ; } throw new SystemException(soapFault.getMessage()) ; } catch (Exception e) { throw new SystemException(); } }
public void close () throws TransactionRolledBackException, UnknownTransactionException, SystemException { final MAP map = AddressingHelper.createNotificationContext(MessageId.getMessageId()) ; try { TerminationCoordinatorRPCClient.getClient().sendClose(_terminationCoordinator, map, new InstanceIdentifier(_id)) ; } catch (SoapFault11 soapFault) { if ((ArjunaTXConstants.TRANSACTIONROLLEDBACK_ERROR_CODE_QNAME.equals(soapFault.getSubcode()))) { throw new TransactionRolledBackException(soapFault.getMessage()); } else if (ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME.equals(soapFault.getSubcode())) { throw new UnknownTransactionException(soapFault.getMessage()) ; } throw new SystemException(soapFault.getMessage()) ; } catch (Exception e) { throw new SystemException(); } }
public void close () throws TransactionRolledBackException, UnknownTransactionException, SystemException { final MAP map = AddressingHelper.createNotificationContext(MessageId.getMessageId()) ; try { TerminationCoordinatorRPCClient.getClient().sendClose(_terminationCoordinator, map, new InstanceIdentifier(_id)) ; } catch (SoapFault11 soapFault) { if ((ArjunaTXConstants.TRANSACTIONROLLEDBACK_ERROR_CODE_QNAME.equals(soapFault.getSubcode()))) { throw new TransactionRolledBackException(soapFault.getMessage()); } else if (ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME.equals(soapFault.getSubcode())) { throw new UnknownTransactionException(soapFault.getMessage()) ; } throw new SystemException(soapFault.getMessage()) ; } catch (Exception e) { throw new SystemException(); } }
public void enlistForDurableTwoPhase (Durable2PCParticipant tpp, String id) throws WrongStateException, UnknownTransactionException, SystemException { try { final W3CEndpointReference participant = getParticipant(id, isCurrentContextSecure()); final W3CEndpointReference coordinator = registerParticipant(participant, AtomicTransactionConstants.WSAT_SUB_PROTOCOL_DURABLE_2PC); ParticipantProcessor.getProcessor().activateParticipant(new ParticipantEngine(tpp, id, coordinator), id) ; } catch (com.arjuna.wsc.InvalidProtocolException ex) { throw new SystemException(ex.toString()); } catch (com.arjuna.wsc.InvalidStateException ex) { throw new WrongStateException(); } catch (com.arjuna.wsc.CannotRegisterException ex) { // cause could actually be no activity or already registered throw new UnknownTransactionException(); } }
public void enlistForDurableTwoPhase (Durable2PCParticipant tpp, String id) throws WrongStateException, UnknownTransactionException, SystemException { try { final W3CEndpointReference participant = getParticipant(id, isCurrentContextSecure()); final W3CEndpointReference coordinator = registerParticipant(participant, AtomicTransactionConstants.WSAT_SUB_PROTOCOL_DURABLE_2PC); ParticipantProcessor.getProcessor().activateParticipant(new ParticipantEngine(tpp, id, coordinator), id) ; } catch (com.arjuna.wsc.InvalidProtocolException ex) { throw new SystemException(ex.toString()); } catch (com.arjuna.wsc.InvalidStateException ex) { throw new WrongStateException(); } catch (com.arjuna.wsc.CannotRegisterException ex) { // cause could actually be no activity or already registered throw new UnknownTransactionException(); } }
public void enlistForDurableTwoPhase (Durable2PCParticipant tpp, String id) throws WrongStateException, UnknownTransactionException, SystemException { try { final W3CEndpointReference participant = getParticipant(id, isCurrentContextSecure()); final W3CEndpointReference coordinator = registerParticipant(participant, AtomicTransactionConstants.WSAT_SUB_PROTOCOL_DURABLE_2PC); ParticipantProcessor.getProcessor().activateParticipant(new ParticipantEngine(tpp, id, coordinator), id) ; } catch (com.arjuna.wsc.InvalidProtocolException ex) { throw new SystemException(ex.toString()); } catch (com.arjuna.wsc.InvalidStateException ex) { throw new WrongStateException(); } catch (com.arjuna.wsc.CannotRegisterException ex) { // cause could actually be no activity or already registered throw new UnknownTransactionException(); } }
public void enlistForVolatileTwoPhase (Volatile2PCParticipant tpp, String id) throws WrongStateException, UnknownTransactionException, SystemException { try { final W3CEndpointReference participant = getParticipant(id, isCurrentContextSecure()); final W3CEndpointReference coordinator = registerParticipant(participant, AtomicTransactionConstants.WSAT_SUB_PROTOCOL_VOLATILE_2PC); ParticipantProcessor.getProcessor().activateParticipant(new ParticipantEngine(tpp, id, coordinator), id) ; } catch (com.arjuna.wsc.InvalidProtocolException ex) { throw new SystemException(ex.toString()); } catch (com.arjuna.wsc.InvalidStateException ex) { throw new WrongStateException(); } catch (com.arjuna.wsc.CannotRegisterException ex) { // cause could actually be no activity or already registered ex.printStackTrace(); throw new UnknownTransactionException(); } }
public void enlistForVolatileTwoPhase (Volatile2PCParticipant tpp, String id) throws WrongStateException, UnknownTransactionException, SystemException { try { final W3CEndpointReference participant = getParticipant(id, isCurrentContextSecure()); final W3CEndpointReference coordinator = registerParticipant(participant, AtomicTransactionConstants.WSAT_SUB_PROTOCOL_VOLATILE_2PC); ParticipantProcessor.getProcessor().activateParticipant(new ParticipantEngine(tpp, id, coordinator), id) ; } catch (com.arjuna.wsc.InvalidProtocolException ex) { throw new SystemException(ex.toString()); } catch (com.arjuna.wsc.InvalidStateException ex) { throw new WrongStateException(); } catch (com.arjuna.wsc.CannotRegisterException ex) { // cause could actually be no activity or already registered ex.printStackTrace(); throw new UnknownTransactionException(); } }
public void enlistForVolatileTwoPhase (Volatile2PCParticipant tpp, String id) throws WrongStateException, UnknownTransactionException, SystemException { try { final W3CEndpointReference participant = getParticipant(id, isCurrentContextSecure()); final W3CEndpointReference coordinator = registerParticipant(participant, AtomicTransactionConstants.WSAT_SUB_PROTOCOL_VOLATILE_2PC); ParticipantProcessor.getProcessor().activateParticipant(new ParticipantEngine(tpp, id, coordinator), id) ; } catch (com.arjuna.wsc.InvalidProtocolException ex) { throw new SystemException(ex.toString()); } catch (com.arjuna.wsc.InvalidStateException ex) { throw new WrongStateException(); } catch (com.arjuna.wsc.CannotRegisterException ex) { // cause could actually be no activity or already registered ex.printStackTrace(); throw new UnknownTransactionException(); } }