|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ConsumerManager is responsible for creating and managing the
lifecycle of consumers.
| Method Summary | |
void |
closeConsumer(ConsumerEndpoint consumer)
Close a consumer. |
ConsumerEndpoint |
createConsumer(JmsDestination destination,
long connectionId,
java.lang.String selector,
boolean noLocal)
Create a transient consumer for the specified destination. |
DurableConsumerEndpoint |
createDurableConsumer(JmsTopic topic,
java.lang.String name,
java.lang.String clientID,
long connectionId,
boolean noLocal,
java.lang.String selector)
Create a durable consumer. |
ConsumerEndpoint |
createQueueBrowser(JmsQueue queue,
java.lang.String selector)
Create a new queue browser. |
ConsumerEndpoint |
getConsumerEndpoint(long consumerId)
Return the consumer with the specified identity. |
ConsumerEndpoint |
getConsumerEndpoint(java.lang.String persistentId)
Return the consumer with the specified persistent identity. |
boolean |
hasActiveConsumers(JmsDestination destination)
Determines if there are any active consumers for a destination. |
void |
subscribe(JmsTopic topic,
java.lang.String name,
java.lang.String clientID)
Create a new durable subscription. |
void |
unsubscribe(JmsTopic topic)
Remove all durable subscriptions for a destination. |
void |
unsubscribe(java.lang.String name,
java.lang.String clientID)
Remove a durable subscription. |
| Method Detail |
public void subscribe(JmsTopic topic,
java.lang.String name,
java.lang.String clientID)
throws javax.jms.JMSException
topic - the topic to subscribe toname - the subscription nameclientID - the client identifier. May be nulljavax.jms.InvalidDestinationException - if topic is not a
persistent destination, or
name is an invalid
subscription namejavax.jms.JMSException - if the durable consumer can't be
created
public void unsubscribe(java.lang.String name,
java.lang.String clientID)
throws javax.jms.JMSException
DurableConsumerEndpoint is inactive.name - the subscription nameclientID - the client identifier. May be nulljavax.jms.InvalidDestinationException - if an invalid subscription name is
specified.javax.jms.JMSException - if the durable consumer is active, or
cannot be removed
public void unsubscribe(JmsTopic topic)
throws javax.jms.JMSException
ConsumerEndpoints are inactive.topic - the topic to remove consumers forjavax.jms.JMSException - if the subscriptions can't be removed
public ConsumerEndpoint createConsumer(JmsDestination destination,
long connectionId,
java.lang.String selector,
boolean noLocal)
throws javax.jms.JMSException
destination - the destination to consume messages fromconnectionId - the identity of the connection that owns this
consumerselector - the message selector. May be nullnoLocal - if true, and the destination is a topic, inhibits the
delivery of messages published by its own connection.
The behavior for noLocal is not
specified if the destination is a queue.javax.jms.InvalidSelectorException - if the selector is not well formedjavax.jms.JMSException - if the consumer can't be created
public DurableConsumerEndpoint createDurableConsumer(JmsTopic topic,
java.lang.String name,
java.lang.String clientID,
long connectionId,
boolean noLocal,
java.lang.String selector)
throws javax.jms.JMSException
topic - the topic to subscribe toname - the subscription nameclientID - the client identifier. May be null.connectionId - the identity of the connection that owns this
consumernoLocal - if true, and the destination is a topic, inhibits the
delivery of messages published by its own
connection.selector - the message selector. May be nulljavax.jms.InvalidDestinationException - if topic is not a
persistent destinationjavax.jms.InvalidSelectorException - if the selector is not well formedjavax.jms.JMSException - if a durable consumer is already
active with the same name
public ConsumerEndpoint createQueueBrowser(JmsQueue queue,
java.lang.String selector)
throws javax.jms.JMSException
queue - the queue to browseselector - the message selector. May be nulljavax.jms.InvalidSelectorException - if the selector is not well formedjavax.jms.JMSException - if the browser can't be createdpublic void closeConsumer(ConsumerEndpoint consumer)
consumer - the consumer to closepublic ConsumerEndpoint getConsumerEndpoint(long consumerId)
consumerId - the identity of the consumernull if none existspublic ConsumerEndpoint getConsumerEndpoint(java.lang.String persistentId)
persistentId - the persistent identity of the consumernull if none existspublic boolean hasActiveConsumers(JmsDestination destination)
destination - the destinationtrue if there is at least one consumer
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||