/* ** Name: disableTimer ** ** Description: ** Disable a timer started by enableTimer(). ** ** Input: ** None. ** ** Output: ** None. ** ** Returns: ** void. ** ** History: ** 31-Oct-02 (gordy) ** Created. */ private void disableTimer() { if ( timer != null ) { timer.Interrupt(); timer = null; } return; }
/* ** Name: enableTimer ** ** Description: ** Sets a timer for a requested timeout. When the time elapses, ** timed_out will be set TRUE. Timer may be disabled prior to ** timeout by calling disableTimer. ** ** A negative timeout values is interpreted as milli-seconds while ** a positive value is assumed to be seconds. A zero value will ** disable the timer. ** ** Input: ** timeout Timeout. ** ** Output: ** None. ** ** Returns: ** void. ** ** History: ** 31-Oct-02 (gordy) ** Created. */ private void enableTimer( int timeout ) { timed_out = false; if ( timeout == 0 ) timer = null; else { timer = new Timer( timeout, (Timer.ICallback)this ); timer.Start(); } return; }
/* ** Name: timeExpired ** ** Description: ** Implements the callback method for the Timer Callback ** interface. Called by the Timer object created in ** readResults(). Cancel the current query. ** ** Input: ** None. ** ** Output: ** None. ** ** Returns: ** void. ** ** History: ** 31-Oct-02 (gordy) ** Created. */ public void timeExpired() { if ( timer != null ) { timed_out = true; timer = null; } try { msg.cancel(); } catch( Exception ) {} return; }