org.activemq.advisories
Class ProducerAdvisor

java.lang.Object
  extended by org.activemq.advisories.ProducerAdvisor
All Implemented Interfaces:
MessageListener

public class ProducerAdvisor
extends Object
implements MessageListener

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


Constructor Summary
ProducerAdvisor(Connection connection, Destination destination)
          Construct a ProducerAdvisor
 
Method Summary
 Set activeProducers(Destination destination)
          return a set of active ProducerInfo's for a particular destination
 void addListener(ProducerAdvisoryEventListener l)
          Add a listener
 boolean isActive(Destination destination)
          returns true if there is an active producer for the destination
 void onMessage(Message msg)
          OnMessage() implementation
 void removeListener(ProducerAdvisoryEventListener l)
          Remove a listener
 void start()
          start listening for advisories
 void stop()
          stop listening for advisories
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProducerAdvisor

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

Parameters:
connection -
destination - the destination to listen for Producer events
Throws:
JMSException
Method Detail

start

public void start()
           throws JMSException
start listening for advisories

Throws:
JMSException

stop

public void stop()
          throws JMSException
stop listening for advisories

Throws:
JMSException

addListener

public void addListener(ProducerAdvisoryEventListener l)
Add a listener

Parameters:
l -

removeListener

public void removeListener(ProducerAdvisoryEventListener l)
Remove a listener

Parameters:
l -

isActive

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

Parameters:
destination -
Returns:
true if a producer for the destination

activeProducers

public Set activeProducers(Destination destination)
return a set of active ProducerInfo's for a particular destination

Parameters:
destination -
Returns:
the set of ProducerInfo objects currently active

onMessage

public void onMessage(Message msg)
OnMessage() implementation

Specified by:
onMessage in interface MessageListener
Parameters:
msg -


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