org.apache.activemq.advisory
Class ProducerEventSource
java.lang.Object
org.apache.activemq.advisory.ProducerEventSource
- All Implemented Interfaces:
- javax.jms.MessageListener, Service
public class ProducerEventSource
- extends java.lang.Object
- implements Service, javax.jms.MessageListener
An object which can be used to listen to the number of active consumers
available on a given destination.
- Version:
- $Revision: 359679 $
Constructor Summary |
ProducerEventSource(javax.jms.Connection connection,
javax.jms.Destination destination)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ProducerEventSource
public ProducerEventSource(javax.jms.Connection connection,
javax.jms.Destination destination)
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
setProducerListener
public void setProducerListener(ProducerListener listener)
start
public void start()
throws java.lang.Exception
- Specified by:
start
in interface Service
- Throws:
java.lang.Exception
stop
public void stop()
throws java.lang.Exception
- Specified by:
stop
in interface Service
- Throws:
java.lang.Exception
onMessage
public void onMessage(javax.jms.Message message)
- Specified by:
onMessage
in interface javax.jms.MessageListener
extractProducerCountFromMessage
protected int extractProducerCountFromMessage(javax.jms.Message message,
int count)
fireProducerEvent
protected void fireProducerEvent(ProducerEvent event)
Copyright © 2009 Apache Software Foundation. All Rights Reserved.