public synchronized void complete () throws WrongStateException, SystemException { /* * Active -> illegal state * Canceling -> illegal state * Canceling-Active -> illegal state * Canceling-Completing -> canceling * Completing -> no response * Completed -> completed * Closing -> illegal state * Compensating -> illegal state * Faulting -> illegal state * Faulting-Active -> illegal state * Faulting-Compensating -> fault * Exiting -> exiting * Ended -> illegal state */ final State state = participant.complete() ; if (state == State.STATE_COMPLETED) { return ; } else if ((state == State.STATE_FAILING_COMPENSATING) || (state == State.STATE_CANCELING_COMPLETING) || (state == State.STATE_EXITING)) { throw new SystemException() ; } throw new WrongStateException() ; }
public synchronized void complete () throws WrongStateException, SystemException { /* * Active -> illegal state * Canceling -> illegal state * Canceling-Active -> illegal state * Canceling-Completing -> canceling * Completing -> no response * Completed -> completed * Closing -> illegal state * Compensating -> illegal state * Faulting -> illegal state * Faulting-Active -> illegal state * Faulting-Compensating -> fault * Exiting -> exiting * Ended -> illegal state */ final State state = participant.complete() ; if (state == State.STATE_COMPLETED) { return ; } else if ((state == State.STATE_FAILING_COMPENSATING) || (state == State.STATE_CANCELING_COMPLETING) || (state == State.STATE_EXITING)) { throw new SystemException() ; } throw new WrongStateException() ; }
public synchronized void complete () throws WrongStateException, SystemException { /* * Active -> illegal state * Canceling -> illegal state * Canceling-Active -> illegal state * Canceling-Completing -> canceling * Completing -> no response * Completed -> completed * Closing -> illegal state * Compensating -> illegal state * Faulting -> illegal state * Faulting-Active -> illegal state * Faulting-Compensating -> fault * Exiting -> exiting * Ended -> illegal state */ final State state = participant.complete() ; if (state == State.STATE_COMPLETED) { return ; } else if ((state == State.STATE_FAILING_COMPENSATING) || (state == State.STATE_CANCELING_COMPLETING) || (state == State.STATE_EXITING)) { throw new SystemException() ; } throw new WrongStateException() ; }