org.activemq.advisories
Class ConsumerAdvisor

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

public class ConsumerAdvisor
extends Object
implements MessageListener

A helper class for listening for MessageConsumer advisories

Version:
$Revision: 1.1.1.1 $

Constructor Summary
ConsumerAdvisor(Connection connection, Destination destination)
          Construct a ConsumerAdvisor
 
Method Summary
 Set activeConsumers(Destination destination)
          return a set of active ConsumerInfo's for a particular destination
 void addListener(ConsumerAdvisoryEventListener l)
          Add a listener
 boolean isActive(Destination destination)
          returns true if there is an active subscriber for the destination
 void onMessage(Message msg)
          OnMessage() implementation
 void removeListener(ConsumerAdvisoryEventListener 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

ConsumerAdvisor

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

Parameters:
connection -
destination - the destination to listen for Consumer 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(ConsumerAdvisoryEventListener l)
Add a listener

Parameters:
l -

removeListener

public void removeListener(ConsumerAdvisoryEventListener l)
Remove a listener

Parameters:
l -

isActive

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

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

activeConsumers

public Set activeConsumers(Destination destination)
return a set of active ConsumerInfo's for a particular destination

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

onMessage

public void onMessage(Message msg)
OnMessage() implementation

Specified by:
onMessage in interface MessageListener
Parameters:
msg -


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