org.activemq.advisories
Class ProducerDemandAdvisor
java.lang.Object
org.activemq.advisories.ProducerDemandAdvisor
- public class ProducerDemandAdvisor
- extends java.lang.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(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 |
ProducerDemandAdvisor
public ProducerDemandAdvisor(javax.jms.Connection connection,
javax.jms.Destination destination)
throws javax.jms.JMSException
isInDemand
public boolean isInDemand()
getDemandListener
public ProducerDemandListener getDemandListener()
setDemandListener
public void setDemandListener(ProducerDemandListener demandListener)
start
public void start()
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
stop
public void stop()
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
process
protected void process(javax.jms.Message msg)
Copyright © 2004-2005 Protique, Ltd.. All Rights Reserved.