org.openorb.notify.queue

Class DefaultEventQueue

public class DefaultEventQueue extends Object implements EventQueue

An event queue is an object into which events are pushed and pulled. Pushing an event is adding an event to this queue, pulling an event is retrieving an event from this queue. Events in the queue can be either Untyped, Structured, StructuredSequence and Type events. This event queue implementation provides three orderers. These are Fifo, Priority and Deadline.

Author: Olivier Modica

Constructor Summary
DefaultEventQueue()
Default constructor with a Fifo order policy
DefaultEventQueue(int orderPolicy)
Constructor with specified order policy
Method Summary
intgetQueueSize()
Indicate if the event queue is empty
booleanisEmpty()
Indicate if the event queue is empty
ObjectpullEvent()
Pull an event from the queue
booleanpushEvent(Object event)
Push an event into the queue
booleanpushEvent(Object event, Short priorityKey, Long deadlineKey)
Push an event into the queue
voidsetOrderPolicy(int orderPolicy)
Set the event queue order policy

Constructor Detail

DefaultEventQueue

public DefaultEventQueue()
Default constructor with a Fifo order policy

DefaultEventQueue

public DefaultEventQueue(int orderPolicy)
Constructor with specified order policy

Method Detail

getQueueSize

public int getQueueSize()
Indicate if the event queue is empty

isEmpty

public boolean isEmpty()
Indicate if the event queue is empty

pullEvent

public Object pullEvent()
Pull an event from the queue

pushEvent

public boolean pushEvent(Object event)
Push an event into the queue

pushEvent

public boolean pushEvent(Object event, Short priorityKey, Long deadlineKey)
Push an event into the queue

setOrderPolicy

public void setOrderPolicy(int orderPolicy)
Set the event queue order policy