org.apache.activemq
Class FifoMessageDispatchChannel
java.lang.Object
org.apache.activemq.FifoMessageDispatchChannel
- All Implemented Interfaces:
- MessageDispatchChannel
public class FifoMessageDispatchChannel
- extends java.lang.Object
- implements MessageDispatchChannel
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
FifoMessageDispatchChannel
public FifoMessageDispatchChannel()
enqueue
public void enqueue(MessageDispatch message)
- Specified by:
enqueue
in interface MessageDispatchChannel
enqueueFirst
public void enqueueFirst(MessageDispatch message)
- Specified by:
enqueueFirst
in interface MessageDispatchChannel
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interface MessageDispatchChannel
dequeue
public MessageDispatch dequeue(long timeout)
throws java.lang.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 interface MessageDispatchChannel
- Returns:
- null if we timeout or if the consumer is closed.
- Throws:
java.lang.InterruptedException
dequeueNoWait
public MessageDispatch dequeueNoWait()
- Specified by:
dequeueNoWait
in interface MessageDispatchChannel
peek
public MessageDispatch peek()
- Specified by:
peek
in interface MessageDispatchChannel
start
public void start()
- Specified by:
start
in interface MessageDispatchChannel
stop
public void stop()
- Specified by:
stop
in interface MessageDispatchChannel
close
public void close()
- Specified by:
close
in interface MessageDispatchChannel
clear
public void clear()
- Specified by:
clear
in interface MessageDispatchChannel
isClosed
public boolean isClosed()
- Specified by:
isClosed
in interface MessageDispatchChannel
size
public int size()
- Specified by:
size
in interface MessageDispatchChannel
getMutex
public java.lang.Object getMutex()
- Specified by:
getMutex
in interface MessageDispatchChannel
isRunning
public boolean isRunning()
- Specified by:
isRunning
in interface MessageDispatchChannel
removeAll
public java.util.List<MessageDispatch> removeAll()
- Specified by:
removeAll
in interface MessageDispatchChannel
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
Copyright © 2005-2012. All Rights Reserved.