com.funambol.util
Class HttpTransportAgent.ConnectionTimer

java.lang.Object
  extended by java.util.TimerTask
      extended by com.funambol.util.HttpTransportAgent.ConnectionTimer
All Implemented Interfaces:
java.lang.Runnable
Enclosing class:
HttpTransportAgent

protected class HttpTransportAgent.ConnectionTimer
extends java.util.TimerTask

This class is used (with a Timer) to monitor a connection and interrupt it if it hangs for more than command timeout. For each IO operation to be monitored, one such object must be created. The client is responsible for notifying when the operation is terminated. If by the time the alarm is triggered, the operation is not terminated, then such an operation is considered timeout and closeConnection is invoked. This will cause exceptions in any hanging read/write, allowing each thread to resume execution.


Constructor Summary
HttpTransportAgent.ConnectionTimer()
          Constructor
 
Method Summary
 long getDelay()
          Returns the delay for this task
 void run()
          This method is invoked when the alarm expires.
 
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

HttpTransportAgent.ConnectionTimer

public HttpTransportAgent.ConnectionTimer()
Constructor

Method Detail

getDelay

public long getDelay()
Returns the delay for this task


run

public void run()
This method is invoked when the alarm expires. If the operation this task is monitoring has not finished yet, then we force the entire connection to shut down. This will cause exceptions for all the pending read/write operations

Specified by:
run in interface java.lang.Runnable
Specified by:
run in class java.util.TimerTask


Copyright © 2001-2009 Funambol.