/** * Construct the engine for the coordinator in a specified state and register it. * @param id The coordinator id. * @param participant The participant endpoint reference. * @param state The initial state. */ public ParticipantCompletionCoordinatorEngine(final String id, final W3CEndpointReference participant, final State state, final boolean recovered) { this.id = id ; this.instanceIdentifier = new InstanceIdentifier(id) ; this.participant = participant ; this.state = state ; this.failureState = null; this.recovered = recovered; // unrecovered participants are always activated // we only need to reactivate recovered participants which were successfully COMPLETED or which began // CLOSING. any others will only have been saved because of a heuristic outcome. we can safely drop // them since we implement presumed abort. if (!recovered || state == State.STATE_COMPLETED || state == State.STATE_CLOSING) { ParticipantCompletionCoordinatorProcessor.getProcessor().activateCoordinator(this, id) ; } }
/** * Construct the engine for the coordinator in a specified state. * @param id The coordinator id. * @param durable true if the participant is durable, false if volatile. * @param participant The participant endpoint reference. * @param state The initial state. */ public CoordinatorEngine(final String id, final boolean durable, final W3CEndpointReference participant, boolean recovered, final State state) { this.id = id ; this.instanceIdentifier = new InstanceIdentifier(id) ; this.durable = durable ; this.participant = participant ; this.state = state ; this.recovered = recovered; // unrecovered participants are always activated // we only need to reactivate recovered participants which were successfully prepared // any others will only have been saved because of a heuristic outcome e.g. a comms // timeout at prepare will write a heuristic record for an ABORTED TX including a // participant in state PREPARING. we can safely drop it since we implement presumed abort. if (!recovered || state == State.STATE_PREPARED_SUCCESS) { CoordinatorProcessor.getProcessor().activateCoordinator(this, id) ; } }
/** * Construct the engine for the coordinator in a specified state and register it. * @param id The coordinator id. * @param participant The participant endpoint reference. * @param state The initial state. */ public ParticipantCompletionCoordinatorEngine(final String id, final W3CEndpointReference participant, final State state, final boolean recovered) { this.id = id ; this.instanceIdentifier = new InstanceIdentifier(id) ; this.participant = participant ; this.state = state ; this.failureState = null; this.recovered = recovered; // unrecovered participants are always activated // we only need to reactivate recovered participants which were successfully COMPLETED or which began // CLOSING. any others will only have been saved because of a heuristic outcome. we can safely drop // them since we implement presumed abort. if (!recovered || state == State.STATE_COMPLETED || state == State.STATE_CLOSING) { ParticipantCompletionCoordinatorProcessor.getProcessor().activateCoordinator(this, id) ; } }
/** * Construct the engine for the coordinator in a specified state and register it. * @param id The coordinator id. * @param participant The participant endpoint reference. * @param state The initial state. */ public CoordinatorCompletionCoordinatorEngine(final String id, final W3CEndpointReference participant, final State state, final boolean recovered) { this.id = id ; this.instanceIdentifier = new InstanceIdentifier(id) ; this.participant = participant ; this.state = state ; this.failureState = null; this.recovered = recovered; // unrecovered participants are always activated // we only need to reactivate recovered participants which were successfully COMPLETED or which began // CLOSING. any others will only have been saved because of a heuristic outcome. we can safely drop // them since we implement presumed abort. if (!recovered || state == State.STATE_COMPLETED || state == State.STATE_CLOSING) { CoordinatorCompletionCoordinatorProcessor.getProcessor().activateCoordinator(this, id) ; } }
/** * Construct the engine for the coordinator in a specified state and register it. * @param id The coordinator id. * @param participant The participant endpoint reference. * @param state The initial state. */ public ParticipantCompletionCoordinatorEngine(final String id, final W3CEndpointReference participant, final State state, final boolean recovered) { this.id = id ; this.instanceIdentifier = new InstanceIdentifier(id) ; this.participant = participant ; this.state = state ; this.failureState = null; this.recovered = recovered; // unrecovered participants are always activated // we only need to reactivate recovered participants which were successfully COMPLETED or which began // CLOSING. any others will only have been saved because of a heuristic outcome. we can safely drop // them since we implement presumed abort. if (!recovered || state == State.STATE_COMPLETED || state == State.STATE_CLOSING) { ParticipantCompletionCoordinatorProcessor.getProcessor().activateCoordinator(this, id) ; } }
/** * Construct the engine for the coordinator in a specified state and register it. * @param id The coordinator id. * @param participant The participant endpoint reference. * @param state The initial state. */ public CoordinatorCompletionCoordinatorEngine(final String id, final W3CEndpointReference participant, final State state, final boolean recovered) { this.id = id ; this.instanceIdentifier = new InstanceIdentifier(id) ; this.participant = participant ; this.state = state ; this.failureState = null; this.recovered = recovered; // unrecovered participants are always activated // we only need to reactivate recovered participants which were successfully COMPLETED or which began // CLOSING. any others will only have been saved because of a heuristic outcome. we can safely drop // them since we implement presumed abort. if (!recovered || state == State.STATE_COMPLETED || state == State.STATE_CLOSING) { CoordinatorCompletionCoordinatorProcessor.getProcessor().activateCoordinator(this, id) ; } }
/** * Construct the engine for the coordinator in a specified state and register it. * @param id The coordinator id. * @param participant The participant endpoint reference. * @param state The initial state. */ public CoordinatorCompletionCoordinatorEngine(final String id, final W3CEndpointReference participant, final State state, final boolean recovered) { this.id = id ; this.instanceIdentifier = new InstanceIdentifier(id) ; this.participant = participant ; this.state = state ; this.failureState = null; this.recovered = recovered; // unrecovered participants are always activated // we only need to reactivate recovered participants which were successfully COMPLETED or which began // CLOSING. any others will only have been saved because of a heuristic outcome. we can safely drop // them since we implement presumed abort. if (!recovered || state == State.STATE_COMPLETED || state == State.STATE_CLOSING) { CoordinatorCompletionCoordinatorProcessor.getProcessor().activateCoordinator(this, id) ; } }
/** * Send the read only message. * */ private void sendReadOnly() { final MAP responseAddressingContext = createContext() ; final InstanceIdentifier instanceIdentifier = new InstanceIdentifier(id) ; try { CoordinatorClient.getClient().sendReadOnly(coordinator, responseAddressingContext, instanceIdentifier) ; } catch (final Throwable th) { if (WSTLogger.logger.isTraceEnabled()) { WSTLogger.logger.tracev("Unexpected exception while sending ReadOnly", th) ; } } }
/** * Send the aborted message. * */ private void sendAborted() { final MAP responseAddressingContext = createContext() ; final InstanceIdentifier instanceIdentifier = new InstanceIdentifier(id) ; try { CoordinatorClient.getClient().sendAborted(coordinator, responseAddressingContext, instanceIdentifier) ; } catch (final Throwable th) { if (WSTLogger.logger.isTraceEnabled()) { WSTLogger.logger.tracev("Unexpected exception while sending Aborted", th) ; } } }
/** * Send the read only message. * */ private void sendReadOnly() { final MAP responseAddressingContext = createContext() ; final InstanceIdentifier instanceIdentifier = new InstanceIdentifier(id) ; try { CoordinatorClient.getClient().sendReadOnly(coordinator, responseAddressingContext, instanceIdentifier) ; } catch (final Throwable th) { if (WSTLogger.logger.isTraceEnabled()) { WSTLogger.logger.tracev("Unexpected exception while sending ReadOnly", th) ; } } }
/** * Send the read only message. * */ private void sendReadOnly() { final MAP responseAddressingContext = createContext() ; final InstanceIdentifier instanceIdentifier = new InstanceIdentifier(id) ; try { CoordinatorClient.getClient().sendReadOnly(coordinator, responseAddressingContext, instanceIdentifier) ; } catch (final Throwable th) { if (WSTLogger.logger.isTraceEnabled()) { WSTLogger.logger.tracev("Unexpected exception while sending ReadOnly", th) ; } } }
/** * Send the committed message. * */ private void sendCommitted() { final MAP responseAddressingContext = createContext() ; final InstanceIdentifier instanceIdentifier = new InstanceIdentifier(id) ; try { CoordinatorClient.getClient().sendCommitted(coordinator, responseAddressingContext, instanceIdentifier) ; } catch (final Throwable th) { if (WSTLogger.logger.isTraceEnabled()) { WSTLogger.logger.tracev("Unexpected exception while sending Committed", th) ; } } }
/** * Send the aborted message. * */ private void sendAborted() { final MAP responseAddressingContext = createContext() ; final InstanceIdentifier instanceIdentifier = new InstanceIdentifier(id) ; try { CoordinatorClient.getClient().sendAborted(coordinator, responseAddressingContext, instanceIdentifier) ; } catch (final Throwable th) { if (WSTLogger.logger.isTraceEnabled()) { WSTLogger.logger.tracev("Unexpected exception while sending Aborted", th) ; } } }
/** * Send the aborted message. * */ private void sendAborted() { final MAP responseAddressingContext = createContext() ; final InstanceIdentifier instanceIdentifier = new InstanceIdentifier(id) ; try { CoordinatorClient.getClient().sendAborted(coordinator, responseAddressingContext, instanceIdentifier) ; } catch (final Throwable th) { if (WSTLogger.logger.isTraceEnabled()) { WSTLogger.logger.tracev("Unexpected exception while sending Aborted", th) ; } } }
/** * Send the committed message. * */ private void sendCommitted() { final MAP responseAddressingContext = createContext() ; final InstanceIdentifier instanceIdentifier = new InstanceIdentifier(id) ; try { CoordinatorClient.getClient().sendCommitted(coordinator, responseAddressingContext, instanceIdentifier) ; } catch (final Throwable th) { if (WSTLogger.logger.isTraceEnabled()) { WSTLogger.logger.tracev("Unexpected exception while sending Committed", th) ; } } }
/** * Send the committed message. * */ private void sendCommitted() { final MAP responseAddressingContext = createContext() ; final InstanceIdentifier instanceIdentifier = new InstanceIdentifier(id) ; try { CoordinatorClient.getClient().sendCommitted(coordinator, responseAddressingContext, instanceIdentifier) ; } catch (final Throwable th) { if (WSTLogger.logger.isTraceEnabled()) { WSTLogger.logger.tracev("Unexpected exception while sending Committed", th) ; } } }
/** * Send the prepared message. * * @param timedOut true if this is in response to a comms timeout */ private void sendPrepared(boolean timedOut) { final MAP responseAddressingContext = createContext() ; final InstanceIdentifier instanceIdentifier = new InstanceIdentifier(id) ; try { CoordinatorClient.getClient().sendPrepared(coordinator, responseAddressingContext, instanceIdentifier) ; } catch (final Throwable th) { if (WSTLogger.logger.isTraceEnabled()) { WSTLogger.logger.tracev("Unexpected exception while sending Prepared", th) ; } } updateResendPeriod(timedOut); initiateTimer() ; }
/** * Send the prepared message. * * @param timedOut true if this is in response to a comms timeout */ private void sendPrepared(boolean timedOut) { final MAP responseAddressingContext = createContext() ; final InstanceIdentifier instanceIdentifier = new InstanceIdentifier(id) ; try { CoordinatorClient.getClient().sendPrepared(coordinator, responseAddressingContext, instanceIdentifier) ; } catch (final Throwable th) { if (WSTLogger.logger.isTraceEnabled()) { WSTLogger.logger.tracev("Unexpected exception while sending Prepared", th) ; } } updateResendPeriod(timedOut); initiateTimer() ; }
/** * Send the prepared message. * * @param timedOut true if this is in response to a comms timeout */ private void sendPrepared(boolean timedOut) { final MAP responseAddressingContext = createContext() ; final InstanceIdentifier instanceIdentifier = new InstanceIdentifier(id) ; try { CoordinatorClient.getClient().sendPrepared(coordinator, responseAddressingContext, instanceIdentifier) ; } catch (final Throwable th) { if (WSTLogger.logger.isTraceEnabled()) { WSTLogger.logger.tracev("Unexpected exception while sending Prepared", th) ; } } updateResendPeriod(timedOut); initiateTimer() ; }
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(); } }