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 void
clear()
void
close()
MessageDispatch
dequeue(long timeout)
Used to get an enqueued message.MessageDispatch
dequeueNoWait()
void
enqueue(MessageDispatch message)
void
enqueueFirst(MessageDispatch message)
Object
getMutex()
boolean
isClosed()
boolean
isEmpty()
boolean
isRunning()
MessageDispatch
peek()
List<MessageDispatch>
removeAll()
int
size()
void
start()
void
stop()
-
-
-
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:
JMSException
InterruptedException
-
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()
-
-