protected void rollbackFromWithinCallback(boolean indoubt,boolean heuristic) throws HeurCommitException, HeurMixedException, SysException, HeurHazardException, java.lang.IllegalStateException {
  CoordinatorStateHandler nextStateHandler=null;
  try {
    coordinator_.setState(TxState.ABORTING);
    committed_=new Boolean(false);
    Vector<Participant> participants=coordinator_.getParticipants();
    int count=(participants.size() - readOnlyTable_.size());
    TerminationResult rollbackresult=new TerminationResult(count);
    Enumeration<Participant> enumm=participants.elements();
    while (enumm.hasMoreElements()) {
      Participant p=enumm.nextElement();
      if (!readOnlyTable_.contains(p)) {
        RollbackMessage rm=new RollbackMessage(p,rollbackresult,indoubt);
        propagator_.submitPropagationMessage(rm);
      }
    }
    rollbackresult.waitForReplies();
    int res=rollbackresult.getResult();
    if (indoubt && res != TerminationResult.ALL_OK) {
      if (res == TerminationResult.HEUR_MIXED) {
        Set<Participant> hazards=rollbackresult.getPossiblyIndoubts();
        nextStateHandler=new HeurMixedStateHandler(this,hazards);
        coordinator_.setStateHandler(nextStateHandler);
        throw new HeurMixedException();
      }
 else       if (res == TerminationResult.HEUR_COMMIT) {
        nextStateHandler=new HeurCommittedStateHandler(this);
        coordinator_.setStateHandler(nextStateHandler);
        throw new HeurCommitException();
      }
 else       if (res == TerminationResult.HEUR_HAZARD) {
        Set<Participant> hazards=rollbackresult.getPossiblyIndoubts();
        nextStateHandler=new HeurHazardStateHandler(this,hazards);
        coordinator_.setStateHandler(nextStateHandler);
        throw new HeurHazardException();
      }
    }
 else {
      if (heuristic) {
        nextStateHandler=new HeurAbortedStateHandler(this);
      }
 else       nextStateHandler=new TerminatedStateHandler(this);
      coordinator_.setStateHandler(nextStateHandler);
    }
  }
 catch (  RuntimeException runerr) {
    throw new SysException("Error in rollback: " + runerr.getMessage(),runerr);
  }
catch (  InterruptedException e) {
    InterruptedExceptionHelper.handleInterruptedException(e);
    throw new SysException("Error in rollback: " + e.getMessage(),e);
  }
}

protected void rollbackFromWithinCallback ( boolean indoubt , boolean heuristic ) throws HeurCommitException , HeurMixedException , SysException , HeurHazardException , java . lang . IllegalStateException { CoordinatorStateHandler nextStateHandler = null ; try { coordinator_ . setState ( TxState . ABORTING ) ; committed_ = new Boolean ( false ) ; Vector < Participant > participants = coordinator_ . getParticipants ( ) ; int count = ( participants . size ( ) - readOnlyTable_ . size ( ) ) ; TerminationResult rollbackresult = new TerminationResult ( count ) ; Enumeration < Participant > enumm = participants . elements ( ) ; while ( enumm . hasMoreElements ( ) ) { Participant p = enumm . nextElement ( ) ; if ( ! readOnlyTable_ . contains ( p ) ) { RollbackMessage rm = new RollbackMessage ( p , rollbackresult , indoubt ) ; propagator_ . submitPropagationMessage ( rm ) ; } } rollbackresult . waitForReplies ( ) ; int res = rollbackresult . getResult ( ) ; if ( indoubt && res != TerminationResult . ALL_OK ) { if ( res == TerminationResult . HEUR_MIXED ) { Set < Participant > hazards = rollbackresult . getPossiblyIndoubts ( ) ; nextStateHandler = new HeurMixedStateHandler ( this , hazards ) ; coordinator_ . setStateHandler ( nextStateHandler ) ; throw new HeurMixedException ( ) ; } else if ( res == TerminationResult . HEUR_COMMIT ) { nextStateHandler = new HeurCommittedStateHandler ( this ) ; coordinator_ . setStateHandler ( nextStateHandler ) ; throw new HeurCommitException ( ) ; } else if ( res == TerminationResult . HEUR_HAZARD ) { Set < Participant > hazards = rollbackresult . getPossiblyIndoubts ( ) ; nextStateHandler = new HeurHazardStateHandler ( this , hazards ) ; coordinator_ . setStateHandler ( nextStateHandler ) ; throw new HeurHazardException ( ) ; } } else { if ( heuristic ) { nextStateHandler = new HeurAbortedStateHandler ( this ) ; } else nextStateHandler = new TerminatedStateHandler ( this ) ; coordinator_ . setStateHandler ( nextStateHandler ) ; } } catch ( RuntimeException runerr ) { throw new SysException ( "Error in rollback: " + runerr . getMessage ( ) , runerr ) ; } catch ( InterruptedException e ) { InterruptedExceptionHelper . handleInterruptedException ( e ) ; throw new SysException ( "Error in rollback: " + e . getMessage ( ) , e ) ; } }
auxiliary method for rollback . this method can be reused in subclasses in order to process rollback .
