org.apache.activemq
Class SimplePriorityMessageDispatchChannel

java.lang.Object
  extended by org.apache.activemq.SimplePriorityMessageDispatchChannel
All Implemented Interfaces:
MessageDispatchChannel

public class SimplePriorityMessageDispatchChannel
extends Object
implements MessageDispatchChannel


Constructor Summary
SimplePriorityMessageDispatchChannel()
           
 
Method Summary
 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()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimplePriorityMessageDispatchChannel

public SimplePriorityMessageDispatchChannel()
Method Detail

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 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:
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 Object getMutex()
Specified by:
getMutex in interface MessageDispatchChannel

isRunning

public boolean isRunning()
Specified by:
isRunning in interface MessageDispatchChannel

removeAll

public List<MessageDispatch> removeAll()
Specified by:
removeAll in interface MessageDispatchChannel

toString

public String toString()
Overrides:
toString in class Object

getPriority

protected int getPriority(MessageDispatch message)

getList

protected LinkedList<MessageDispatch> getList(MessageDispatch md)


Copyright © 2005–2013 The Apache Software Foundation. All rights reserved.