org.apache.jcs.engine.behavior
Interface ICacheEventQueue

All Known Implementing Classes:
CacheEventQueue, PooledCacheEventQueue

public interface ICacheEventQueue

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


Field Summary
static int POOLED_QUEUE_TYPE
          Uses a thread pool
static int SINGLE_QUEUE_TYPE
          Does not use a thread pool.
 
Method Summary
 void addDisposeEvent()
          Adds a feature to the DisposeEvent attribute of the ICacheEventQueue object
 void addPutEvent(ICacheElement ce)
          Adds a feature to the PutEvent attribute of the ICacheEventQueue object
 void addRemoveAllEvent()
          Adds a feature to the RemoveAllEvent attribute of the ICacheEventQueue object
 void addRemoveEvent(java.io.Serializable key)
          Adds a feature to the RemoveEvent attribute of the ICacheEventQueue object
 void destroy()
          Description of the Method
 long getListenerId()
          Gets the listenerId attribute of the ICacheEventQueue object
 int getQueueType()
          Returnt he type of event queue we are using, either single or pooled.
 IStats getStatistics()
          Returns the historical and statistical data for an event queue cache.
 boolean isAlive()
          Gets the alive attribute of the ICacheEventQueue object.
 boolean isEmpty()
          Are there elements in the queue.
 boolean isWorking()
          A Queue is working unless it has reached its max failure count.
 

Field Detail

SINGLE_QUEUE_TYPE

public static final int SINGLE_QUEUE_TYPE
Does not use a thread pool.

See Also:
Constant Field Values

POOLED_QUEUE_TYPE

public static final int POOLED_QUEUE_TYPE
Uses a thread pool

See Also:
Constant Field Values
Method Detail

getQueueType

public int getQueueType()
Returnt he type of event queue we are using, either single or pooled.

Returns:

addPutEvent

public void addPutEvent(ICacheElement ce)
                 throws java.io.IOException
Adds a feature to the PutEvent attribute of the ICacheEventQueue object

Parameters:
ce - The feature to be added to the PutEvent attribute
Throws:
java.io.IOException

addRemoveEvent

public void addRemoveEvent(java.io.Serializable key)
                    throws java.io.IOException
Adds a feature to the RemoveEvent attribute of the ICacheEventQueue object

Parameters:
key - The feature to be added to the RemoveEvent attribute
Throws:
java.io.IOException

addRemoveAllEvent

public void addRemoveAllEvent()
                       throws java.io.IOException
Adds a feature to the RemoveAllEvent attribute of the ICacheEventQueue object

Throws:
java.io.IOException

addDisposeEvent

public void addDisposeEvent()
                     throws java.io.IOException
Adds a feature to the DisposeEvent attribute of the ICacheEventQueue object

Throws:
java.io.IOException

getListenerId

public long getListenerId()
Gets the listenerId attribute of the ICacheEventQueue object

Returns:
The listenerId value

destroy

public void destroy()
Description of the Method


isAlive

public boolean isAlive()
Gets the alive attribute of the ICacheEventQueue object. Alive just indicates that there are active threads. This is less important that if the queue is working.

Returns:
The alive value

isWorking

public boolean isWorking()
A Queue is working unless it has reached its max failure count.

Returns:
boolean

isEmpty

public boolean isEmpty()
Are there elements in the queue.

Returns:
true if there are stil elements.

getStatistics

public IStats getStatistics()
Returns the historical and statistical data for an event queue cache.

Returns:


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