org.objectweb.joram.mom.proxies
Class UserAgent.HeartBeatTask

java.lang.Object
  extended by java.util.TimerTask
      extended by org.objectweb.joram.mom.proxies.UserAgent.HeartBeatTask
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, java.lang.Runnable
Enclosing class:
UserAgent

 class UserAgent.HeartBeatTask
extends java.util.TimerTask
implements java.io.Externalizable

Timer task responsible for closing the connection if it has not sent any requests for the duration 'timeout'.


Field Summary
private  java.lang.Integer key
           
private  long lastRequestDate
           
private  int timeout
          Maximum time between two requests on the connection (This value is normally the double of the hear-beat period).
 
Constructor Summary
UserAgent.HeartBeatTask()
           
UserAgent.HeartBeatTask(int timeout, java.lang.Integer key)
           
 
Method Summary
 void readExternal(java.io.ObjectInput in)
           
 void run()
           
 void start()
           
 void touch()
           
 void writeExternal(java.io.ObjectOutput out)
           
 
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
 

Field Detail

timeout

private transient int timeout
Maximum time between two requests on the connection (This value is normally the double of the hear-beat period).


key

private transient java.lang.Integer key

lastRequestDate

private transient long lastRequestDate
Constructor Detail

UserAgent.HeartBeatTask

UserAgent.HeartBeatTask(int timeout,
                        java.lang.Integer key)

UserAgent.HeartBeatTask

public UserAgent.HeartBeatTask()
Method Detail

run

public void run()
Specified by:
run in interface java.lang.Runnable
Specified by:
run in class java.util.TimerTask

start

public void start()
           throws java.io.IOException
Throws:
java.io.IOException

touch

public void touch()

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Specified by:
readExternal in interface java.io.Externalizable
Throws:
java.io.IOException
java.lang.ClassNotFoundException
See Also:
Externalizable.readExternal(java.io.ObjectInput)

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Specified by:
writeExternal in interface java.io.Externalizable
Throws:
java.io.IOException
See Also:
Externalizable.writeExternal(java.io.ObjectOutput)


Copyright © 2010 ScalAgent D.T.. All Rights Reserved.