|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.activemq.service.impl.SubscriptionImpl
A Subscription holds messages to be dispatched to a a Client Consumer
| Field Summary | |
protected java.lang.String |
brokerName
|
protected java.lang.String |
clusterName
|
protected Dispatcher |
dispatch
|
protected MessageIdentity |
lastMessageIdentity
|
protected QueueList |
messagePtrs
|
protected EDU.oswego.cs.dl.util.concurrent.SynchronizedInt |
unconsumedMessagesDispatched
|
| Constructor Summary | |
SubscriptionImpl(Dispatcher dispatcher,
BrokerClient client,
ConsumerInfo info,
Filter filter,
RedeliveryPolicy redeliveryPolicy,
DeadLetterPolicy deadLetterPolicy)
Create a Subscription object that holds messages to be dispatched to a Consumer |
|
| Method Summary | |
void |
addMessage(MessageContainer container,
ActiveMQMessage message)
If the Subscription is a target for the message, the subscription will add a reference to the message and register an interest in the message to the container |
void |
clear()
Called when the Subscription is discarded |
protected boolean |
clientIDsEqual(ActiveMQMessage message)
|
protected SubscriberEntry |
createSubscriptionEntry()
|
protected static boolean |
equal(java.lang.Object left,
java.lang.Object right)
|
BrokerClient |
getActiveClient()
|
java.lang.String |
getClientId()
|
java.lang.String |
getConsumerId()
|
int |
getConsumerNumber()
|
ActiveMQDestination |
getDestination()
|
Filter |
getFilter()
|
MessageIdentity |
getLastMessageIdentity()
Retreives the messageIdentity of the last message sent to this Queue based Subscription |
ActiveMQMessage[] |
getMessagesToDispatch()
Retrieve messages to dispatch |
protected ActiveMQMessage[] |
getMessagesWithPrefetch()
|
java.lang.String |
getPersistentKey()
Returns the persistent key used to uniquely identify this durable topic subscription |
RedeliveryPolicy |
getRedeliveryPolicy()
|
java.lang.String |
getSelector()
|
java.lang.String |
getSubscriberName()
|
SubscriberEntry |
getSubscriptionEntry()
Lazily creates the persistent entry representation of this subscription |
boolean |
isActive()
|
boolean |
isAtPrefetchLimit()
Indicates the Subscription it's reached it's pre-fetch limit |
protected boolean |
isAuthorizedForMessage(ActiveMQMessage message)
Returns whether or not the consumer can receive the given message |
boolean |
isBrowser()
Indicates the consumer is a browser only |
boolean |
isDurableTopic()
Indicates the Subscriber is a Durable Subscriber |
boolean |
isLocalSubscription()
|
boolean |
isNoLocal()
|
boolean |
isReadyToDispatch()
Indicates if this Subscription has more messages to send to the Consumer |
boolean |
isSameDurableSubscription(ConsumerInfo info)
Checks if this subscription is a duplicate durable subscription of the given consumer info |
boolean |
isTarget(ActiveMQMessage message)
determines if the Subscription is interested in the message |
boolean |
isWildcard()
|
void |
messageConsumed(MessageAck ack)
Indicates a message has been delivered to a MessageConsumer |
void |
reset()
Called when an active subscriber has closed. |
void |
setActive(boolean newActive)
set the state of the Subscription |
void |
setActiveConsumer(BrokerClient client,
ConsumerInfo info)
Set the active consumer info |
void |
setClientId(java.lang.String clientId)
|
void |
setFilter(Filter filter)
|
void |
setLastMessageIdentifier(MessageIdentity messageIdentity)
Used for a Queue based Subscription to set the last acknowledged message ID |
void |
setNoLocal(boolean noLocal)
|
void |
setRedeliveryPolicy(RedeliveryPolicy redeliveryPolicy)
|
void |
setSubscriberName(java.lang.String subscriberName)
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected Dispatcher dispatch
protected java.lang.String brokerName
protected java.lang.String clusterName
protected MessageIdentity lastMessageIdentity
protected EDU.oswego.cs.dl.util.concurrent.SynchronizedInt unconsumedMessagesDispatched
protected QueueList messagePtrs
| Constructor Detail |
public SubscriptionImpl(Dispatcher dispatcher,
BrokerClient client,
ConsumerInfo info,
Filter filter,
RedeliveryPolicy redeliveryPolicy,
DeadLetterPolicy deadLetterPolicy)
dispatcher - client - info - filter - redeliveryPolicy - deadLetterPolicy - | Method Detail |
public void setActiveConsumer(BrokerClient client,
ConsumerInfo info)
setActiveConsumer in interface Subscriptionclient - info - public java.lang.String toString()
public void clear()
throws javax.jms.JMSException
clear in interface Subscriptionjavax.jms.JMSException
public void reset()
throws javax.jms.JMSException
reset in interface Subscriptionjavax.jms.JMSExceptionpublic BrokerClient getActiveClient()
public java.lang.String getClientId()
getClientId in interface Subscriptionpublic void setClientId(java.lang.String clientId)
clientId - The clientId to set.public Filter getFilter()
public void setFilter(Filter filter)
filter - The filter to set.public boolean isWildcard()
isWildcard in interface Subscriptionpublic java.lang.String getPersistentKey()
Subscription
getPersistentKey in interface Subscription
public boolean isSameDurableSubscription(ConsumerInfo info)
throws javax.jms.JMSException
Subscription
isSameDurableSubscription in interface Subscriptioninfo -
javax.jms.JMSExceptionpublic boolean isNoLocal()
public void setNoLocal(boolean noLocal)
noLocal - The noLocal to set.public java.lang.String getSubscriberName()
getSubscriberName in interface Subscriptionpublic void setSubscriberName(java.lang.String subscriberName)
subscriberName - The subscriberName to set.public RedeliveryPolicy getRedeliveryPolicy()
public void setRedeliveryPolicy(RedeliveryPolicy redeliveryPolicy)
public boolean isTarget(ActiveMQMessage message)
throws javax.jms.JMSException
isTarget in interface Subscriptionmessage -
javax.jms.JMSException
public void addMessage(MessageContainer container,
ActiveMQMessage message)
throws javax.jms.JMSException
addMessage in interface Subscriptioncontainer - message -
javax.jms.JMSException
public void messageConsumed(MessageAck ack)
throws javax.jms.JMSException
messageConsumed in interface Subscriptionack -
javax.jms.JMSException
public ActiveMQMessage[] getMessagesToDispatch()
throws javax.jms.JMSException
getMessagesToDispatch in interface Subscriptionjavax.jms.JMSExceptionpublic SubscriberEntry getSubscriptionEntry()
Subscription
getSubscriptionEntry in interface Subscriptionpublic boolean isLocalSubscription()
isLocalSubscription in interface Subscriptionprotected SubscriberEntry createSubscriptionEntry()
protected ActiveMQMessage[] getMessagesWithPrefetch()
throws javax.jms.JMSException
javax.jms.JMSException
public boolean isAtPrefetchLimit()
throws javax.jms.JMSException
isAtPrefetchLimit in interface Subscriptionjavax.jms.JMSException
public boolean isReadyToDispatch()
throws javax.jms.JMSException
isReadyToDispatch in interface Subscriptionjavax.jms.JMSExceptionpublic ActiveMQDestination getDestination()
getDestination in interface Subscriptionpublic java.lang.String getSelector()
getSelector in interface Subscriptionpublic boolean isActive()
isActive in interface Subscription
public void setActive(boolean newActive)
throws javax.jms.JMSException
Subscription
setActive in interface SubscriptionnewActive - The active to set.
javax.jms.JMSExceptionpublic int getConsumerNumber()
getConsumerNumber in interface Subscriptionpublic java.lang.String getConsumerId()
getConsumerId in interface Subscription
public boolean isDurableTopic()
throws javax.jms.JMSException
isDurableTopic in interface Subscriptionjavax.jms.JMSException
public boolean isBrowser()
throws javax.jms.JMSException
isBrowser in interface Subscriptionjavax.jms.JMSException
public MessageIdentity getLastMessageIdentity()
throws javax.jms.JMSException
Subscription
getLastMessageIdentity in interface Subscriptionjavax.jms.JMSException
public void setLastMessageIdentifier(MessageIdentity messageIdentity)
throws javax.jms.JMSException
Subscription
setLastMessageIdentifier in interface SubscriptionmessageIdentity -
javax.jms.JMSExceptionprotected boolean clientIDsEqual(ActiveMQMessage message)
protected static final boolean equal(java.lang.Object left,
java.lang.Object right)
protected boolean isAuthorizedForMessage(ActiveMQMessage message)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||