Package org.apache.activemq
Class SimplePriorityMessageDispatchChannel
java.lang.Object
org.apache.activemq.SimplePriorityMessageDispatchChannel
- All Implemented Interfaces:
MessageDispatchChannel
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
void
close()
dequeue
(long timeout) Used to get an enqueued message.void
enqueue
(MessageDispatch message) void
enqueueFirst
(MessageDispatch message) protected LinkedList<MessageDispatch>
getMutex()
protected int
getPriority
(MessageDispatch message) boolean
isClosed()
boolean
isEmpty()
boolean
peek()
int
size()
void
start()
void
stop()
toString()
-
Constructor Details
-
SimplePriorityMessageDispatchChannel
public SimplePriorityMessageDispatchChannel()
-
-
Method Details
-
enqueue
- Specified by:
enqueue
in interfaceMessageDispatchChannel
-
enqueueFirst
- Specified by:
enqueueFirst
in interfaceMessageDispatchChannel
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceMessageDispatchChannel
-
dequeue
Description copied from interface:MessageDispatchChannel
Used 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:
dequeue
in interfaceMessageDispatchChannel
- Returns:
- null if we timeout or if the consumer is closed.
- Throws:
InterruptedException
-
dequeueNoWait
- Specified by:
dequeueNoWait
in interfaceMessageDispatchChannel
-
peek
- Specified by:
peek
in interfaceMessageDispatchChannel
-
start
public void start()- Specified by:
start
in interfaceMessageDispatchChannel
-
stop
public void stop()- Specified by:
stop
in interfaceMessageDispatchChannel
-
close
public void close()- Specified by:
close
in interfaceMessageDispatchChannel
-
clear
public void clear()- Specified by:
clear
in interfaceMessageDispatchChannel
-
isClosed
public boolean isClosed()- Specified by:
isClosed
in interfaceMessageDispatchChannel
-
size
public int size()- Specified by:
size
in interfaceMessageDispatchChannel
-
getMutex
- Specified by:
getMutex
in interfaceMessageDispatchChannel
-
isRunning
public boolean isRunning()- Specified by:
isRunning
in interfaceMessageDispatchChannel
-
removeAll
- Specified by:
removeAll
in interfaceMessageDispatchChannel
-
toString
-
getPriority
-
getList
-