public abstract class AbstractCacheEventQueue<K,V> extends Object implements ICacheEventQueue<K,V>
| Modifier and Type | Class and Description |
|---|---|
protected class |
AbstractCacheEventQueue.AbstractCacheEvent
Retries before declaring failure.
|
protected class |
AbstractCacheEventQueue.DisposeEvent
The cache should be disposed when this event is processed.
|
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.
|
ICacheEventQueue.QueueType| Modifier and Type | Field and Description |
|---|---|
protected static int |
DEFAULT_WAIT_TO_DIE_MILLIS
default
|
| Constructor and Description |
|---|
AbstractCacheEventQueue() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
protected String |
getCacheName() |
long |
getListenerId()
Gets the listenerId attribute of the ICacheEventQueue object
|
int |
getWaitToDieMillis()
Returns the time to wait for events before killing the background thread.
|
protected void |
initialize(ICacheListener<K,V> listener,
long listenerId,
String cacheName,
int maxFailure,
int waitBeforeRetry)
Initializes the queue.
|
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdestroy, getQueueType, getStatistics, isEmpty, sizeprotected static final int DEFAULT_WAIT_TO_DIE_MILLIS
public AbstractCacheEventQueue()
public int getWaitToDieMillis()
public void setWaitToDieMillis(int wtdm)
wtdm - the ms for the q to sit idle.public boolean isAlive()
isAlive in interface ICacheEventQueue<K,V>public void setAlive(boolean aState)
aState - public long getListenerId()
ICacheEventQueuegetListenerId in interface ICacheEventQueue<K,V>protected String getCacheName()
protected void initialize(ICacheListener<K,V> listener, long listenerId, String cacheName, int maxFailure, int waitBeforeRetry)
listener - listenerId - cacheName - maxFailure - waitBeforeRetry - public void addPutEvent(ICacheElement<K,V> ce) throws IOException
addPutEvent in interface ICacheEventQueue<K,V>ce - The feature to be added to the PutEvent attributeIOExceptionpublic void addRemoveEvent(K key) throws IOException
addRemoveEvent in interface ICacheEventQueue<K,V>key - The feature to be added to the RemoveEvent attributeIOExceptionpublic void addRemoveAllEvent() throws IOException
addRemoveAllEvent in interface ICacheEventQueue<K,V>IOExceptionpublic void addDisposeEvent() throws IOException
ICacheEventQueueaddDisposeEvent in interface ICacheEventQueue<K,V>IOExceptionprotected abstract void put(AbstractCacheEventQueue.AbstractCacheEvent event)
event - public boolean isWorking()
ICacheEventQueueisWorking in interface ICacheEventQueue<K,V>public void setWorking(boolean b)
b - Copyright © 2002–2018 The Apache Software Foundation. All rights reserved.