org.openorb.notify.queue
Class DefaultEventQueue

java.lang.Object
  |
  +--org.openorb.notify.queue.DefaultEventQueue
All Implemented Interfaces:
EventQueue
Direct Known Subclasses:
AdminQueue, ConsumerProxyQueue, DefaultFilterableEventQueue, SupplierProxyQueue

public class DefaultEventQueue
extends java.lang.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
 int getQueueSize()
          Indicate if the event queue is empty
 boolean isEmpty()
          Indicate if the event queue is empty
 java.lang.Object pullEvent()
          Pull an event from the queue
 boolean pushEvent(java.lang.Object event)
          Push an event into the queue
 boolean pushEvent(java.lang.Object event, java.lang.Short priorityKey, java.lang.Long deadlineKey)
          Push an event into the queue
 void setOrderPolicy(int orderPolicy)
          Set the event queue order policy
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultEventQueue

public DefaultEventQueue()
Default constructor with a Fifo order policy

DefaultEventQueue

public DefaultEventQueue(int orderPolicy)
Constructor with specified order policy
Method Detail

setOrderPolicy

public void setOrderPolicy(int orderPolicy)
Set the event queue order policy
Specified by:
setOrderPolicy in interface EventQueue

pushEvent

public boolean pushEvent(java.lang.Object event)
Push an event into the queue
Specified by:
pushEvent in interface EventQueue

pushEvent

public boolean pushEvent(java.lang.Object event,
                         java.lang.Short priorityKey,
                         java.lang.Long deadlineKey)
Push an event into the queue
Specified by:
pushEvent in interface EventQueue

pullEvent

public java.lang.Object pullEvent()
Pull an event from the queue
Specified by:
pullEvent in interface EventQueue

getQueueSize

public int getQueueSize()
Indicate if the event queue is empty
Specified by:
getQueueSize in interface EventQueue

isEmpty

public boolean isEmpty()
Indicate if the event queue is empty
Specified by:
isEmpty in interface EventQueue