public abstract class AbstractBoundedEventQueue extends Object implements MessageQueue
MessageQueue.DiscardListener
Modifier | Constructor and Description |
---|---|
protected |
AbstractBoundedEventQueue(int capacity,
EventQueueOverflowStrategy overflowStrategy,
Object lock) |
Modifier and Type | Method and Description |
---|---|
void |
addDiscardListener(MessageQueue.DiscardListener listener) |
protected abstract void |
addElement(Message message) |
protected abstract Message[] |
getAllElements() |
Message[] |
getAllMessages(boolean wait)
get all Messages from this queue.
|
String |
getDiscardPolicyName() |
protected abstract Message |
getEarliestTimeout() |
protected abstract Message[] |
getElements(int max) |
protected abstract Message |
getLeastPriority() |
Message |
getMessage(boolean wait)
get the next Message from this queue.
|
Message[] |
getMessages(int max,
boolean wait)
get up to
n events from this queue. |
protected abstract Message |
getNextElement() |
protected abstract Message |
getOldestElement() |
abstract String |
getOrderPolicyName() |
protected abstract Message |
getYoungestElement() |
void |
put(Message event)
put a Message into this queue.
|
void |
removeDiscardListener(MessageQueue.DiscardListener listener) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getSize, isEmpty
protected AbstractBoundedEventQueue(int capacity, EventQueueOverflowStrategy overflowStrategy, Object lock)
public final String getDiscardPolicyName()
getDiscardPolicyName
in interface MessageQueue
protected abstract Message getEarliestTimeout()
protected abstract Message getLeastPriority()
protected abstract Message getNextElement()
protected abstract Message getOldestElement()
protected abstract Message getYoungestElement()
protected abstract Message[] getElements(int max)
protected abstract void addElement(Message message)
protected abstract Message[] getAllElements()
public abstract String getOrderPolicyName()
getOrderPolicyName
in interface MessageQueue
public Message[] getAllMessages(boolean wait) throws InterruptedException
MessageQueue
getAllMessages
in interface MessageQueue
wait
- a boolean
value. If this parameter is
set to true the queue will block until an element is
available. If the parameter is set to false the queue will
return null in case it is empty.InterruptedException
public Message getMessage(boolean wait) throws InterruptedException
MessageQueue
getMessage
in interface MessageQueue
wait
- a boolean
value. If this parameter is
set to true the queue will block until an element is
available. If the parameter is set to false the queue will
return null in case it is empty.InterruptedException
public Message[] getMessages(int max, boolean wait) throws InterruptedException
MessageQueue
n
events from this queue.getMessages
in interface MessageQueue
max
- number of requested messageswait
- a boolean
value. If this parameter is
set to true the queue will block until an element is
available. If the parameter is set to false the queue will
return null in case it is empty.InterruptedException
public void put(Message event)
MessageQueue
put
in interface MessageQueue
public void addDiscardListener(MessageQueue.DiscardListener listener)
addDiscardListener
in interface MessageQueue
public void removeDiscardListener(MessageQueue.DiscardListener listener)
removeDiscardListener
in interface MessageQueue
Copyright © 2017 JacORB. All rights reserved.