|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.jcs.engine.CacheEventQueue
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 should lazy initilaize the processor thread, and kill the thread if the queue goes emtpy for a specified period, now set to 1 minute. If something comes in after that a new processor thread should be created. I didn't get all of Hanson's changes in yet, but I did add the syncronization.
| Field Summary |
| Fields inherited from interface org.apache.jcs.engine.behavior.ICacheEventQueue |
POOLED_QUEUE_TYPE, SINGLE_QUEUE_TYPE |
| Constructor Summary | |
CacheEventQueue(ICacheListener listener,
long listenerId,
java.lang.String cacheName)
Constructs with the specified listener and the cache name. |
|
CacheEventQueue(ICacheListener listener,
long listenerId,
java.lang.String cacheName,
int maxFailure,
int waitBeforeRetry)
Constructor for the CacheEventQueue object |
|
| 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()
Event Q is emtpy. |
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. |
int |
getWaitToDieMillis()
Returns the time to wait for events before killing the background thread. |
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. |
void |
setAlive(boolean aState)
Sets whether the queue is actively processing -- if there are working threads. |
void |
setWaitToDieMillis(int wtdm)
Sets the time to wait for events before killing the background thread. |
void |
setWorking(boolean b)
|
void |
stopProcessing()
Kill the processor thread and indicate that the queue is detroyed and no longer alive, but it can still be working. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public CacheEventQueue(ICacheListener listener,
long listenerId,
java.lang.String cacheName)
listener - listenerId - cacheName -
public CacheEventQueue(ICacheListener listener,
long listenerId,
java.lang.String cacheName,
int maxFailure,
int waitBeforeRetry)
listener - listenerId - cacheName - maxFailure - waitBeforeRetry - | Method Detail |
public int getQueueType()
ICacheEventQueue
getQueueType in interface ICacheEventQueuepublic void stopProcessing()
public int getWaitToDieMillis()
public void setWaitToDieMillis(int wtdm)
wtdm - the ms for the q to sit idle.public java.lang.String toString()
public boolean isAlive()
ICacheEventQueue
isAlive in interface ICacheEventQueuepublic void setAlive(boolean aState)
aState - public long getListenerId()
ICacheEventQueue
getListenerId in interface ICacheEventQueuepublic void destroy()
destroy in interface ICacheEventQueue
public void addPutEvent(ICacheElement ce)
throws java.io.IOException
ICacheEventQueue
addPutEvent in interface ICacheEventQueuece - The feature to be added to the PutEvent attribute
java.io.IOException
public void addRemoveEvent(java.io.Serializable key)
throws java.io.IOException
ICacheEventQueue
addRemoveEvent in interface ICacheEventQueuekey - The feature to be added to the RemoveEvent attribute
java.io.IOException
public void addRemoveAllEvent()
throws java.io.IOException
ICacheEventQueue
addRemoveAllEvent in interface ICacheEventQueuejava.io.IOException
public void addDisposeEvent()
throws java.io.IOException
ICacheEventQueue
addDisposeEvent in interface ICacheEventQueuejava.io.IOExceptionpublic IStats getStatistics()
ICacheEventQueue
getStatistics in interface ICacheEventQueuepublic boolean isWorking()
ICacheEventQueue
isWorking in interface ICacheEventQueuepublic void setWorking(boolean b)
b - public boolean isEmpty()
ICacheEventQueue
isEmpty in interface ICacheEventQueue
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||