|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.activemq.broker.region.AbstractSubscription
org.apache.activemq.broker.region.PrefetchSubscription
public abstract class PrefetchSubscription
A subscription that honors the pre-fetch option of the ConsumerInfo.
Field Summary | |
---|---|
protected java.util.LinkedList |
dispatched
|
protected PendingMessageCursor |
pending
|
protected int |
prefetchExtension
|
Fields inherited from class org.apache.activemq.broker.region.AbstractSubscription |
---|
broker, context, destinationFilter, destinations, info |
Constructor Summary | |
---|---|
PrefetchSubscription(Broker broker,
ConnectionContext context,
ConsumerInfo info)
|
|
PrefetchSubscription(Broker broker,
ConnectionContext context,
ConsumerInfo info,
PendingMessageCursor cursor)
|
Method Summary | |
---|---|
void |
acknowledge(ConnectionContext context,
MessageAck ack)
Used when client acknowledge receipt of dispatched message. |
protected void |
acknowledge(ConnectionContext context,
MessageAck ack,
MessageReference node)
Used during acknowledgment to remove the message. |
void |
add(ConnectionContext context,
Destination destination)
The subscription will be receiving messages from the destination. |
void |
add(MessageReference node)
Used to add messages that match the subscription. |
protected abstract boolean |
canDispatch(MessageReference node)
Use when a matched message is about to be dispatched to the client. |
protected MessageDispatch |
createMessageDispatch(MessageReference node,
Message message)
|
protected boolean |
dispatch(MessageReference node)
|
protected void |
dispatchMatched()
|
long |
getDequeueCounter()
|
long |
getDispatchedCounter()
|
int |
getDispatchedQueueSize()
|
long |
getEnqueueCounter()
|
int |
getPendingQueueSize()
|
protected boolean |
isFull()
Used to determine if the broker can dispatch to the consumer. |
boolean |
isHighWaterMark()
|
boolean |
isLowWaterMark()
|
boolean |
isRecoveryRequired()
Informs the Broker if the subscription needs to intervention to recover it's state e.g. |
protected void |
onDispatch(MessageReference node,
Message message)
|
void |
optimizePrefetch()
optimize message consumer prefetch if the consumer supports it |
void |
processMessageDispatchNotification(MessageDispatchNotification mdn)
Used by a Slave Broker to update dispatch infomation |
Response |
pullMessage(ConnectionContext context,
MessagePull pull)
Allows a message to be pulled on demand by a client |
void |
remove(ConnectionContext context,
Destination destination)
The subscription will be no longer be receiving messages from the destination. |
protected void |
sendToDLQ(ConnectionContext context,
MessageReference node)
|
void |
updateConsumerPrefetch(int newPrefetch)
inform the MessageConsumer on the client to change it's prefetch |
Methods inherited from class org.apache.activemq.broker.region.AbstractSubscription |
---|
gc, getConsumerInfo, getContext, getInfo, getObjectName, getPrefetchSize, getSelector, getSelectorExpression, isSlaveBroker, matches, matches, setObjectName, setSelector |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.activemq.broker.region.Subscription |
---|
destroy |
Field Detail |
---|
protected final PendingMessageCursor pending
protected final java.util.LinkedList dispatched
protected int prefetchExtension
Constructor Detail |
---|
public PrefetchSubscription(Broker broker, ConnectionContext context, ConsumerInfo info, PendingMessageCursor cursor) throws javax.jms.InvalidSelectorException
javax.jms.InvalidSelectorException
public PrefetchSubscription(Broker broker, ConnectionContext context, ConsumerInfo info) throws javax.jms.InvalidSelectorException
javax.jms.InvalidSelectorException
Method Detail |
---|
public Response pullMessage(ConnectionContext context, MessagePull pull) throws java.lang.Exception
java.lang.Exception
public void add(MessageReference node) throws java.lang.Exception
Subscription
java.lang.InterruptedException
java.io.IOException
java.lang.Exception
public void processMessageDispatchNotification(MessageDispatchNotification mdn) throws java.lang.Exception
Subscription
java.lang.Exception
public void acknowledge(ConnectionContext context, MessageAck ack) throws java.lang.Exception
Subscription
java.io.IOException
java.lang.Exception
protected void sendToDLQ(ConnectionContext context, MessageReference node) throws java.io.IOException, java.lang.Exception
context
- node
-
java.io.IOException
java.lang.Exception
protected boolean isFull()
public boolean isLowWaterMark()
public boolean isHighWaterMark()
public int getPendingQueueSize()
public int getDispatchedQueueSize()
public long getDequeueCounter()
public long getDispatchedCounter()
public long getEnqueueCounter()
public boolean isRecoveryRequired()
Subscription
isRecoveryRequired
in interface Subscription
isRecoveryRequired
in class AbstractSubscription
org.apache.activemq.region.cursors.PendingMessageCursor
public void optimizePrefetch()
public void add(ConnectionContext context, Destination destination) throws java.lang.Exception
Subscription
add
in interface Subscription
add
in class AbstractSubscription
java.lang.Exception
public void remove(ConnectionContext context, Destination destination) throws java.lang.Exception
Subscription
remove
in interface Subscription
remove
in class AbstractSubscription
java.lang.Exception
protected void dispatchMatched() throws java.io.IOException
java.io.IOException
protected boolean dispatch(MessageReference node) throws java.io.IOException
java.io.IOException
protected void onDispatch(MessageReference node, Message message)
public void updateConsumerPrefetch(int newPrefetch)
newPrefetch
- protected MessageDispatch createMessageDispatch(MessageReference node, Message message)
node
- message
-
protected abstract boolean canDispatch(MessageReference node) throws java.io.IOException
node
-
java.io.IOException
protected void acknowledge(ConnectionContext context, MessageAck ack, MessageReference node) throws java.io.IOException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |