|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.codehaus.activemq.service.impl.SubscriptionImpl
A Subscription holds messages to be dispatched to a a Client Consumer
| Field Summary | |
protected Dispatcher |
dispatch
|
(package private) Filter |
filter
|
(package private) QueueList |
messagePtrs
|
protected SynchronizedInt |
unconsumedMessagesDispatched
|
| Constructor Summary | |
SubscriptionImpl(Dispatcher dispatcher,
ConsumerInfo info,
Filter filter)
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 void |
doMessageConsume(MessageAck ack,
boolean remove)
Consume a message. |
protected static boolean |
equal(java.lang.Object left,
java.lang.Object right)
|
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 |
java.lang.String |
getSelector()
|
java.lang.String |
getSubscriberName()
|
boolean |
isActive()
|
boolean |
isAtPrefetchLimit()
Indicates the Subscription it's reached it's pre-fetch limit |
boolean |
isBrowser()
Indicates the consumer is a browser only |
boolean |
isDurableTopic()
Indicates the Subscriber is a Durable Subscriber |
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 |
onAcknowledgeTransactedMessageBeforeCommit(MessageAck ack)
We have not yet committed and so the message acknowledgement has not really occurred yet but we need to let the dispatcher know that we can commence dispatching more messages to the client. |
void |
redeliverMessage(MessageContainer container,
MessageAck ack)
Forces the given message to be redelivered |
void |
reset()
Called when an active subscriber has closed. |
void |
setActive(boolean active)
set the state of the Subscription |
void |
setActiveConsumer(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 |
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
Filter filter
protected SynchronizedInt unconsumedMessagesDispatched
QueueList messagePtrs
| Constructor Detail |
public SubscriptionImpl(Dispatcher dispatcher,
ConsumerInfo info,
Filter filter)
dispatcher - info - filter - | Method Detail |
public void setActiveConsumer(ConsumerInfo info)
setActiveConsumer in interface Subscriptioninfo - public java.lang.String toString()
public void clear()
throws JMSException
clear in interface SubscriptionJMSException
public void reset()
throws JMSException
reset in interface SubscriptionJMSExceptionpublic 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 JMSException
Subscription
isSameDurableSubscription in interface Subscriptioninfo -
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 boolean isTarget(ActiveMQMessage message)
throws JMSException
isTarget in interface Subscriptionmessage -
JMSException
public void addMessage(MessageContainer container,
ActiveMQMessage message)
throws JMSException
addMessage in interface Subscriptioncontainer - message -
JMSException
public void messageConsumed(MessageAck ack)
throws JMSException
messageConsumed in interface Subscriptionack -
JMSException
public void onAcknowledgeTransactedMessageBeforeCommit(MessageAck ack)
throws JMSException
Subscription
onAcknowledgeTransactedMessageBeforeCommit in interface Subscriptionack -
JMSException
public void redeliverMessage(MessageContainer container,
MessageAck ack)
throws JMSException
Subscription
redeliverMessage in interface Subscriptioncontainer - ack -
JMSException
public ActiveMQMessage[] getMessagesToDispatch()
throws JMSException
getMessagesToDispatch in interface SubscriptionJMSException
protected ActiveMQMessage[] getMessagesWithPrefetch()
throws JMSException
JMSException
public boolean isAtPrefetchLimit()
throws JMSException
isAtPrefetchLimit in interface SubscriptionJMSException
public boolean isReadyToDispatch()
throws JMSException
isReadyToDispatch in interface SubscriptionJMSExceptionpublic ActiveMQDestination getDestination()
getDestination in interface Subscriptionpublic java.lang.String getSelector()
getSelector in interface Subscriptionpublic boolean isActive()
isActive in interface Subscription
public void setActive(boolean active)
throws JMSException
Subscription
setActive in interface Subscriptionactive - The active to set.
JMSExceptionpublic int getConsumerNumber()
getConsumerNumber in interface Subscriptionpublic java.lang.String getConsumerId()
getConsumerId in interface Subscription
public boolean isDurableTopic()
throws JMSException
isDurableTopic in interface SubscriptionJMSException
public boolean isBrowser()
throws JMSException
isBrowser in interface SubscriptionJMSException
public MessageIdentity getLastMessageIdentity()
throws JMSException
Subscription
getLastMessageIdentity in interface SubscriptionJMSException
public void setLastMessageIdentifier(MessageIdentity messageIdentity)
throws JMSException
Subscription
setLastMessageIdentifier in interface SubscriptionmessageIdentity -
JMSException
protected void doMessageConsume(MessageAck ack,
boolean remove)
throws JMSException
ack - the ack commandremove - whether we should actually remove the message (i.e. really consume the message) or should
we just update the counters for the dispatcher / prefetch logic to work
JMSExceptionprotected boolean clientIDsEqual(ActiveMQMessage message)
protected static final boolean equal(java.lang.Object left,
java.lang.Object right)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||