|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.activemq.service.impl.SubscriptionImpl
public class SubscriptionImpl
A Subscription holds messages to be dispatched to a a Client Consumer
| Field Summary | |
|---|---|
protected String |
brokerName
|
protected String |
clusterName
|
protected Dispatcher |
dispatch
|
protected MessageIdentity |
lastMessageIdentity
|
protected QueueList |
messagePtrs
|
protected 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(Object left,
Object right)
|
BrokerClient |
getActiveClient()
|
String |
getClientId()
|
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()
|
String |
getPersistentKey()
Returns the persistent key used to uniquely identify this durable topic subscription |
RedeliveryPolicy |
getRedeliveryPolicy()
|
String |
getSelector()
|
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(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(String subscriberName)
|
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 String brokerName
protected String clusterName
protected MessageIdentity lastMessageIdentity
protected 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 String toString()
toString in class Object
public void clear()
throws JMSException
clear in interface SubscriptionJMSException
public void reset()
throws JMSException
reset in interface SubscriptionJMSExceptionpublic BrokerClient getActiveClient()
public String getClientId()
getClientId in interface Subscriptionpublic void setClientId(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 String getPersistentKey()
Subscription
getPersistentKey in interface Subscription
public boolean isSameDurableSubscription(ConsumerInfo info)
throws JMSException
Subscription
isSameDurableSubscription in interface SubscriptionJMSExceptionpublic boolean isNoLocal()
public void setNoLocal(boolean noLocal)
noLocal - The noLocal to set.public String getSubscriberName()
getSubscriberName in interface Subscriptionpublic void setSubscriberName(String subscriberName)
subscriberName - The subscriberName to set.public RedeliveryPolicy getRedeliveryPolicy()
public void setRedeliveryPolicy(RedeliveryPolicy redeliveryPolicy)
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 ActiveMQMessage[] getMessagesToDispatch()
throws JMSException
getMessagesToDispatch in interface SubscriptionJMSExceptionpublic SubscriberEntry getSubscriptionEntry()
Subscription
getSubscriptionEntry in interface Subscriptionpublic boolean isLocalSubscription()
isLocalSubscription in interface Subscriptionprotected SubscriberEntry createSubscriptionEntry()
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 String getSelector()
getSelector in interface Subscriptionpublic boolean isActive()
isActive in interface Subscription
public void setActive(boolean newActive)
throws JMSException
Subscription
setActive in interface SubscriptionnewActive - The active to set.
JMSExceptionpublic int getConsumerNumber()
getConsumerNumber in interface Subscriptionpublic 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 SubscriptionJMSExceptionprotected boolean clientIDsEqual(ActiveMQMessage message)
protected static final boolean equal(Object left,
Object right)
protected boolean isAuthorizedForMessage(ActiveMQMessage message)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||