|
||||||||||
| 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>
public abstract class AbstractCacheEventQueue<K extends Serializable,V extends Serializable>
An abstract base class to the different implementations
| Nested Class Summary | |
|---|---|
protected class |
AbstractCacheEventQueue.AbstractCacheEvent
Retries before declaring failure. |
protected class |
AbstractCacheEventQueue.DisposeEvent
The cache should be disposed when this event is processed. |
protected static class |
AbstractCacheEventQueue.Node
The queue is composed of nodes. |
protected class |
AbstractCacheEventQueue.PutEvent
An element should be put in the cache. |
protected class |
AbstractCacheEventQueue.RemoveAllEvent
All elements should be removed from the cache when this event is processed. |
protected class |
AbstractCacheEventQueue.RemoveEvent
An element should be removed from the cache. |
| Field Summary | |
|---|---|
protected String |
cacheName
The cache region name, if applicable. |
protected static int |
DEFAULT_WAIT_TO_DIE_MILLIS
default |
protected boolean |
destroyed
this is true if there is no worker thread. |
protected ICacheListener<K,V> |
listener
When the events are pulled off the queue, the tell the listener to handle the specific event type. |
protected long |
listenerId
Id of the listener registered with this queue |
protected static org.apache.commons.logging.Log |
log
The logger. |
protected int |
maxFailure
Maximum number of failures before we buy the farm. |
protected int |
waitBeforeRetry
in milliseconds |
protected int |
waitToDieMillis
time to wait for an event before snuffing the background thread if the queue is empty. make configurable later |
protected boolean |
working
This means that the queue is functional. |
| Fields inherited from interface org.apache.jcs.engine.behavior.ICacheEventQueue |
|---|
POOLED_QUEUE_TYPE, SINGLE_QUEUE_TYPE |
| Constructor Summary | |
|---|---|
AbstractCacheEventQueue()
|
|
| Method Summary | |
|---|---|
void |
addDisposeEvent()
Adds a feature to the DisposeEvent attribute of the ICacheEventQueue object |
void |
addPutEvent(ICacheElement<K,V> ce)
This adds a put event to the queue. |
void |
addRemoveAllEvent()
This adds a remove all event to the queue. |
void |
addRemoveEvent(K key)
This adds a remove event to the queue. |
long |
getListenerId()
Gets the listenerId attribute of the ICacheEventQueue object |
int |
getWaitToDieMillis()
Returns the time to wait for events before killing the background thread. |
boolean |
isAlive()
If they queue has an active thread it is considered alive. |
boolean |
isWorking()
A Queue is working unless it has reached its max failure count. |
protected abstract void |
put(AbstractCacheEventQueue.AbstractCacheEvent event)
Adds an event to the queue. |
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)
This means that the queue is functional. |
String |
toString()
Creates a brief string identifying the listener and the region. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.apache.jcs.engine.behavior.ICacheEventQueue |
|---|
destroy, getQueueType, getStatistics, initialize, isEmpty, size |
| Field Detail |
|---|
protected static final org.apache.commons.logging.Log log
protected static final int DEFAULT_WAIT_TO_DIE_MILLIS
protected int waitToDieMillis
protected ICacheListener<K extends Serializable,V extends Serializable> listener
protected long listenerId
protected String cacheName
protected int maxFailure
protected int waitBeforeRetry
protected boolean destroyed
protected boolean working
| Constructor Detail |
|---|
public AbstractCacheEventQueue()
| Method Detail |
|---|
public int getWaitToDieMillis()
public void setWaitToDieMillis(int wtdm)
wtdm - the ms for the q to sit idle.public String toString()
toString in class Objectpublic boolean isAlive()
isAlive in interface ICacheEventQueue<K extends Serializable,V extends Serializable>public void setAlive(boolean aState)
aState - public long getListenerId()
ICacheEventQueue
getListenerId in interface ICacheEventQueue<K extends Serializable,V extends Serializable>
public void addPutEvent(ICacheElement<K,V> ce)
throws IOException
addPutEvent in interface ICacheEventQueue<K extends Serializable,V extends Serializable>ce - The feature to be added to the PutEvent attribute
IOException
public void addRemoveEvent(K key)
throws IOException
addRemoveEvent in interface ICacheEventQueue<K extends Serializable,V extends Serializable>key - The feature to be added to the RemoveEvent attribute
IOException
public void addRemoveAllEvent()
throws IOException
addRemoveAllEvent in interface ICacheEventQueue<K extends Serializable,V extends Serializable>IOException
public void addDisposeEvent()
throws IOException
ICacheEventQueue
addDisposeEvent in interface ICacheEventQueue<K extends Serializable,V extends Serializable>IOExceptionprotected abstract void put(AbstractCacheEventQueue.AbstractCacheEvent event)
event - public boolean isWorking()
ICacheEventQueue
isWorking in interface ICacheEventQueue<K extends Serializable,V extends Serializable>public void setWorking(boolean b)
b -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||