public void commit() throws WrongStateException, SystemException { /* * null - committed * Active - illegal state * Preparing - illegal state * Prepared - illegal state * PreparedSuccess - illegal state * Committing - no response * Aborting - illegal state */ final State state = coordinator.commit() ; if (state != null) { if (state == State.STATE_COMMITTING) { // typically means no response from the remote end. // throw a comm exception to distinguish this case from the // one where the remote end itself threw a SystemException. throw new SystemCommunicationException(); } else { throw new WrongStateException() ; } } }
public void commit() throws WrongStateException, SystemException { /* * null - committed * Active - illegal state * Preparing - illegal state * Prepared - illegal state * PreparedSuccess - illegal state * Committing - no response * Aborting - illegal state */ final State state = coordinator.commit() ; if (state != null) { if (state == State.STATE_COMMITTING) { // typically means no response from the remote end. // throw a comm exception to distinguish this case from the // one where the remote end itself threw a SystemException. throw new SystemCommunicationException(); } else { throw new WrongStateException() ; } } }
public void commit() throws WrongStateException, SystemException { /* * null - committed * Active - illegal state * Preparing - illegal state * Prepared - illegal state * PreparedSuccess - illegal state * Committing - no response * Aborting - illegal state */ final State state = coordinator.commit() ; if (state != null) { if (state == State.STATE_COMMITTING) { // typically means no response from the remote end. // throw a comm exception to distinguish this case from the // one where the remote end itself threw a SystemException. throw new SystemCommunicationException(); } else { throw new WrongStateException() ; } } }