public final void associate (ATCoordinator transaction) throws Exception { String txIdentifier = transaction.get_uid().stringForm(); _hierarchies.put(txIdentifier, transaction); }
/** * this is driven by a volatile participant registered on behalf of the coordinator */ public void rollbackVolatile() { if (isReadonly) { super.afterCompletion(ActionStatus.ABORTED); } else { super.afterCompletion(finalStatus); } }
/** * this is driven by a volatile participant registered on behalf of the coordinator * * @return true if the beforeCompletion succeeds otherwise false. */ public boolean prepareVolatile() { return super.beforeCompletion(); }
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()); } }
(status == ActionStatus.H_HAZARD)) super.phase2Commit( _reportHeuristics ) ; } else if ((status == ActionStatus.ABORTED) || (status == ActionStatus.H_ROLLBACK) || (status == ActionStatus.ABORT_ONLY)) super.phase2Abort( _reportHeuristics ) ;
super.phase2Commit(true); switch (super.getHeuristicDecision()) status = super.status(); break; case TwoPhaseOutcome.HEURISTIC_ROLLBACK:
super.phase2Abort(true); switch (super.getHeuristicDecision()) status = super.status(); break; case TwoPhaseOutcome.HEURISTIC_ROLLBACK:
/** * 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()); } }
ActionHierarchy txHier = currentCoordinator.getHierarchy(); final int depth = txHier.depth() ; _identifierValues = new String[depth] ;
/** * Enrol the specified synchronization with the coordinator associated with * the current thread. * * @param Synchronization * act The synchronization to remove. * * @exception WrongStateException * Thrown if the coordinator is not in a state that allows * participants to be enrolled. * @exception DuplicateSynchronizationException * Thrown if the participant has already been enrolled and * the coordination protocol does not support multiple * entries. * @exception InvalidSynchronizationException * Thrown if the participant is invalid. * @exception SystemException * Thrown if any other error occurs. */ public void enlistSynchronization (Synchronization act) throws WrongStateException, DuplicateSynchronizationException, InvalidSynchronizationException, NoCoordinatorException, SystemException { currentCoordinator().enlistSynchronization(act); }
/** * Enrol the specified synchronization with the coordinator associated with * the current thread. * * @param act The synchronization to add. * * @exception WrongStateException * Thrown if the coordinator is not in a state that allows * participants to be enrolled. * @exception DuplicateSynchronizationException * Thrown if the participant has already been enrolled and * the coordination protocol does not support multiple * entries. * @exception InvalidSynchronizationException * Thrown if the participant is invalid. * @exception SystemException * Thrown if any other error occurs. */ public void enlistSynchronization (Synchronization act) throws WrongStateException, DuplicateSynchronizationException, InvalidSynchronizationException, SystemException { if (act == null) throw new InvalidSynchronizationException(); SynchronizationRecord rec = new SynchronizationRecord(act, new Uid()); if (addSynchronization(rec) != AddOutcome.AR_ADDED) throw new WrongStateException(); }
/** * 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, SystemException { if (act == null) throw new InvalidParticipantException(); AbstractRecord rec = new ParticipantRecord(act, new Uid()); if (add(rec) != AddOutcome.AR_ADDED) throw new WrongStateException(); }
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()); } }
(status == ActionStatus.H_HAZARD)) super.phase2Commit( _reportHeuristics ) ; } else if ((status == ActionStatus.ABORTED) || (status == ActionStatus.H_ROLLBACK) || (status == ActionStatus.ABORT_ONLY)) super.phase2Abort( _reportHeuristics ) ;
super.phase2Commit(true); switch (super.getHeuristicDecision()) status = super.status(); break; case TwoPhaseOutcome.HEURISTIC_ROLLBACK:
super.phase2Abort(true); switch (super.getHeuristicDecision()) status = super.status(); break; case TwoPhaseOutcome.HEURISTIC_ROLLBACK:
/** * 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()); } }
ActionHierarchy txHier = currentCoordinator.getHierarchy(); final int depth = txHier.depth() ; _identifierValues = new String[depth] ;
/** * Enrol the specified synchronization with the coordinator associated with * the current thread. * * @param Synchronization * act The synchronization to remove. * * @exception WrongStateException * Thrown if the coordinator is not in a state that allows * participants to be enrolled. * @exception DuplicateSynchronizationException * Thrown if the participant has already been enrolled and * the coordination protocol does not support multiple * entries. * @exception InvalidSynchronizationException * Thrown if the participant is invalid. * @exception SystemException * Thrown if any other error occurs. */ public void enlistSynchronization (Synchronization act) throws WrongStateException, DuplicateSynchronizationException, InvalidSynchronizationException, NoCoordinatorException, SystemException { currentCoordinator().enlistSynchronization(act); }
/** * Enrol the specified synchronization with the coordinator associated with * the current thread. * * @param act The synchronization to add. * * @exception WrongStateException * Thrown if the coordinator is not in a state that allows * participants to be enrolled. * @exception DuplicateSynchronizationException * Thrown if the participant has already been enrolled and * the coordination protocol does not support multiple * entries. * @exception InvalidSynchronizationException * Thrown if the participant is invalid. * @exception SystemException * Thrown if any other error occurs. */ public void enlistSynchronization (Synchronization act) throws WrongStateException, DuplicateSynchronizationException, InvalidSynchronizationException, SystemException { if (act == null) throw new InvalidSynchronizationException(); SynchronizationRecord rec = new SynchronizationRecord(act, new Uid()); if (addSynchronization(rec) != AddOutcome.AR_ADDED) throw new WrongStateException(); }