Ejemplo n.º 1
0
 private void transition(SplitTransactionPhase nextPhase, boolean isRollback) throws IOException {
   if (!isRollback) {
     // Add to the journal first, because if the listener throws an exception
     // we need to roll back starting at 'nextPhase'
     this.journal.add(new JournalEntryImpl(nextPhase));
   }
   for (int i = 0; i < listeners.size(); i++) {
     TransactionListener listener = listeners.get(i);
     if (!isRollback) {
       listener.transition(this, currentPhase, nextPhase);
     } else {
       listener.rollback(this, currentPhase, nextPhase);
     }
   }
   currentPhase = nextPhase;
 }