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 { ATCoordinator coord = new ATCoordinator(); int status = coord.start(parentCoordinator()); if (status != ActionStatus.RUNNING) throw new BegunFailedException( wscfLogger.i18NLogger.get_model_twophase_arjunacore_CoordinatorControl_1() + ActionStatus.stringForm(status)); else { _coordinators.put(currentActivity(), coord); } } catch (SystemException ex) { throw ex; } catch (Exception ex) { throw new UnexpectedException(ex.toString()); } }
ATCoordinator current = currentCoordinator(); int outcome; _coordinators.remove(currentActivity());
public final Object createSubordinate (String subordinateType) throws NoActivityException, InvalidProtocolException, SystemException { try { CoordinatorServiceImple coordManager = (CoordinatorServiceImple) _coordManager; CoordinatorControl theControl = coordManager.coordinatorControl(); ATCoordinator subordinateTransaction = theControl.createSubordinate(subordinateType); /* * Now add the registrar for this specific coordinator to the * mapper. */ subordinateTransaction.enlistSynchronization(new CleanupSynchronization(subordinateTransaction.get_uid().stringForm(), _theRegistrar)); _theRegistrar.associate(subordinateTransaction); return subordinateTransaction; } catch (Exception ex) { throw new SystemException(ex.toString()); } }
/** * The activity has completed and is no longer active on the current thread. */ public void completed () throws SystemException { _coordManager.completed(); }
public final ATCoordinator currentCoordinator () throws NoCoordinatorException, SystemException { ATCoordinator coord = (ATCoordinator) _coordinators.get(currentActivity()); if (coord == null) throw new NoCoordinatorException(); else return coord; }
/** * 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 (Participant act) throws InvalidParticipantException, NoCoordinatorException, WrongStateException, SystemException { _coordManager.delistParticipant(act); }
/** * Remove the specified synchronization from the coordinator's list. * * @exception InvalidSynchronizationException * 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 delistSynchronization (Synchronization act) throws InvalidSynchronizationException, NoCoordinatorException, WrongStateException, SystemException { _coordManager.delistSynchronization(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); }
public void participantReadOnly (String participantId) throws NoActivityException, InvalidParticipantException, SystemException { currentCoordinator().participantReadOnly(participantId); }
/** * An activity has begun and is active on the current thread. */ public void begin () throws SystemException { try { ATCoordinator coord = new ATCoordinator(); int status = coord.start(parentCoordinator()); if (status != ActionStatus.RUNNING) throw new BegunFailedException( wscfLogger.i18NLogger.get_model_twophase_arjunacore_CoordinatorControl_1() + ActionStatus.stringForm(status)); else { _coordinators.put(currentActivity(), coord); } } catch (SystemException ex) { throw ex; } catch (Exception ex) { throw new UnexpectedException(ex.toString()); } }
ATCoordinator current = currentCoordinator(); int outcome; _coordinators.remove(currentActivity());
public final Object createSubordinate (String subordinateType) throws NoActivityException, InvalidProtocolException, SystemException { try { CoordinatorServiceImple coordManager = (CoordinatorServiceImple) _coordManager; CoordinatorControl theControl = coordManager.coordinatorControl(); ATCoordinator subordinateTransaction = theControl.createSubordinate(subordinateType); /* * Now add the registrar for this specific coordinator to the * mapper. */ subordinateTransaction.enlistSynchronization(new CleanupSynchronization(subordinateTransaction.get_uid().stringForm(), _theRegistrar)); _theRegistrar.associate(subordinateTransaction); return subordinateTransaction; } catch (Exception ex) { throw new SystemException(ex.toString()); } }
/** * The activity has completed and is no longer active on the current thread. */ public void completed () throws SystemException { _coordManager.completed(); }
public final ATCoordinator currentCoordinator () throws NoCoordinatorException, SystemException { ATCoordinator coord = (ATCoordinator) _coordinators.get(currentActivity()); if (coord == null) throw new NoCoordinatorException(); else return coord; }
/** * 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 (Participant act) throws InvalidParticipantException, NoCoordinatorException, WrongStateException, SystemException { _coordManager.delistParticipant(act); }
/** * Remove the specified synchronization from the coordinator's list. * * @exception InvalidSynchronizationException * 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 delistSynchronization (Synchronization act) throws InvalidSynchronizationException, NoCoordinatorException, WrongStateException, SystemException { _coordManager.delistSynchronization(act); }