|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.activemq.broker.region.BaseDestination
org.apache.activemq.broker.region.Queue
public class Queue
The Queue is a List of MessageEntry objects that are dispatched to matching subscriptions.
Field Summary | |
---|---|
protected List<Subscription> |
consumers
|
protected static Log |
LOG
|
protected PendingMessageCursor |
messages
|
protected Map<MessageId,Runnable> |
messagesWaitingForSpace
|
protected TaskRunnerFactory |
taskFactory
|
protected TaskRunner |
taskRunner
|
Fields inherited from class org.apache.activemq.broker.region.BaseDestination |
---|
blockedProducerWarningInterval, broker, brokerService, cursorMemoryHighWaterMark, deadLetterStrategy, destination, destinationStatistics, EXPIRE_MESSAGE_PERIOD, expireMessagesPeriod, MAX_BROWSE_PAGE_SIZE, MAX_PAGE_SIZE, memoryUsage, regionBroker, store, systemUsage, warnOnProducerFlowControl |
Fields inherited from interface org.apache.activemq.broker.region.Destination |
---|
DEFAULT_BLOCKED_PRODUCER_WARNING_INTERVAL, DEFAULT_DEAD_LETTER_STRATEGY |
Constructor Summary | |
---|---|
Queue(BrokerService brokerService,
ActiveMQDestination destination,
MessageStore store,
DestinationStatistics parentStats,
TaskRunnerFactory taskFactory)
|
Method Summary | |
---|---|
void |
acknowledge(ConnectionContext context,
Subscription sub,
MessageAck ack,
MessageReference node)
|
void |
addSubscription(ConnectionContext context,
Subscription sub)
|
Message[] |
browse()
|
int |
copyMatchingMessages(ConnectionContext context,
MessageReferenceFilter filter,
ActiveMQDestination dest,
int maximumMessages)
Copies the messages matching the given filter up to the maximum number of matched messages |
int |
copyMatchingMessagesTo(ConnectionContext context,
String selector,
ActiveMQDestination dest)
Copies the messages matching the given selector |
int |
copyMatchingMessagesTo(ConnectionContext context,
String selector,
ActiveMQDestination dest,
int maximumMessages)
Copies the messages matching the given selector up to the maximum number of matched messages |
boolean |
copyMessageTo(ConnectionContext context,
String messageId,
ActiveMQDestination dest)
Copies the message matching the given messageId |
protected ConnectionContext |
createConnectionContext()
|
protected MessageReferenceFilter |
createMessageIdFilter(String messageId)
|
protected MessageReferenceFilter |
createSelectorFilter(String selector)
|
void |
doBrowse(List<Message> browseList,
int max)
|
void |
gc()
|
ActiveMQDestination |
getActiveMQDestination()
|
List<Subscription> |
getConsumers()
|
int |
getConsumersBeforeDispatchStarts()
|
DispatchPolicy |
getDispatchPolicy()
|
Message |
getMessage(String id)
|
MessageGroupMapFactory |
getMessageGroupMapFactory()
|
MessageGroupMap |
getMessageGroupOwners()
|
PendingMessageCursor |
getMessages()
|
int |
getTimeBeforeDispatchStarts()
|
void |
initialize()
initialize the destination |
boolean |
isOptimizedDispatch()
|
boolean |
isStrictOrderDispatch()
|
boolean |
isUseConsumerPriority()
|
boolean |
iterate()
|
void |
messageExpired(ConnectionContext context,
MessageReference reference)
|
void |
messageExpired(ConnectionContext context,
Subscription subs,
MessageReference reference)
Inform the Destination a message has expired |
int |
moveMatchingMessagesTo(ConnectionContext context,
MessageReferenceFilter filter,
ActiveMQDestination dest,
int maximumMessages)
Moves the messages matching the given filter up to the maximum number of matched messages |
int |
moveMatchingMessagesTo(ConnectionContext context,
String selector,
ActiveMQDestination dest)
Moves the messages matching the given selector |
int |
moveMatchingMessagesTo(ConnectionContext context,
String selector,
ActiveMQDestination dest,
int maximumMessages)
Moves the messages matching the given selector up to the maximum number of matched messages |
boolean |
moveMessageTo(ConnectionContext context,
Message m,
ActiveMQDestination dest)
Move a message |
boolean |
moveMessageTo(ConnectionContext context,
String messageId,
ActiveMQDestination dest)
Moves the message matching the given messageId |
void |
onUsageChanged(Usage usage,
int oldPercentUsage,
int newPercentUsage)
|
protected void |
pageInMessages(boolean force)
|
void |
processDispatchNotification(MessageDispatchNotification messageDispatchNotification)
called on Queues in slave mode to allow dispatch to follow subscription choice of master |
void |
purge()
|
int |
removeMatchingMessages(MessageReferenceFilter filter,
int maximumMessages)
Removes the messages matching the given filter up to the maximum number of matched messages |
int |
removeMatchingMessages(String selector)
Removes the messages matching the given selector |
int |
removeMatchingMessages(String selector,
int maximumMessages)
Removes the messages matching the given selector up to the maximum number of matched messages |
protected void |
removeMessage(ConnectionContext c,
QueueMessageReference r)
|
protected void |
removeMessage(ConnectionContext c,
Subscription subs,
QueueMessageReference r)
|
protected void |
removeMessage(ConnectionContext context,
Subscription sub,
QueueMessageReference reference,
MessageAck ack)
|
boolean |
removeMessage(String messageId)
Removes the message matching the given messageId |
void |
removeSubscription(ConnectionContext context,
Subscription sub,
long lastDeiveredSequenceId)
|
void |
send(ProducerBrokerExchange producerExchange,
Message message)
|
void |
setConsumersBeforeDispatchStarts(int consumersBeforeDispatchStarts)
|
void |
setDispatchPolicy(DispatchPolicy dispatchPolicy)
|
void |
setMessageGroupMapFactory(MessageGroupMapFactory messageGroupMapFactory)
|
void |
setMessages(PendingMessageCursor messages)
|
void |
setOptimizedDispatch(boolean optimizedDispatch)
|
void |
setStrictOrderDispatch(boolean strictOrderDispatch)
|
void |
setTimeBeforeDispatchStarts(int timeBeforeDispatchStarts)
|
void |
setUseConsumerPriority(boolean useConsumerPriority)
|
void |
start()
|
void |
stop()
|
String |
toString()
|
void |
wakeup()
optionally called by a Subscriber - to inform the Destination its ready for more messages |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final Log LOG
protected final TaskRunnerFactory taskFactory
protected TaskRunner taskRunner
protected final List<Subscription> consumers
protected PendingMessageCursor messages
protected final Map<MessageId,Runnable> messagesWaitingForSpace
Constructor Detail |
---|
public Queue(BrokerService brokerService, ActiveMQDestination destination, MessageStore store, DestinationStatistics parentStats, TaskRunnerFactory taskFactory) throws Exception
Exception
Method Detail |
---|
public List<Subscription> getConsumers()
getConsumers
in interface Destination
public void initialize() throws Exception
BaseDestination
initialize
in class BaseDestination
Exception
public void addSubscription(ConnectionContext context, Subscription sub) throws Exception
addSubscription
in interface Destination
Exception
public void removeSubscription(ConnectionContext context, Subscription sub, long lastDeiveredSequenceId) throws Exception
removeSubscription
in interface Destination
Exception
public void send(ProducerBrokerExchange producerExchange, Message message) throws Exception
send
in interface Destination
Exception
public void gc()
gc
in interface Destination
public void acknowledge(ConnectionContext context, Subscription sub, MessageAck ack, MessageReference node) throws IOException
acknowledge
in interface Destination
IOException
public String toString()
toString
in class Object
public void start() throws Exception
start
in interface Service
Exception
public void stop() throws Exception
stop
in interface Service
Exception
public ActiveMQDestination getActiveMQDestination()
getActiveMQDestination
in interface Destination
getActiveMQDestination
in class BaseDestination
public MessageGroupMap getMessageGroupOwners()
public DispatchPolicy getDispatchPolicy()
public void setDispatchPolicy(DispatchPolicy dispatchPolicy)
public MessageGroupMapFactory getMessageGroupMapFactory()
public void setMessageGroupMapFactory(MessageGroupMapFactory messageGroupMapFactory)
public PendingMessageCursor getMessages()
public void setMessages(PendingMessageCursor messages)
public boolean isUseConsumerPriority()
public void setUseConsumerPriority(boolean useConsumerPriority)
public boolean isStrictOrderDispatch()
public void setStrictOrderDispatch(boolean strictOrderDispatch)
public boolean isOptimizedDispatch()
public void setOptimizedDispatch(boolean optimizedDispatch)
public int getTimeBeforeDispatchStarts()
public void setTimeBeforeDispatchStarts(int timeBeforeDispatchStarts)
public int getConsumersBeforeDispatchStarts()
public void setConsumersBeforeDispatchStarts(int consumersBeforeDispatchStarts)
public Message[] browse()
browse
in interface Destination
public void doBrowse(List<Message> browseList, int max)
public Message getMessage(String id)
public void purge() throws Exception
Exception
public boolean removeMessage(String messageId) throws Exception
Exception
public int removeMatchingMessages(String selector) throws Exception
Exception
public int removeMatchingMessages(String selector, int maximumMessages) throws Exception
Exception
public int removeMatchingMessages(MessageReferenceFilter filter, int maximumMessages) throws Exception
Exception
public boolean copyMessageTo(ConnectionContext context, String messageId, ActiveMQDestination dest) throws Exception
Exception
public int copyMatchingMessagesTo(ConnectionContext context, String selector, ActiveMQDestination dest) throws Exception
Exception
public int copyMatchingMessagesTo(ConnectionContext context, String selector, ActiveMQDestination dest, int maximumMessages) throws Exception
Exception
public int copyMatchingMessages(ConnectionContext context, MessageReferenceFilter filter, ActiveMQDestination dest, int maximumMessages) throws Exception
Exception
public boolean moveMessageTo(ConnectionContext context, Message m, ActiveMQDestination dest) throws Exception
context
- connection contextm
- messagedest
- ActiveMQDestination
Exception
public boolean moveMessageTo(ConnectionContext context, String messageId, ActiveMQDestination dest) throws Exception
Exception
public int moveMatchingMessagesTo(ConnectionContext context, String selector, ActiveMQDestination dest) throws Exception
Exception
public int moveMatchingMessagesTo(ConnectionContext context, String selector, ActiveMQDestination dest, int maximumMessages) throws Exception
Exception
public int moveMatchingMessagesTo(ConnectionContext context, MessageReferenceFilter filter, ActiveMQDestination dest, int maximumMessages) throws Exception
Exception
public boolean iterate()
iterate
in interface Task
Task.iterate()
protected MessageReferenceFilter createMessageIdFilter(String messageId)
protected MessageReferenceFilter createSelectorFilter(String selector) throws InvalidSelectorException
InvalidSelectorException
protected void removeMessage(ConnectionContext c, QueueMessageReference r) throws IOException
IOException
protected void removeMessage(ConnectionContext c, Subscription subs, QueueMessageReference r) throws IOException
IOException
protected void removeMessage(ConnectionContext context, Subscription sub, QueueMessageReference reference, MessageAck ack) throws IOException
IOException
public void messageExpired(ConnectionContext context, MessageReference reference)
public void messageExpired(ConnectionContext context, Subscription subs, MessageReference reference)
Destination
messageExpired
in interface Destination
protected ConnectionContext createConnectionContext()
public void wakeup()
Destination
wakeup
in interface Destination
protected void pageInMessages(boolean force) throws Exception
Exception
public void processDispatchNotification(MessageDispatchNotification messageDispatchNotification) throws Exception
Destination
processDispatchNotification
in interface Destination
processDispatchNotification
in class BaseDestination
Exception
public void onUsageChanged(Usage usage, int oldPercentUsage, int newPercentUsage)
onUsageChanged
in interface UsageListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |