org.jabber.jabberbeans.util
Class KeepAlive

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--org.jabber.jabberbeans.util.KeepAlive

class KeepAlive
extends java.lang.Thread


Inner Class Summary
 class KeepAlive.KeepAliveConnectionListener
           
 class KeepAlive.KeepAlivePacket
          KeepAlivePacket is rather simple - instead of being XML, it is just a space.
 class KeepAlive.KeepAlivePacketListener
           
 
Field Summary
private  boolean bConnected
          boolean indicating that the connection is down to the thread, so that it does not keep sending data out to the ether.
private  boolean bRunning
          boolean indicating that the thread is still in a running state (used to shut it down)
private  ConnectionBean cb
          The ConnectionBean which we are keeping alive.
private  int timeout
          timeout in milliseconds, after which a keepalive packet (space) will be sent.
 
Fields inherited from class java.lang.Thread
contextClassLoader, daemon, eetop, group, inheritedAccessControlContext, MAX_PRIORITY, MIN_PRIORITY, name, NORM_PRIORITY, priority, single_step, stillborn, stopThreadPermission, target, threadInitNumber, threadQ, values
 
Constructor Summary
KeepAlive(ConnectionBean cb, int timeout)
          Creates a new KeepAlive instance.
 
Method Summary
 void run()
           
 void shutdown()
           
 
Methods inherited from class java.lang.Thread
, activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, exit, getContextClassLoader, getName, getPriority, getThreadGroup, init, interrupt, interrupt0, interrupted, isAlive, isDaemon, isInterrupted, isInterrupted, join, join, join, nextThreadNum, registerNatives, resume, resume0, setContextClassLoader, setDaemon, setName, setPriority, setPriority0, sleep, sleep, start, stop, stop, stop0, suspend, suspend0, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

cb

private ConnectionBean cb
The ConnectionBean which we are keeping alive.

timeout

private int timeout
timeout in milliseconds, after which a keepalive packet (space) will be sent.

bRunning

private boolean bRunning
boolean indicating that the thread is still in a running state (used to shut it down)

bConnected

private boolean bConnected
boolean indicating that the connection is down to the thread, so that it does not keep sending data out to the ether.
Constructor Detail

KeepAlive

public KeepAlive(ConnectionBean cb,
                 int timeout)
Creates a new KeepAlive instance.
Parameters:
cb - a ConnectionBean value
timeout - timer in milliseconds after last traffic to send keepalive.
Method Detail

shutdown

public void shutdown()

run

public void run()
Overrides:
run in class java.lang.Thread