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

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

public class ElementEventQueue
extends Object
implements IElementEventQueue

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


Constructor Summary
ElementEventQueue(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 empty.
 int getWaitToDieMillis()
          Returns the time to wait for events before killing the background thread.
 boolean isAlive()
          Gets the alive attribute of the IElementEventQueue object
 void setWaitToDieMillis(int wtdm)
          Sets the time to wait for events before killing the background thread.
 int size()
          Returns the number of elements in the queue.
 void stopProcessing()
          Kill the processor thread and indicate that the queue is detroyed and no longer alive, but it can still be working.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ElementEventQueue

public ElementEventQueue(String cacheName)
Constructor for the ElementEventQueue object

Parameters:
cacheName -
Method Detail

destroy

public void destroy()
Event Q is empty.

Specified by:
destroy in interface IElementEventQueue

stopProcessing

public void stopProcessing()
Kill the processor thread and indicate that the queue is detroyed and no longer alive, but it can still be working.


getWaitToDieMillis

public int getWaitToDieMillis()
Returns the time to wait for events before killing the background thread.

Returns:
int

setWaitToDieMillis

public void setWaitToDieMillis(int wtdm)
Sets the time to wait for events before killing the background thread.

Parameters:
wtdm - the ms for the q to sit idle.

toString

public String toString()
Overrides:
toString in class Object
Returns:
the region name for the event queue

size

public int size()
Returns the number of elements in the queue.

Returns:
number of items in the 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 IOException
Adds an ElementEvent to be handled

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


Copyright © 2002-2012 Apache Software Foundation. All Rights Reserved.