org.apache.activemq.advisory
Class ProducerEventSource

java.lang.Object
  extended by 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
ProducerEventSource(Connection connection, Destination destination)
           
 
Method Summary
protected  int extractProducerCountFromMessage(Message message, int count)
           
protected  void fireProducerEvent(ProducerEvent event)
           
 void onMessage(Message message)
           
 void setProducerListener(ProducerListener listener)
           
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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
Specified by:
start in interface Service
Throws:
Exception

stop

public void stop()
          throws Exception
Specified by:
stop in interface Service
Throws:
Exception

onMessage

public void onMessage(Message message)
Specified by:
onMessage in interface MessageListener

extractProducerCountFromMessage

protected int extractProducerCountFromMessage(Message message,
                                              int count)

fireProducerEvent

protected void fireProducerEvent(ProducerEvent event)


Copyright © 2005–2013 The Apache Software Foundation. All rights reserved.