public synchronized void compensate () throws FaultedException, WrongStateException, SystemException { /* * Active -> illegal state * Canceling -> illegal state * Completed -> illegal state * Closing -> illegal state * Compensating -> no answer * Faulting -> illegal state * Faulting-Active -> illegal state * Faulting-Compensating -> fault * Exiting -> illegal state * Ended -> ended */ final State state = participant.compensate() ; if (state == State.STATE_COMPENSATING) { throw new SystemException() ; } else if (state == State.STATE_FAILING_COMPENSATING) { throw new FaultedException() ; } else if (state != State.STATE_ENDED) { throw new WrongStateException() ; } }
public synchronized void compensate () throws FaultedException, WrongStateException, SystemException { /* * Active -> illegal state * Canceling -> illegal state * Completed -> illegal state * Closing -> illegal state * Compensating -> no answer * Faulting -> illegal state * Faulting-Active -> illegal state * Faulting-Compensating -> fault * Exiting -> illegal state * Ended -> ended */ final State state = participant.compensate() ; if (state == State.STATE_COMPENSATING) { throw new SystemException() ; } else if (state == State.STATE_FAILING_COMPENSATING) { throw new FaultedException() ; } else if (state != State.STATE_ENDED) { throw new WrongStateException() ; } }
public synchronized void compensate () throws FaultedException, WrongStateException, SystemException { /* * Active -> illegal state * Canceling -> illegal state * Completed -> illegal state * Closing -> illegal state * Compensating -> no answer * Faulting -> illegal state * Faulting-Active -> illegal state * Faulting-Compensating -> fault * Exiting -> illegal state * Ended -> ended */ final State state = participant.compensate() ; if (state == State.STATE_COMPENSATING) { throw new SystemException() ; } else if (state == State.STATE_FAILING_COMPENSATING) { throw new FaultedException() ; } else if (state != State.STATE_ENDED) { throw new WrongStateException() ; } }