org.apache.synapse.core.axis2
Class TimeoutHandler

java.lang.Object
  extended by java.util.TimerTask
      extended by org.apache.synapse.core.axis2.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.


Constructor Summary
TimeoutHandler(Map callbacks, ServerContextInformation contextInfo)
           
 
Method Summary
 void run()
          Checks if the timeout has expired for each callback in the callback store.
 
Methods inherited from class java.util.TimerTask
cancel, scheduledExecutionTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimeoutHandler

public TimeoutHandler(Map callbacks,
                      ServerContextInformation contextInfo)
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


Copyright © 2005-2012 Apache Software Foundation. All Rights Reserved.