public Action nextAction ( boolean recovering ) { Action action ; switch ( state ) { case PREPARING : action = recovering ? Action . ROLLBACK : Action . PREPARE ; break ; case COMMITTING : action = Action . COMMIT ; break ; case COMMITTED : action = recovering ? Action . INITSTATE : Action . PREPARE ; break ; default : throw new IllegalStateException ( "Unknown state " + state ) ; } return action ; }
Get the next action to perform based on this checkpoint state .