Package org.apache.activemq.advisory
Class ConsumerEvent
- java.lang.Object
-
- java.util.EventObject
-
- org.apache.activemq.advisory.ConsumerEvent
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ConsumerStartedEvent
,ConsumerStoppedEvent
public abstract class ConsumerEvent extends EventObject
An event when the number of consumers on a given destination changes.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class java.util.EventObject
source
-
-
Constructor Summary
Constructors Constructor Description ConsumerEvent(ConsumerEventSource source, Destination destination, ConsumerId consumerId, int consumerCount)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description ConsumerEventSource
getAdvisor()
int
getConsumerCount()
Returns the current number of consumers active at the time this advisory was sent.ConsumerId
getConsumerId()
Destination
getDestination()
abstract boolean
isStarted()
-
Methods inherited from class java.util.EventObject
getSource, toString
-
-
-
-
Constructor Detail
-
ConsumerEvent
public ConsumerEvent(ConsumerEventSource source, Destination destination, ConsumerId consumerId, int consumerCount)
-
-
Method Detail
-
getAdvisor
public ConsumerEventSource getAdvisor()
-
getDestination
public Destination getDestination()
-
getConsumerCount
public int getConsumerCount()
Returns the current number of consumers active at the time this advisory was sent. Note that this is not the number of consumers active when the consumer started consuming. It is usually more vital to know how many consumers there are now - rather than historically how many there were when a consumer started. So if you create aConsumerListener
after many consumers have started, you will receive a ConsumerEvent for each consumer. However thegetConsumerCount()
method will always return the current active consumer count on each event.
-
getConsumerId
public ConsumerId getConsumerId()
-
isStarted
public abstract boolean isStarted()
-
-