Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.activemq.advisories
Class ProducerAdvisor  view ProducerAdvisor download ProducerAdvisor.java

java.lang.Object
  extended byorg.activemq.advisories.ProducerAdvisor
All Implemented Interfaces:
javax.jms.MessageListener

public class ProducerAdvisor
extends java.lang.Object
implements javax.jms.MessageListener

A helper class for listening for MessageProducer advisories * @version $Revision: 1.1.1.1 $


Field Summary
private  java.util.Map activeProducers
           
private  javax.jms.Connection connection
           
private  org.activemq.message.ActiveMQDestination destination
           
private  java.util.List listeners
           
private static org.apache.commons.logging.Log log
           
private  javax.jms.Session session
           
private  SynchronizedBoolean started
           
 
Constructor Summary
ProducerAdvisor(javax.jms.Connection connection, javax.jms.Destination destination)
          Construct a ProducerAdvisor
 
Method Summary
 java.util.Set activeProducers(javax.jms.Destination destination)
          return a set of active ProducerInfo's for a particular destination
 void addListener(ProducerAdvisoryEventListener l)
          Add a listener
private  void fireEvent(ProducerAdvisoryEvent event)
           
 boolean isActive(javax.jms.Destination destination)
          returns true if there is an active producer for the destination
 void onMessage(javax.jms.Message msg)
          OnMessage() implementation
 void removeListener(ProducerAdvisoryEventListener l)
          Remove a listener
 void start()
          start listening for advisories
 void stop()
          stop listening for advisories
private  void updateActiveProducers(org.activemq.message.ProducerInfo info)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static final org.apache.commons.logging.Log log

connection

private javax.jms.Connection connection

destination

private org.activemq.message.ActiveMQDestination destination

session

private javax.jms.Session session

listeners

private java.util.List listeners

started

private SynchronizedBoolean started

activeProducers

private java.util.Map activeProducers
Constructor Detail

ProducerAdvisor

public ProducerAdvisor(javax.jms.Connection connection,
                       javax.jms.Destination destination)
                throws javax.jms.JMSException
Construct a ProducerAdvisor

Method Detail

start

public void start()
           throws javax.jms.JMSException
start listening for advisories


stop

public void stop()
          throws javax.jms.JMSException
stop listening for advisories


addListener

public void addListener(ProducerAdvisoryEventListener l)
Add a listener


removeListener

public void removeListener(ProducerAdvisoryEventListener l)
Remove a listener


isActive

public boolean isActive(javax.jms.Destination destination)
returns true if there is an active producer for the destination


activeProducers

public java.util.Set activeProducers(javax.jms.Destination destination)
return a set of active ProducerInfo's for a particular destination


onMessage

public void onMessage(javax.jms.Message msg)
OnMessage() implementation

Specified by:
onMessage in interface javax.jms.MessageListener

fireEvent

private void fireEvent(ProducerAdvisoryEvent event)

updateActiveProducers

private void updateActiveProducers(org.activemq.message.ProducerInfo info)