org.activemq.advisories
Class ProducerDemandAdvisor
java.lang.Object
org.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.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ProducerDemandAdvisor
public ProducerDemandAdvisor(Connection connection,
Destination destination)
throws JMSException
- Throws:
JMSException
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-2008 Protique, Ltd.. All Rights Reserved.