org.openeai.jms.producer
Class PubSubProducer.MonitorProducer


java.lang.Object

  |

  +--org.openeai.jms.producer.PubSubProducer.MonitorProducer

All Implemented Interfaces:
java.lang.Runnable
Enclosing class:
PubSubProducer

protected class PubSubProducer.MonitorProducer
extends java.lang.Object
implements java.lang.Runnable

This Thread will sleep for 30 seconds and then wake up and check the status of the producer by attempting to create/delete a TemporaryTopic. If the creation of the TemporaryTopic fails, it assumes there is something wrong with the producer's connection to the broker and it will therefore not be able to produce any messages. When that happens, it attempts to do a "clean" shutdown on the producer and then restarts the producer which will re-establish its connection to the broker and it will be able to produce messages again. This means, if we have to take down a broker for any reason (on purpose or not), we will NOT have to restart all our "long running" producers when the broker comes back up, rather, they will do that themselves.

The thread is started when the producer is started the first time and continues this process for the life of the producer.

Author:
Tod Jackson

Constructor Summary
PubSubProducer.MonitorProducer(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

PubSubProducer.MonitorProducer


public PubSubProducer.MonitorProducer(int sleepInterval)
Method Detail

run


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


Copyright © 2002, OpenEAI Software Foundation