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 java.lang.String POOLED_QUEUE_TYPE
          Uses a thread pool
static java.lang.String 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
 java.lang.String getQueueType()
          Return the type of event queue we are using, either single or pooled.
 IStats getStatistics()
          Returns the historical and statistical data for an event queue cache.
 void initialize(ICacheListener listener, long listenerId, java.lang.String cacheName, int maxFailure, int waitBeforeRetry, java.lang.String threadPoolName)
          Initializes the queue.
 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.
 int size()
          Returns the number of elements in the queue.
 

Field Detail

SINGLE_QUEUE_TYPE

static final java.lang.String SINGLE_QUEUE_TYPE
Does not use a thread pool.

See Also:
Constant Field Values

POOLED_QUEUE_TYPE

static final java.lang.String POOLED_QUEUE_TYPE
Uses a thread pool

See Also:
Constant Field Values
Method Detail

initialize

void initialize(ICacheListener listener,
                long listenerId,
                java.lang.String cacheName,
                int maxFailure,
                int waitBeforeRetry,
                java.lang.String threadPoolName)
Initializes the queue. <,p>

Parameters:
listener -
listenerId -
cacheName -
maxFailure -
waitBeforeRetry -
threadPoolName -

getQueueType

java.lang.String getQueueType()
Return the type of event queue we are using, either single or pooled.

Returns:
the queue type: single or pooled

addPutEvent

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

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

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

Throws:
java.io.IOException

addDisposeEvent

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

Throws:
java.io.IOException

getListenerId

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

Returns:
The listenerId value

destroy

void destroy()
Description of the Method


isAlive

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

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

Returns:
boolean

size

int size()
Returns the number of elements in the queue. If the queue cannot determine the size accurately it will return 1.

Returns:
number of items in the queue.

isEmpty

boolean isEmpty()
Are there elements in the queue.

Returns:
true if there are stil elements.

getStatistics

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

Returns:
IStats


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