|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.jcs.engine.AbstractCacheEventQueue<K,V>
org.apache.jcs.engine.PooledCacheEventQueue<K,V>
public class PooledCacheEventQueue<K extends Serializable,V extends Serializable>
An event queue is used to propagate ordered cache events to one and only one target listener.
This is a modified version of the experimental version. It uses a PooledExecutor and a BoundedBuffer to queue up events and execute them as threads become available.
The PooledExecutor is static, because presumably these processes will be IO bound, so throwing more than a few threads at them will serve no purpose other than to saturate the IO interface. In light of this, having one thread per region seems unnecessary. This may prove to be false.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.apache.jcs.engine.AbstractCacheEventQueue |
|---|
AbstractCacheEventQueue.AbstractCacheEvent, AbstractCacheEventQueue.DisposeEvent, AbstractCacheEventQueue.Node, AbstractCacheEventQueue.PutEvent, AbstractCacheEventQueue.RemoveAllEvent, AbstractCacheEventQueue.RemoveEvent |
| Field Summary |
|---|
| Fields inherited from class org.apache.jcs.engine.AbstractCacheEventQueue |
|---|
cacheName, DEFAULT_WAIT_TO_DIE_MILLIS, destroyed, listener, listenerId, log, maxFailure, waitBeforeRetry, waitToDieMillis, working |
| Fields inherited from interface org.apache.jcs.engine.behavior.ICacheEventQueue |
|---|
POOLED_QUEUE_TYPE, SINGLE_QUEUE_TYPE |
| Constructor Summary | |
|---|---|
PooledCacheEventQueue(ICacheListener<K,V> listener,
long listenerId,
String cacheName,
int maxFailure,
int waitBeforeRetry,
String threadPoolName)
Constructor for the CacheEventQueue object |
|
| Method Summary | |
|---|---|
void |
destroy()
Destroy the queue. |
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. |
String |
getStats()
|
void |
initialize(ICacheListener<K,V> listener,
long listenerId,
String cacheName,
int maxFailure,
int waitBeforeRetry,
String threadPoolName)
Initializes the queue. |
boolean |
isEmpty()
If the Queue is using a bounded channel we can determine the size. |
protected void |
put(AbstractCacheEventQueue.AbstractCacheEvent event)
Adds an event to the queue. |
int |
size()
Returns the number of elements in the queue. |
void |
stopProcessing()
Event Q is empty. |
| Methods inherited from class org.apache.jcs.engine.AbstractCacheEventQueue |
|---|
addDisposeEvent, addPutEvent, addRemoveAllEvent, addRemoveEvent, getListenerId, getWaitToDieMillis, isAlive, isWorking, setAlive, setWaitToDieMillis, setWorking, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public PooledCacheEventQueue(ICacheListener<K,V> listener,
long listenerId,
String cacheName,
int maxFailure,
int waitBeforeRetry,
String threadPoolName)
listener - listenerId - cacheName - maxFailure - waitBeforeRetry - threadPoolName - | Method Detail |
|---|
public void initialize(ICacheListener<K,V> listener,
long listenerId,
String cacheName,
int maxFailure,
int waitBeforeRetry,
String threadPoolName)
listener - listenerId - cacheName - maxFailure - waitBeforeRetry - threadPoolName - public String getQueueType()
ICacheEventQueue
public void stopProcessing()
public void destroy()
protected void put(AbstractCacheEventQueue.AbstractCacheEvent event)
put in class AbstractCacheEventQueue<K extends Serializable,V extends Serializable>event - public String getStats()
public IStats getStatistics()
ICacheEventQueue
public boolean isEmpty()
public int size()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||