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 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.
|
ICacheEventQueue.QueueType
Modifier and Type | Field and Description |
---|---|
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 int |
maxFailure
Maximum number of failures before we buy the farm.
|
protected int |
waitBeforeRetry
in milliseconds
|
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.
|
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
destroy, getQueueType, getStatistics, initialize, isEmpty, size
protected static final int DEFAULT_WAIT_TO_DIE_MILLIS
protected ICacheListener<K,V> listener
protected long listenerId
protected String cacheName
protected int maxFailure
protected int waitBeforeRetry
protected boolean destroyed
public int getWaitToDieMillis()
public void setWaitToDieMillis(int wtdm)
wtdm
- the ms for the q to sit idle.public String toString()
public boolean isAlive()
isAlive
in interface ICacheEventQueue<K,V>
public void setAlive(boolean aState)
aState
- public long getListenerId()
ICacheEventQueue
getListenerId
in interface ICacheEventQueue<K,V>
public void addPutEvent(ICacheElement<K,V> ce) throws IOException
addPutEvent
in interface ICacheEventQueue<K,V>
ce
- The feature to be added to the PutEvent attributeIOException
public void addRemoveEvent(K key) throws IOException
addRemoveEvent
in interface ICacheEventQueue<K,V>
key
- The feature to be added to the RemoveEvent attributeIOException
public void addRemoveAllEvent() throws IOException
addRemoveAllEvent
in interface ICacheEventQueue<K,V>
IOException
public void addDisposeEvent() throws IOException
ICacheEventQueue
addDisposeEvent
in interface ICacheEventQueue<K,V>
IOException
protected abstract void put(AbstractCacheEventQueue.AbstractCacheEvent event)
event
- public boolean isWorking()
ICacheEventQueue
isWorking
in interface ICacheEventQueue<K,V>
public void setWorking(boolean b)
b
- Copyright © 2002–2015 The Apache Software Foundation. All rights reserved.