/** * Handle the comms timeout event. * * Preparing -> Preparing (resend Prepare) * Committing -> Committing (resend Commit) */ private void commsTimeout(TimerTask caller) { final State current ; synchronized(this) { if (timerTask != caller) { // the timer was cancelled but it went off before it could be cancelled return; } current = state ; } if (current == State.STATE_PREPARING) { sendPrepare() ; } else if (current == State.STATE_COMMITTING) { sendCommit() ; } }
/** * Handle the comms timeout event. * * Preparing -> Preparing (resend Prepare) * Committing -> Committing (resend Commit) */ private void commsTimeout(TimerTask caller) { final State current ; synchronized(this) { if (timerTask != caller) { // the timer was cancelled but it went off before it could be cancelled return; } current = state ; } if (current == State.STATE_PREPARING) { sendPrepare() ; } else if (current == State.STATE_COMMITTING) { sendCommit() ; } }
/** * Handle the comms timeout event. * * Preparing -> Preparing (resend Prepare) * Committing -> Committing (resend Commit) */ private void commsTimeout(TimerTask caller) { final State current ; synchronized(this) { if (timerTask != caller) { // the timer was cancelled but it went off before it could be cancelled return; } current = state ; } if (current == State.STATE_PREPARING) { sendPrepare() ; } else if (current == State.STATE_COMMITTING) { sendCommit() ; } }