Package org.apache.activemq.advisory
Class ProducerEventSource
- java.lang.Object
-
- org.apache.activemq.advisory.ProducerEventSource
-
- All Implemented Interfaces:
MessageListener,Service
public class ProducerEventSource extends Object implements Service, MessageListener
An object which can be used to listen to the number of active consumers available on a given destination.
-
-
Constructor Summary
Constructors Constructor Description ProducerEventSource(Connection connection, Destination destination)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intextractProducerCountFromMessage(Message message, int count)protected voidfireProducerEvent(ProducerEvent event)voidonMessage(Message message)voidsetProducerListener(ProducerListener listener)voidstart()voidstop()
-
-
-
Constructor Detail
-
ProducerEventSource
public ProducerEventSource(Connection connection, Destination destination) throws JMSException
- Throws:
JMSException
-
-
Method Detail
-
setProducerListener
public void setProducerListener(ProducerListener listener)
-
start
public void start() throws Exception
-
onMessage
public void onMessage(Message message)
- Specified by:
onMessagein interfaceMessageListener
-
extractProducerCountFromMessage
protected int extractProducerCountFromMessage(Message message, int count)
-
fireProducerEvent
protected void fireProducerEvent(ProducerEvent event)
-
-