org.openeai.jms.consumer
Class PubSubConsumer.MonitorConsumer

java.lang.Object
  extended by org.openeai.jms.consumer.PubSubConsumer.MonitorConsumer
All Implemented Interfaces:
java.lang.Runnable
Enclosing class:
PubSubConsumer

protected class PubSubConsumer.MonitorConsumer
extends java.lang.Object
implements java.lang.Runnable

This Thread will sleep for a specified period of time and then wake up and check the status of the consumer by attempting to create/delete a TemporaryTopic. If the creation of the TemporaryTopic fails, it assumes there is something wrong with the consumer's connection to the broker and it is not consuming any messages. When that happens, it attempts to do a "clean" shutdown on the consumer and then restarts the consumer which will re-establish its connection to the broker and it will start consuming messages again. This means, if brokers must be taken down for any reason (on purpose or not), gateways will NOT need to be restarted when the broker comes back up, rather, they will do that themselves. This process continues until it is stopped via the stopMonitor method or until the gateway is stopped. If a broker is down for an extended period of time, this Monitor will continue to try and reconnect until the broker is back online.

The thread is started when the consumer is started the first time.

Author:
Tod Jackson
See Also:
PubSubConsumer.stopMonitor()

Constructor Summary
PubSubConsumer.MonitorConsumer(int sleepInterval)
           
 
Method Summary
 void run()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PubSubConsumer.MonitorConsumer

public PubSubConsumer.MonitorConsumer(int sleepInterval)
Method Detail

run

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


Copyright © 2002,2003 OpenEAI Software Foundation