Class TimeoutHandler

  • All Implemented Interfaces:
    Runnable

    public class TimeoutHandler
    extends TimerTask
    An object of this class is registered to be invoked in some predefined time intervals. This checks the timeouts of callbacks stored in the SynapseCallbackReceiver and removes all expired callbacks. Timeouts of the callbacks are stored as the time, not the duration. So that the time or the interval of invoking this class does not affect the correctness of the timeouts, although longer intervals would introduce larger error between the actual timeout and the specified timeout. For each invocation this gets a time value to be compared against the timeouts of the callback objects. This time is the System.currentTimeMillis() for Java 1.4 and System.nanoTime() for Java 1.5 and later.
    • Method Detail

      • run

        public void run()
        Checks if the timeout has expired for each callback in the callback store. If expired, removes the callback. If specified sends a fault message to the client about the timeout.
        Specified by:
        run in interface Runnable
        Specified by:
        run in class TimerTask