org.jboss.cache.eviction
Class LRUConfiguration

java.lang.Object
  extended by org.jboss.cache.config.ConfigurationComponent
      extended by org.jboss.cache.eviction.EvictionPolicyConfigBase
          extended by org.jboss.cache.eviction.LRUConfiguration
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, EvictionPolicyConfig

public class LRUConfiguration
extends EvictionPolicyConfigBase

Configuration implementation for LRUPolicy.

If configured via XML, expects the following:

 
    10000
    8
    10
 
 

Version:
$Revision: 1.6 $
Author:
Daniel Huang (dhuang@jboss.org)
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jboss.cache.config.ConfigurationComponent
log
 
Constructor Summary
LRUConfiguration()
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 int getMaxAgeSeconds()
           
 int getTimeToLiveSeconds()
           
 int hashCode()
           
 void reset()
          Resets the values to their defaults.
protected  void setEvictionPolicyClassName()
          This method should be overridden by subclass implementers to set the default policy class name for the subclass.
 void setMaxAgeSeconds(int maxAgeSeconds)
           
 void setTimeToLiveSeconds(int timeToLiveSeconds)
           
 java.lang.String toString()
           
 void validate()
          Requires a positive timeToLiveSeconds value or ConfigurationException is thrown.
 
Methods inherited from class org.jboss.cache.eviction.EvictionPolicyConfigBase
getEvictionPolicyClass, getMaxNodes, setEvictionPolicyClass, setMaxNodes
 
Methods inherited from class org.jboss.cache.config.ConfigurationComponent
addChildConfig, addChildConfigs, clone, getTreeCache, passCacheToChildConfig, removeChildConfig, removeChildConfigs, replaceChildConfig, replaceChildConfigs, safeEquals, setCacheImpl, testImmutability
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LRUConfiguration

public LRUConfiguration()
Method Detail

setEvictionPolicyClassName

protected void setEvictionPolicyClassName()
Description copied from class: EvictionPolicyConfigBase
This method should be overridden by subclass implementers to set the default policy class name for the subclass. This will be called when the implementation is constructed, but is also called in EvictionPolicyConfigBase.reset().

Specified by:
setEvictionPolicyClassName in class EvictionPolicyConfigBase

getTimeToLiveSeconds

public int getTimeToLiveSeconds()

setTimeToLiveSeconds

public void setTimeToLiveSeconds(int timeToLiveSeconds)

getMaxAgeSeconds

public int getMaxAgeSeconds()

setMaxAgeSeconds

public void setMaxAgeSeconds(int maxAgeSeconds)

validate

public void validate()
              throws ConfigurationException
Requires a positive timeToLiveSeconds value or ConfigurationException is thrown.

Specified by:
validate in interface EvictionPolicyConfig
Overrides:
validate in class EvictionPolicyConfigBase
Throws:
ConfigurationException - if any values for the configuration properties are invalid

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class EvictionPolicyConfigBase

hashCode

public int hashCode()
Overrides:
hashCode in class EvictionPolicyConfigBase

reset

public void reset()
Description copied from interface: EvictionPolicyConfig
Resets the values to their defaults.

Specified by:
reset in interface EvictionPolicyConfig
Overrides:
reset in class EvictionPolicyConfigBase