Package org.apache.activemq
Interface MessageDispatchChannel
-
- All Known Implementing Classes:
FifoMessageDispatchChannel,SimplePriorityMessageDispatchChannel
public interface MessageDispatchChannel
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclear()voidclose()MessageDispatchdequeue(long timeout)Used to get an enqueued message.MessageDispatchdequeueNoWait()voidenqueue(MessageDispatch message)voidenqueueFirst(MessageDispatch message)ObjectgetMutex()booleanisClosed()booleanisEmpty()booleanisRunning()MessageDispatchpeek()List<MessageDispatch>removeAll()intsize()voidstart()voidstop()
-
-
-
Method Detail
-
enqueue
void enqueue(MessageDispatch message)
-
enqueueFirst
void enqueueFirst(MessageDispatch message)
-
isEmpty
boolean isEmpty()
-
dequeue
MessageDispatch dequeue(long timeout) throws InterruptedException
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.- Returns:
- null if we timeout or if the consumer is closed.
- Throws:
JMSExceptionInterruptedException
-
dequeueNoWait
MessageDispatch dequeueNoWait()
-
peek
MessageDispatch peek()
-
start
void start()
-
stop
void stop()
-
close
void close()
-
clear
void clear()
-
isClosed
boolean isClosed()
-
size
int size()
-
getMutex
Object getMutex()
-
isRunning
boolean isRunning()
-
removeAll
List<MessageDispatch> removeAll()
-
-