Package org.apache.activemq
Class SimplePriorityMessageDispatchChannel
java.lang.Object
org.apache.activemq.SimplePriorityMessageDispatchChannel
- All Implemented Interfaces:
MessageDispatchChannel
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()voidclose()dequeue(long timeout) Used to get an enqueued message.voidenqueue(MessageDispatch message) voidenqueueFirst(MessageDispatch message) protected LinkedList<MessageDispatch>getMutex()protected intgetPriority(MessageDispatch message) booleanisClosed()booleanisEmpty()booleanpeek()intsize()voidstart()voidstop()toString()
-
Constructor Details
-
SimplePriorityMessageDispatchChannel
public SimplePriorityMessageDispatchChannel()
-
-
Method Details
-
enqueue
- Specified by:
enqueuein interfaceMessageDispatchChannel
-
enqueueFirst
- Specified by:
enqueueFirstin interfaceMessageDispatchChannel
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceMessageDispatchChannel
-
dequeue
Description copied from interface:MessageDispatchChannelUsed to get an enqueued message. The amount of time this method blocks is based on the timeout value. - if timeout==-1 then it blocks until a message is received. - if timeout==0 then it it tries to not block at all, it returns a message if it is available - if timeout>0 then it blocks up to timeout amount of time. Expired messages will consumed by this method.- Specified by:
dequeuein interfaceMessageDispatchChannel- Returns:
- null if we timeout or if the consumer is closed.
- Throws:
InterruptedException
-
dequeueNoWait
- Specified by:
dequeueNoWaitin interfaceMessageDispatchChannel
-
peek
- Specified by:
peekin interfaceMessageDispatchChannel
-
start
public void start()- Specified by:
startin interfaceMessageDispatchChannel
-
stop
public void stop()- Specified by:
stopin interfaceMessageDispatchChannel
-
close
public void close()- Specified by:
closein interfaceMessageDispatchChannel
-
clear
public void clear()- Specified by:
clearin interfaceMessageDispatchChannel
-
isClosed
public boolean isClosed()- Specified by:
isClosedin interfaceMessageDispatchChannel
-
size
public int size()- Specified by:
sizein interfaceMessageDispatchChannel
-
getMutex
- Specified by:
getMutexin interfaceMessageDispatchChannel
-
isRunning
public boolean isRunning()- Specified by:
isRunningin interfaceMessageDispatchChannel
-
removeAll
- Specified by:
removeAllin interfaceMessageDispatchChannel
-
toString
-
getPriority
-
getList
-