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 int
extractProducerCountFromMessage(Message message, int count)
protected void
fireProducerEvent(ProducerEvent event)
void
onMessage(Message message)
void
setProducerListener(ProducerListener listener)
void
start()
void
stop()
-
-
-
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:
onMessage
in interfaceMessageListener
-
extractProducerCountFromMessage
protected int extractProducerCountFromMessage(Message message, int count)
-
fireProducerEvent
protected void fireProducerEvent(ProducerEvent event)
-
-