Package org.apache.activemq
Class SimplePriorityMessageDispatchChannel
- java.lang.Object
-
- org.apache.activemq.SimplePriorityMessageDispatchChannel
-
- All Implemented Interfaces:
MessageDispatchChannel
public class SimplePriorityMessageDispatchChannel extends Object implements MessageDispatchChannel
-
-
Constructor Summary
Constructors Constructor Description SimplePriorityMessageDispatchChannel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
void
close()
MessageDispatch
dequeue(long timeout)
Used to get an enqueued message.MessageDispatch
dequeueNoWait()
void
enqueue(MessageDispatch message)
void
enqueueFirst(MessageDispatch message)
protected LinkedList<MessageDispatch>
getList(MessageDispatch md)
Object
getMutex()
protected int
getPriority(MessageDispatch message)
boolean
isClosed()
boolean
isEmpty()
boolean
isRunning()
MessageDispatch
peek()
List<MessageDispatch>
removeAll()
int
size()
void
start()
void
stop()
String
toString()
-
-
-
Method Detail
-
enqueue
public void enqueue(MessageDispatch message)
- Specified by:
enqueue
in interfaceMessageDispatchChannel
-
enqueueFirst
public void enqueueFirst(MessageDispatch message)
- Specified by:
enqueueFirst
in interfaceMessageDispatchChannel
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfaceMessageDispatchChannel
-
dequeue
public MessageDispatch dequeue(long timeout) throws InterruptedException
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
public MessageDispatch dequeueNoWait()
- Specified by:
dequeueNoWait
in interfaceMessageDispatchChannel
-
peek
public MessageDispatch 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
public Object getMutex()
- Specified by:
getMutex
in interfaceMessageDispatchChannel
-
isRunning
public boolean isRunning()
- Specified by:
isRunning
in interfaceMessageDispatchChannel
-
removeAll
public List<MessageDispatch> removeAll()
- Specified by:
removeAll
in interfaceMessageDispatchChannel
-
getPriority
protected int getPriority(MessageDispatch message)
-
getList
protected LinkedList<MessageDispatch> getList(MessageDispatch md)
-
-