|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jboss.cache.eviction.BaseEvictionPolicy
org.jboss.cache.eviction.LRUPolicy
no.feide.moria.store.TicketTTLEvictionPolicy
public final class TicketTTLEvictionPolicy
This eviction policy evicts tickets after a fixed period, aka Time To Live.
| Nested Class Summary | |
|---|---|
(package private) static class |
TicketTTLEvictionPolicy.RegionValue
Simple data container for region values. |
| Field Summary | |
|---|---|
private static java.lang.String |
ATTRIBUTE_NAME
Constant representing the attribute name key. |
private org.jboss.cache.TreeCache |
cache
The cache the evictions are done on. |
private java.util.Timer |
evictionTimer
The timer responsible for scheduling the eviction threads. |
private static int |
MAX_NODES_DEFAULT
Default value for max nodes in each region. |
private static java.lang.String |
MAX_NODES_NAME
Constant representing the max nodes key. |
private int |
maxNodes
Maximal number of nodes in a region. |
private no.feide.moria.log.MessageLogger |
messageLogger
The logger used by this class. |
private static java.lang.String |
NAME_ATTRIBUTE_NAME
Constant representing the name attribute key. |
private static java.lang.String |
OPERATION_FAILED_MESSAGE
Constant holding default error message. |
private static java.lang.String |
REGION_NAME
Constant representing the region name key. |
private org.jboss.cache.eviction.RegionManager |
regionManager
Manages the regions for each ticket type. |
private TicketTTLEvictionPolicy.RegionValue[] |
regionValues
Contains the different regions registered for this policy. |
private static org.jboss.cache.Fqn |
ROOT
The root node. |
private static java.lang.String |
TTL_ATTRIBUTE_NAME
Constant representing the ttl attribute key. |
private static int |
WAKEUP_INTERVAL_DEFAULT
Default interval value for running the evictions. |
private static java.lang.String |
WAKEUP_INTERVAL_NAME
Constant representing the wakeup interval key. |
private int |
wakeUpIntervalSeconds
The interval for the eviction threads to run. |
| Fields inherited from class org.jboss.cache.eviction.LRUPolicy |
|---|
log_ |
| Fields inherited from class org.jboss.cache.eviction.BaseEvictionPolicy |
|---|
cache_, regionManager_ |
| Constructor Summary | |
|---|---|
TicketTTLEvictionPolicy()
Creates a new instance. |
|
| Method Summary | |
|---|---|
void |
cacheStarted(org.jboss.cache.TreeCache cache)
|
void |
cacheStopped(org.jboss.cache.TreeCache cache)
|
void |
configure(org.jboss.cache.TreeCache cache)
|
void |
evict(org.jboss.cache.Fqn fqn)
|
(package private) java.lang.String |
getAttribute(org.w3c.dom.Element element,
java.lang.String attributeName)
Retrieves the value of the first occurance of the given attribute in the given element. |
java.lang.Object |
getCacheData(org.jboss.cache.Fqn fqn,
java.lang.Object key)
|
java.util.Set |
getChildrenNames(org.jboss.cache.Fqn fqn)
|
(package private) java.lang.String |
getElementContent(org.w3c.dom.Element element,
boolean trim)
Retrieves the textual content of an xml element. |
org.jboss.cache.eviction.Region[] |
getRegions()
|
(package private) TicketTTLEvictionPolicy.RegionValue |
getRegionValue(java.lang.String fqn)
Gets a region value. |
(package private) TicketTTLEvictionPolicy.RegionValue[] |
getRegionValues()
Gets the region values. |
int |
getWakeupIntervalSeconds()
|
boolean |
hasChild(org.jboss.cache.Fqn fqn)
|
void |
nodeCreated(org.jboss.cache.Fqn fqn)
|
void |
nodeEvicted(org.jboss.cache.Fqn fqn)
|
void |
nodeLoaded(org.jboss.cache.Fqn fqn)
|
void |
nodeModified(org.jboss.cache.Fqn fqn)
|
void |
nodeRemoved(org.jboss.cache.Fqn fqn)
|
void |
nodeVisited(org.jboss.cache.Fqn fqn)
|
(package private) void |
parseConfig(org.w3c.dom.Element config)
Parses the config retrieved from TreeCache.getEvictionPolicyConfig(). |
void |
viewChange(org.jgroups.View view)
|
| Methods inherited from class org.jboss.cache.eviction.LRUPolicy |
|---|
getEvictionAlgorithm, nodeAdded |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private no.feide.moria.log.MessageLogger messageLogger
private org.jboss.cache.eviction.RegionManager regionManager
private static final org.jboss.cache.Fqn ROOT
private static final int WAKEUP_INTERVAL_DEFAULT
private static final int MAX_NODES_DEFAULT
private static final java.lang.String REGION_NAME
private static final java.lang.String ATTRIBUTE_NAME
private static final java.lang.String NAME_ATTRIBUTE_NAME
private static final java.lang.String WAKEUP_INTERVAL_NAME
private static final java.lang.String MAX_NODES_NAME
private static final java.lang.String TTL_ATTRIBUTE_NAME
private static final java.lang.String OPERATION_FAILED_MESSAGE
private TicketTTLEvictionPolicy.RegionValue[] regionValues
private int wakeUpIntervalSeconds
private int maxNodes
private java.util.Timer evictionTimer
private org.jboss.cache.TreeCache cache
| Constructor Detail |
|---|
public TicketTTLEvictionPolicy()
| Method Detail |
|---|
public void configure(org.jboss.cache.TreeCache cache)
configure in interface org.jboss.cache.eviction.EvictionPolicyconfigure in class org.jboss.cache.eviction.LRUPolicyEvictionPolicy.configure(org.jboss.cache.TreeCache)public org.jboss.cache.eviction.Region[] getRegions()
getRegions in interface org.jboss.cache.eviction.EvictionPolicygetRegions in class org.jboss.cache.eviction.BaseEvictionPolicyEvictionPolicy.getRegions()
public void evict(org.jboss.cache.Fqn fqn)
throws java.lang.Exception
evict in interface org.jboss.cache.eviction.EvictionPolicyevict in class org.jboss.cache.eviction.BaseEvictionPolicyjava.lang.ExceptionEvictionPolicy.evict(org.jboss.cache.Fqn)public java.util.Set getChildrenNames(org.jboss.cache.Fqn fqn)
getChildrenNames in interface org.jboss.cache.eviction.EvictionPolicygetChildrenNames in class org.jboss.cache.eviction.BaseEvictionPolicyEvictionPolicy.getChildrenNames(org.jboss.cache.Fqn)public boolean hasChild(org.jboss.cache.Fqn fqn)
hasChild in interface org.jboss.cache.eviction.EvictionPolicyhasChild in class org.jboss.cache.eviction.BaseEvictionPolicyEvictionPolicy.hasChild(org.jboss.cache.Fqn)
public java.lang.Object getCacheData(org.jboss.cache.Fqn fqn,
java.lang.Object key)
getCacheData in interface org.jboss.cache.eviction.EvictionPolicygetCacheData in class org.jboss.cache.eviction.BaseEvictionPolicyEvictionPolicy.getCacheData(org.jboss.cache.Fqn, java.lang.Object)public int getWakeupIntervalSeconds()
getWakeupIntervalSeconds in interface org.jboss.cache.eviction.EvictionPolicygetWakeupIntervalSeconds in class org.jboss.cache.eviction.LRUPolicyEvictionPolicy.getWakeupIntervalSeconds()public void nodeCreated(org.jboss.cache.Fqn fqn)
nodeCreated in interface org.jboss.cache.TreeCacheListenernodeCreated in class org.jboss.cache.eviction.LRUPolicyorg.jboss.cache.TreeCacheListener#nodeAdded(org.jboss.cache.Fqn)public void nodeLoaded(org.jboss.cache.Fqn fqn)
nodeLoaded in interface org.jboss.cache.TreeCacheListenernodeLoaded in class org.jboss.cache.eviction.LRUPolicyTreeCacheListener.nodeLoaded(org.jboss.cache.Fqn)public void nodeRemoved(org.jboss.cache.Fqn fqn)
nodeRemoved in interface org.jboss.cache.TreeCacheListenernodeRemoved in class org.jboss.cache.eviction.LRUPolicyTreeCacheListener.nodeRemoved(org.jboss.cache.Fqn)public void nodeEvicted(org.jboss.cache.Fqn fqn)
nodeEvicted in interface org.jboss.cache.TreeCacheListenernodeEvicted in class org.jboss.cache.eviction.LRUPolicyTreeCacheListener.nodeEvicted(org.jboss.cache.Fqn)public void nodeModified(org.jboss.cache.Fqn fqn)
nodeModified in interface org.jboss.cache.TreeCacheListenernodeModified in class org.jboss.cache.eviction.LRUPolicyTreeCacheListener.nodeModified(org.jboss.cache.Fqn)public void nodeVisited(org.jboss.cache.Fqn fqn)
nodeVisited in interface org.jboss.cache.TreeCacheListenernodeVisited in class org.jboss.cache.eviction.LRUPolicyTreeCacheListener.nodeVisited(org.jboss.cache.Fqn)public void cacheStarted(org.jboss.cache.TreeCache cache)
cacheStarted in interface org.jboss.cache.TreeCacheListenercacheStarted in class org.jboss.cache.eviction.LRUPolicyTreeCacheListener.cacheStarted(org.jboss.cache.TreeCache)public void cacheStopped(org.jboss.cache.TreeCache cache)
cacheStopped in interface org.jboss.cache.TreeCacheListenercacheStopped in class org.jboss.cache.eviction.LRUPolicyTreeCacheListener.cacheStopped(org.jboss.cache.TreeCache)public void viewChange(org.jgroups.View view)
viewChange in interface org.jboss.cache.TreeCacheListenerviewChange in class org.jboss.cache.eviction.LRUPolicyTreeCacheListener.viewChange(org.jgroups.View)void parseConfig(org.w3c.dom.Element config)
config - configuration for this eviction policy
java.lang.String getAttribute(org.w3c.dom.Element element,
java.lang.String attributeName)
element - the element containing an named attribute.attributeName - the name of the requested attribute.
java.lang.String getElementContent(org.w3c.dom.Element element,
boolean trim)
element - The element containing the data to be retrieved.trim - Whether or not to trim whitespace before returing.
TicketTTLEvictionPolicy.RegionValue[] getRegionValues()
final TicketTTLEvictionPolicy.RegionValue getRegionValue(java.lang.String fqn)
fqn - Fully quailified name.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||