Package org.apache.commons.jcs3.engine
Class AbstractCacheEventQueue<K,V> 
java.lang.Object
org.apache.commons.jcs3.engine.AbstractCacheEventQueue<K,V> 
- All Implemented Interfaces:
- ICacheEventQueue<K,- V> 
- Direct Known Subclasses:
- PooledCacheEventQueue
An abstract base class to the different implementations
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionprotected classRetries before declaring failure.protected classThe cache should be disposed when this event is processed.protected classAn element should be put in the cache.protected classAll elements should be removed from the cache when this event is processed.protected classAn element should be removed from the cache.Nested classes/interfaces inherited from interface org.apache.commons.jcs3.engine.behavior.ICacheEventQueueICacheEventQueue.QueueType
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidThis adds a dispose event to the queue.voidaddPutEvent(ICacheElement<K, V> ce) This adds a put event to the queue.voidThis adds a remove all event to the queue.voidaddRemoveEvent(K key) This adds a remove event to the queue.protected StringlongGets the listenerId attribute of the ICacheEventQueue objectintReturns the time to wait for events before killing the background thread.protected voidinitialize(ICacheListener<K, V> listener, long listenerId, String cacheName, int maxFailure, int waitBeforeRetry) Initializes the queue.booleanA Queue is working unless it has reached its max failure count.protected abstract voidput(AbstractCacheEventQueue<K, V>.AbstractCacheEvent event) Adds an event to the queue.voidsetWaitToDieMillis(int wtdm) Sets the time to wait for events before killing the background thread.voidsetWorking(boolean b) This means that the queue is functional.toString()Creates a brief string identifying the listener and the region.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.commons.jcs3.engine.behavior.ICacheEventQueuedestroy, getQueueType, getStatistics, isEmpty, size
- 
Field Details- 
DEFAULT_WAIT_TO_DIE_MILLISdefault- See Also:
 
 
- 
- 
Constructor Details- 
AbstractCacheEventQueuepublic AbstractCacheEventQueue()
 
- 
- 
Method Details- 
getWaitToDieMillisReturns the time to wait for events before killing the background thread.- Returns:
- int
 
- 
setWaitToDieMillisSets the time to wait for events before killing the background thread.- Parameters:
- wtdm- the ms for the q to sit idle.
 
- 
toStringCreates a brief string identifying the listener and the region.
- 
getListenerIdDescription copied from interface:ICacheEventQueueGets the listenerId attribute of the ICacheEventQueue object- Specified by:
- getListenerIdin interface- ICacheEventQueue<K,- V> 
- Returns:
- The listenerId value
 
- 
getCacheName- Returns:
- the cacheName
 
- 
initializeprotected void initialize(ICacheListener<K, V> listener, long listenerId, String cacheName, int maxFailure, int waitBeforeRetry) Initializes the queue.- Parameters:
- listener-
- listenerId-
- cacheName-
- maxFailure-
- waitBeforeRetry-
 
- 
addPutEventThis adds a put event to the queue. When it is processed, the element will be put to the listener.- Specified by:
- addPutEventin interface- ICacheEventQueue<K,- V> 
- Parameters:
- ce- The feature to be added to the PutEvent attribute
- Throws:
- IOException
 
- 
addRemoveEventThis adds a remove event to the queue. When processed the listener's remove method will be called for the key.- Specified by:
- addRemoveEventin interface- ICacheEventQueue<K,- V> 
- Parameters:
- key- The feature to be added to the RemoveEvent attribute
- Throws:
- IOException
 
- 
addRemoveAllEventThis adds a remove all event to the queue. When it is processed, all elements will be removed from the cache.- Specified by:
- addRemoveAllEventin interface- ICacheEventQueue<K,- V> 
 
- 
addDisposeEventThis adds a dispose event to the queue. When it is processed, the cache is shut down- Specified by:
- addDisposeEventin interface- ICacheEventQueue<K,- V> 
 
- 
putAdds an event to the queue.- Parameters:
- event-
 
- 
isWorkingDescription copied from interface:ICacheEventQueueA Queue is working unless it has reached its max failure count.- Specified by:
- isWorkingin interface- ICacheEventQueue<K,- V> 
- Returns:
- whether the queue is functional.
 
- 
setWorkingThis means that the queue is functional. If we reached the max number of failures, the queue is marked as non functional and will never work again.- Parameters:
- b-
 
 
-