public CoordinatorServiceImple () { super(); _coordManager = new CoordinatorControl(); }
/** * An activity has begun and is active on the current thread. */ public void begun () throws SystemException { _coordManager.begin(); }
/** * The current activity is completing with the specified completion status. * * @param cs The completion status to use. * * @return The result of terminating the relationship of this HLS and * the current activity. */ public Outcome complete (CompletionStatus cs) throws SystemException { return _coordManager.complete(cs); }
/** * @exception SystemException Thrown if any error occurs. * * @return The unique identity of the current coordinator. */ public CoordinatorId identifier () throws NoCoordinatorException, SystemException { return currentCoordinator().identifier(); }
/** * An activity has begun and is active on the current thread. */ public void begin () throws SystemException { try { BACoordinator coord = new BACoordinator(); int status = coord.start(parentCoordinator()); if (status != ActionStatus.RUNNING) throw new BegunFailedException(wscfLogger.i18NLogger.get_model_sagas_arjunacore_CoordinatorControl_1() + ActionStatus.stringForm(status)); else { _coordinators.put(currentActivity(), coord); } } catch (SystemException ex) { throw ex; } catch (Exception ex) { throw new UnexpectedException(ex.toString()); } }
BACoordinator current = currentCoordinator(); int outcome; _coordinators.remove(currentActivity());
public final BACoordinator currentCoordinator () throws NoCoordinatorException, SystemException { BACoordinator coord = (BACoordinator) _coordinators.get(currentActivity()); if (coord == null) throw new NoCoordinatorException(); else return coord; }
/** * The activity has completed and is no longer active on the current * thread. */ public void completed () throws SystemException { _coordManager.completed(); }
/** * Create a subordinate coordinator via the coordination control. */ public BACoordinator createSubordinate() throws SystemException { return _coordManager.createSubordinate(); } /**
/** * Remove the specified participant from the coordinator's list. * * @exception InvalidParticipantException Thrown if the participant is not known * of by the coordinator. * @exception WrongStateException Thrown if the state of the coordinator * does not allow the participant to be removed (e.g., in a two-phase * protocol the coordinator is committing.) * @exception SystemException Thrown if any other error occurs. */ public void delistParticipant (String participantId) throws InvalidParticipantException, NoCoordinatorException, WrongStateException, SystemException { _coordManager.delistParticipant(participantId); }
/** * Enrol the specified participant with the coordinator associated with * the current thread. * * @param act The participant. * * @exception WrongStateException Thrown if the coordinator is not in a * state that allows participants to be enrolled. * @exception DuplicateParticipantException Thrown if the participant has * already been enrolled and the coordination protocol does not support * multiple entries. * @exception InvalidParticipantException Thrown if the participant is invalid. * @exception SystemException Thrown if any other error occurs. */ public void enlistParticipant (Participant act) throws WrongStateException, DuplicateParticipantException, InvalidParticipantException, NoCoordinatorException, SystemException { _coordManager.enlistParticipant(act); }
/** * If the application requires and if the coordination protocol supports * it, then this method can be used to execute a coordination protocol on * the currently enlisted participants at any time prior to the termination * of the coordination scope. * * This implementation only supports coordination at the end of the * activity. * * @param cs The completion status to use when determining * how to execute the protocol. * * @exception com.arjuna.mw.wsas.exceptions.WrongStateException Thrown if the coordinator is in a state * the does not allow coordination to occur. * @exception com.arjuna.mw.wsas.exceptions.ProtocolViolationException Thrown if the protocol is violated * in some manner during execution. * @exception com.arjuna.mw.wsas.exceptions.SystemException Thrown if any other error occurs. * * @return The result of executing the protocol, or null. */ public Outcome coordinate (CompletionStatus cs) throws WrongStateException, ProtocolViolationException, SystemException { return _coordManager.coordinate(cs); }
/** * The current activity is completing and informs the participants * that all work they need to know about has been received. */ public void complete () throws WrongStateException, SystemException { currentCoordinator().complete(); }
/** * An activity has begun and is active on the current thread. */ public void begin () throws SystemException { try { BACoordinator coord = new BACoordinator(); int status = coord.start(parentCoordinator()); if (status != ActionStatus.RUNNING) throw new BegunFailedException(wscfLogger.i18NLogger.get_model_sagas_arjunacore_CoordinatorControl_1() + ActionStatus.stringForm(status)); else { _coordinators.put(currentActivity(), coord); } } catch (SystemException ex) { throw ex; } catch (Exception ex) { throw new UnexpectedException(ex.toString()); } }
BACoordinator current = currentCoordinator(); int outcome; _coordinators.remove(currentActivity());
public final BACoordinator currentCoordinator () throws NoCoordinatorException, SystemException { BACoordinator coord = (BACoordinator) _coordinators.get(currentActivity()); if (coord == null) throw new NoCoordinatorException(); else return coord; }
/** * The activity has completed and is no longer active on the current * thread. */ public void completed () throws SystemException { _coordManager.completed(); }
/** * Create a subordinate coordinator via the coordination control. */ public BACoordinator createSubordinate() throws SystemException { return _coordManager.createSubordinate(); } /**
/** * Remove the specified participant from the coordinator's list. * * @exception InvalidParticipantException Thrown if the participant is not known * of by the coordinator. * @exception WrongStateException Thrown if the state of the coordinator * does not allow the participant to be removed (e.g., in a two-phase * protocol the coordinator is committing.) * @exception SystemException Thrown if any other error occurs. */ public void delistParticipant (String participantId) throws InvalidParticipantException, NoCoordinatorException, WrongStateException, SystemException { _coordManager.delistParticipant(participantId); }
/** * Enrol the specified participant with the coordinator associated with * the current thread. * * @param act The participant. * * @exception WrongStateException Thrown if the coordinator is not in a * state that allows participants to be enrolled. * @exception DuplicateParticipantException Thrown if the participant has * already been enrolled and the coordination protocol does not support * multiple entries. * @exception InvalidParticipantException Thrown if the participant is invalid. * @exception SystemException Thrown if any other error occurs. */ public void enlistParticipant (Participant act) throws WrongStateException, DuplicateParticipantException, InvalidParticipantException, NoCoordinatorException, SystemException { _coordManager.enlistParticipant(act); }