org.codehaus.activemq.transport.reliable
Class KeepAliveDaemon

java.lang.Object
  extended byorg.codehaus.activemq.transport.reliable.KeepAliveDaemon
All Implemented Interfaces:
Runnable

public class KeepAliveDaemon
extends Object
implements Runnable

KeepAliveDaemon keeps channels alive by sending KeepAlive packets on a specified interval. If the packets aren't don't get a receipt within a specified time, the channel will be forcefully disconnected.


Constructor Summary
protected KeepAliveDaemon()
          Constructs a new KeepAliveDaemon which will send KeepAlive packets throught the wrapped channel.
 
Method Summary
 void addMonitoredChannel(ReliableTransportChannel channel)
           
 long getCheckInterval()
           
static KeepAliveDaemon getInstance()
          Gets the current instance.
 long getLastCheckTime()
           
 void removeMonitoredChannel(ReliableTransportChannel channel)
           
 void restart()
           
 void run()
           
 void setCheckInterval(long interval)
          Sets the number of milliseconds between keep-alive checks are done.
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeepAliveDaemon

protected KeepAliveDaemon()
Constructs a new KeepAliveDaemon which will send KeepAlive packets throught the wrapped channel.

Method Detail

getInstance

public static KeepAliveDaemon getInstance()
Gets the current instance. Singletons implemented this way aren't popular these days, but it might be good here. :)

Returns:
the daemon

addMonitoredChannel

public void addMonitoredChannel(ReliableTransportChannel channel)

removeMonitoredChannel

public void removeMonitoredChannel(ReliableTransportChannel channel)

setCheckInterval

public void setCheckInterval(long interval)
Sets the number of milliseconds between keep-alive checks are done.

Parameters:
interval - the interval

getCheckInterval

public long getCheckInterval()

getLastCheckTime

public long getLastCheckTime()

start

public void start()

stop

public void stop()

restart

public void restart()

run

public void run()
Specified by:
run in interface Runnable


Copyright © 2004-2005 Protique, Ltd.. All Rights Reserved.