org.apache.jcs.engine.control.event
Class ElementEventQueue

java.lang.Object
  extended byorg.apache.jcs.engine.control.event.ElementEventQueue
All Implemented Interfaces:
IElementEventQueue

public class ElementEventQueue
extends java.lang.Object
implements IElementEventQueue

An event queue is used to propagate ordered cache events to one and only one target listener.


Nested Class Summary
private  class ElementEventQueue.AbstractElementEventRunner
          Retries before declaring failure.
private  class ElementEventQueue.ElementEventRunner
           
private static class ElementEventQueue.Node
           
private  class ElementEventQueue.QProcessor
           
 
Field Summary
private  java.lang.String cacheName
           
private  boolean destroyed
           
private  ElementEventQueue.Node head
           
private static org.apache.commons.logging.Log log
           
private static int processorInstanceCount
           
private  java.lang.Object queueLock
           
private  java.lang.Thread t
           
private  ElementEventQueue.Node tail
           
 
Constructor Summary
ElementEventQueue(java.lang.String cacheName)
          Constructor for the ElementEventQueue object
 
Method Summary
 void addElementEvent(IElementEventHandler hand, IElementEvent event)
          Adds an ElementEvent to be handled
 void destroy()
          Event Q is emtpy.
 boolean isAlive()
          Gets the alive attribute of the IElementEventQueue object
private  void put(ElementEventQueue.AbstractElementEventRunner event)
          Adds an event to the queue.
private  ElementEventQueue.AbstractElementEventRunner take()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

private static final org.apache.commons.logging.Log log

processorInstanceCount

private static int processorInstanceCount

cacheName

private java.lang.String cacheName

destroyed

private boolean destroyed

t

private java.lang.Thread t

queueLock

private java.lang.Object queueLock

head

private ElementEventQueue.Node head

tail

private ElementEventQueue.Node tail
Constructor Detail

ElementEventQueue

public ElementEventQueue(java.lang.String cacheName)
Constructor for the ElementEventQueue object

Parameters:
cacheName -
Method Detail

destroy

public void destroy()
Event Q is emtpy.

Specified by:
destroy in interface IElementEventQueue

toString

public java.lang.String toString()
Returns:
the region name for the event queue

isAlive

public boolean isAlive()
Description copied from interface: IElementEventQueue
Gets the alive attribute of the IElementEventQueue object

Specified by:
isAlive in interface IElementEventQueue
Returns:
The destroyed value

addElementEvent

public void addElementEvent(IElementEventHandler hand,
                            IElementEvent event)
                     throws java.io.IOException
Adds an ElementEvent to be handled

Specified by:
addElementEvent in interface IElementEventQueue
Parameters:
hand - The IElementEventHandler
event - The IElementEventHandler IElementEvent event
Throws:
java.io.IOException

put

private void put(ElementEventQueue.AbstractElementEventRunner event)
Adds an event to the queue.

Parameters:
event -

take

private ElementEventQueue.AbstractElementEventRunner take()
                                                   throws java.lang.InterruptedException
Throws:
java.lang.InterruptedException