public abstract class PrefetchSubscription extends AbstractSubscription
| Modifier and Type | Field and Description |
|---|---|
protected long |
dequeueCounter |
protected long |
dispatchCounter |
protected java.util.List<MessageReference> |
dispatched |
protected java.lang.Object |
dispatchLock |
protected long |
enqueueCounter |
protected PendingMessageCursor |
pending |
protected java.lang.Object |
pendingLock |
protected java.util.concurrent.atomic.AtomicInteger |
prefetchExtension |
protected Scheduler |
scheduler |
protected SystemUsage |
usageManager |
protected boolean |
usePrefetchExtension |
broker, context, destinationFilter, destinations, info| Constructor and Description |
|---|
PrefetchSubscription(Broker broker,
SystemUsage usageManager,
ConnectionContext context,
ConsumerInfo info) |
PrefetchSubscription(Broker broker,
SystemUsage usageManager,
ConnectionContext context,
ConsumerInfo info,
PendingMessageCursor cursor) |
| Modifier and Type | Method and Description |
|---|---|
void |
acknowledge(ConnectionContext context,
MessageAck ack)
Used when client acknowledge receipt of dispatched message.
|
protected abstract 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 void |
assertAckMatchesDispatched(MessageAck ack)
Checks an ack versus the contents of the dispatched list.
|
protected abstract boolean |
canDispatch(MessageReference node)
Use when a matched message is about to be dispatched to the client.
|
int |
countBeforeFull() |
protected MessageDispatch |
createMessageDispatch(MessageReference node,
Message message) |
protected boolean |
dispatch(MessageReference node) |
protected void |
dispatchPending() |
long |
getDequeueCounter() |
long |
getDispatchedCounter() |
int |
getDispatchedQueueSize() |
long |
getEnqueueCounter() |
int |
getInFlightSize() |
int |
getMaxAuditDepth() |
int |
getMaxProducersToAudit() |
PendingMessageCursor |
getPending() |
int |
getPendingQueueSize() |
protected int |
getPrefetchExtension() |
protected abstract boolean |
isDropped(MessageReference node) |
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.
|
boolean |
isUsePrefetchExtension() |
protected void |
onDispatch(MessageReference node,
Message message) |
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
|
java.util.List<MessageReference> |
remove(ConnectionContext context,
Destination destination)
The subscription will be no longer be receiving messages from the destination.
|
java.util.List<MessageReference> |
remove(ConnectionContext context,
Destination destination,
java.util.List<MessageReference> dispatched) |
protected void |
sendToDLQ(ConnectionContext context,
MessageReference node,
java.lang.Throwable poisonCause) |
void |
setMaxAuditDepth(int maxAuditDepth) |
void |
setMaxProducersToAudit(int maxProducersToAudit) |
void |
setPending(PendingMessageCursor pending) |
protected void |
setPendingBatchSize(PendingMessageCursor pending,
int numberToDispatch) |
void |
setPrefetchSize(int prefetchSize) |
void |
setUsePrefetchExtension(boolean usePrefetchExtension) |
void |
updateConsumerPrefetch(int newPrefetch)
inform the MessageConsumer on the client to change it's prefetch
|
addDestination, addRecoveredMessage, doAddRecoveredMessage, gc, getActiveMQDestination, getConsumedCount, getConsumerInfo, getContext, getCursorMemoryHighWaterMark, getInFlightUsage, getInfo, getObjectName, getPrefetchSize, getSelector, getSelectorExpression, getTimeOfLastMessageAck, incrementConsumedCount, isBrowser, isSlowConsumer, matches, matches, removeDestination, resetConsumedCount, setCursorMemoryHighWaterMark, setObjectName, setSelector, setSlowConsumer, setTimeOfLastMessageAck, unmatchedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdestroyprotected final Scheduler scheduler
protected PendingMessageCursor pending
protected final java.util.List<MessageReference> dispatched
protected final java.util.concurrent.atomic.AtomicInteger prefetchExtension
protected boolean usePrefetchExtension
protected long enqueueCounter
protected long dispatchCounter
protected long dequeueCounter
protected final SystemUsage usageManager
protected final java.lang.Object pendingLock
protected final java.lang.Object dispatchLock
public PrefetchSubscription(Broker broker, SystemUsage usageManager, ConnectionContext context, ConsumerInfo info, PendingMessageCursor cursor) throws javax.jms.JMSException
javax.jms.JMSExceptionpublic PrefetchSubscription(Broker broker, SystemUsage usageManager, ConnectionContext context, ConsumerInfo info) throws javax.jms.JMSException
javax.jms.JMSExceptionpublic Response pullMessage(ConnectionContext context, MessagePull pull) throws java.lang.Exception
java.lang.Exceptionpublic void add(MessageReference node) throws java.lang.Exception
Subscriptionjava.lang.Exceptionjava.lang.InterruptedExceptionjava.io.IOExceptionpublic void processMessageDispatchNotification(MessageDispatchNotification mdn) throws java.lang.Exception
Subscriptionjava.lang.Exceptionpublic final void acknowledge(ConnectionContext context, MessageAck ack) throws java.lang.Exception
Subscriptionacknowledge in interface Subscriptionacknowledge in class AbstractSubscriptionjava.io.IOExceptionjava.lang.Exceptionprotected void assertAckMatchesDispatched(MessageAck ack) throws javax.jms.JMSException
ack - javax.jms.JMSException - if it does not matchprotected void sendToDLQ(ConnectionContext context, MessageReference node, java.lang.Throwable poisonCause) throws java.io.IOException, java.lang.Exception
context - node - poisonCause - java.io.IOExceptionjava.lang.Exceptionpublic int getInFlightSize()
public boolean isFull()
public boolean isLowWaterMark()
public boolean isHighWaterMark()
public int countBeforeFull()
countBeforeFull in interface SubscriptioncountBeforeFull in class AbstractSubscriptionpublic int getPendingQueueSize()
public int getDispatchedQueueSize()
public long getDequeueCounter()
public long getDispatchedCounter()
public long getEnqueueCounter()
public boolean isRecoveryRequired()
SubscriptionisRecoveryRequired in interface SubscriptionisRecoveryRequired in class AbstractSubscriptionPendingMessageCursorpublic PendingMessageCursor getPending()
public void setPending(PendingMessageCursor pending)
public void add(ConnectionContext context, Destination destination) throws java.lang.Exception
Subscriptionadd in interface Subscriptionadd in class AbstractSubscriptionjava.lang.Exceptionpublic java.util.List<MessageReference> remove(ConnectionContext context, Destination destination) throws java.lang.Exception
Subscriptionremove in interface Subscriptionremove in class AbstractSubscriptionjava.lang.Exceptionpublic java.util.List<MessageReference> remove(ConnectionContext context, Destination destination, java.util.List<MessageReference> dispatched) throws java.lang.Exception
java.lang.Exceptionprotected void dispatchPending()
throws java.io.IOException
java.io.IOExceptionprotected void setPendingBatchSize(PendingMessageCursor pending, int numberToDispatch)
protected boolean dispatch(MessageReference node) throws java.io.IOException
java.io.IOExceptionprotected 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.IOExceptionprotected abstract boolean isDropped(MessageReference node)
protected abstract void acknowledge(ConnectionContext context, MessageAck ack, MessageReference node) throws java.io.IOException
java.io.IOExceptionpublic int getMaxProducersToAudit()
public void setMaxProducersToAudit(int maxProducersToAudit)
public int getMaxAuditDepth()
public void setMaxAuditDepth(int maxAuditDepth)
public boolean isUsePrefetchExtension()
public void setUsePrefetchExtension(boolean usePrefetchExtension)
protected int getPrefetchExtension()
public void setPrefetchSize(int prefetchSize)
setPrefetchSize in class AbstractSubscriptionCopyright © 2005-2014 Red Hat, Inc.. All Rights Reserved.