org.activemq.advisories
Class ProducerDemandAdvisor

java.lang.Object
  extended byorg.activemq.advisories.ProducerDemandAdvisor

public class ProducerDemandAdvisor
extends Object

A ProducerDemandAdvisor is used to know when a destination is in demand. Sometimes generating messages to send to a destination is very expensive and the application would like to avoid producing messages if there are no active consumers for the destination. There is a "demand" for messages when a consumer does come active. This object uses Advisory messages to know when consumer go active and inactive.


Constructor Summary
ProducerDemandAdvisor(Connection connection, Destination destination)
           
 
Method Summary
 ProducerDemandListener getDemandListener()
           
 boolean isInDemand()
           
protected  void process(Message msg)
           
 void setDemandListener(ProducerDemandListener demandListener)
           
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProducerDemandAdvisor

public ProducerDemandAdvisor(Connection connection,
                             Destination destination)
                      throws JMSException
Method Detail

isInDemand

public boolean isInDemand()

getDemandListener

public ProducerDemandListener getDemandListener()

setDemandListener

public void setDemandListener(ProducerDemandListener demandListener)

start

public void start()
           throws JMSException
Throws:
JMSException

stop

public void stop()
          throws JMSException
Throws:
JMSException

process

protected void process(Message msg)


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