|
|||||||||||
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 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 Subscription
client
- info
- public String toString()
public void clear() throws JMSException
clear
in interface Subscription
JMSException
public void reset() throws JMSException
reset
in interface Subscription
JMSException
public BrokerClient getActiveClient()
public String getClientId()
getClientId
in interface Subscription
public 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 Subscription
public String getPersistentKey()
Subscription
getPersistentKey
in interface Subscription
public boolean isSameDurableSubscription(ConsumerInfo info) throws JMSException
Subscription
isSameDurableSubscription
in interface Subscription
info
-
JMSException
public boolean isNoLocal()
public void setNoLocal(boolean noLocal)
noLocal
- The noLocal to set.public String getSubscriberName()
getSubscriberName
in interface Subscription
public 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 Subscription
message
-
JMSException
public void addMessage(MessageContainer container, ActiveMQMessage message) throws JMSException
addMessage
in interface Subscription
container
- message
-
JMSException
public void messageConsumed(MessageAck ack) throws JMSException
messageConsumed
in interface Subscription
ack
-
JMSException
public ActiveMQMessage[] getMessagesToDispatch() throws JMSException
getMessagesToDispatch
in interface Subscription
JMSException
public SubscriberEntry getSubscriptionEntry()
Subscription
getSubscriptionEntry
in interface Subscription
public boolean isLocalSubscription()
isLocalSubscription
in interface Subscription
protected SubscriberEntry createSubscriptionEntry()
protected ActiveMQMessage[] getMessagesWithPrefetch() throws JMSException
JMSException
public boolean isAtPrefetchLimit() throws JMSException
isAtPrefetchLimit
in interface Subscription
JMSException
public boolean isReadyToDispatch() throws JMSException
isReadyToDispatch
in interface Subscription
JMSException
public ActiveMQDestination getDestination()
getDestination
in interface Subscription
public String getSelector()
getSelector
in interface Subscription
public boolean isActive()
isActive
in interface Subscription
public void setActive(boolean newActive) throws JMSException
Subscription
setActive
in interface Subscription
newActive
- The active to set.
JMSException
public int getConsumerNumber()
getConsumerNumber
in interface Subscription
public String getConsumerId()
getConsumerId
in interface Subscription
public boolean isDurableTopic() throws JMSException
isDurableTopic
in interface Subscription
JMSException
public boolean isBrowser() throws JMSException
isBrowser
in interface Subscription
JMSException
public MessageIdentity getLastMessageIdentity() throws JMSException
Subscription
getLastMessageIdentity
in interface Subscription
JMSException
public void setLastMessageIdentifier(MessageIdentity messageIdentity) throws JMSException
Subscription
setLastMessageIdentifier
in interface Subscription
messageIdentity
-
JMSException
protected 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 |