org.jboss.cache.eviction
Class LRUAlgorithmConfig

java.lang.Object
  extended by org.jboss.cache.config.ConfigurationComponent
      extended by org.jboss.cache.eviction.EvictionAlgorithmConfigBase
          extended by org.jboss.cache.eviction.LRUAlgorithmConfig
All Implemented Interfaces:
Serializable, Cloneable, CloneableConfigurationComponent, EvictionAlgorithmConfig

public class LRUAlgorithmConfig
extends EvictionAlgorithmConfigBase

Configuration implementation for LRUAlgorithm.

Since:
3.0
Author:
Manik Surtani
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jboss.cache.eviction.EvictionAlgorithmConfigBase
evictionAlgorithmClassName, maxNodes, minTimeToLive
 
Fields inherited from class org.jboss.cache.config.ConfigurationComponent
log
 
Constructor Summary
LRUAlgorithmConfig()
           
LRUAlgorithmConfig(long timeToLive, long maxAge)
           
LRUAlgorithmConfig(long timeToLive, long maxAge, int maxNodes)
           
 
Method Summary
 LRUAlgorithmConfig clone()
           
 boolean equals(Object o)
           
 long getMaxAge()
           
 long getTimeToLive()
           
 int hashCode()
           
 void reset()
          Resets the values to their defaults.
 void setMaxAge(long maxAge)
          Sets the max age per element
 void setMaxAge(long maxAge, TimeUnit timeUnit)
           
 void setTimeToLive(long timeToLive)
          Sets the time to live
 void setTimeToLive(long timeToLive, TimeUnit timeUnit)
           
 void setTimeToLiveSeconds(long time)
          Deprecated. 
 String toString()
           
 void validate()
          Requires a positive timeToLive value or ConfigurationException is thrown.
 
Methods inherited from class org.jboss.cache.eviction.EvictionAlgorithmConfigBase
getEvictionAlgorithmClassName, getMaxNodes, getMinTimeToLive, setMaxNodes, setMinTimeToLive, setMinTimeToLive, setMinTimeToLiveSeconds
 
Methods inherited from class org.jboss.cache.config.ConfigurationComponent
addChildConfig, addChildConfigs, passCacheToChildConfig, removeChildConfig, removeChildConfigs, replaceChildConfig, replaceChildConfigs, setCache, testImmutability
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LRUAlgorithmConfig

public LRUAlgorithmConfig()

LRUAlgorithmConfig

public LRUAlgorithmConfig(long timeToLive,
                          long maxAge)

LRUAlgorithmConfig

public LRUAlgorithmConfig(long timeToLive,
                          long maxAge,
                          int maxNodes)
Method Detail

getTimeToLive

public long getTimeToLive()
Returns:
the time to live, in milliseconds

setTimeToLive

public void setTimeToLive(long timeToLive)
Sets the time to live

Parameters:
timeToLive - the time to live, in milliseconds

setTimeToLive

public void setTimeToLive(long timeToLive,
                          TimeUnit timeUnit)

setTimeToLiveSeconds

@Deprecated
public void setTimeToLiveSeconds(long time)
Deprecated. 


getMaxAge

public long getMaxAge()
Returns:
the max age per element, in milliseconds

setMaxAge

public void setMaxAge(long maxAge)
Sets the max age per element

Parameters:
maxAge - value in milliseconds

setMaxAge

public void setMaxAge(long maxAge,
                      TimeUnit timeUnit)

validate

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

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

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object o)
Overrides:
equals in class EvictionAlgorithmConfigBase

hashCode

public int hashCode()
Overrides:
hashCode in class EvictionAlgorithmConfigBase

reset

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

Specified by:
reset in interface EvictionAlgorithmConfig
Overrides:
reset in class EvictionAlgorithmConfigBase

clone

public LRUAlgorithmConfig clone()
                         throws CloneNotSupportedException
Specified by:
clone in interface CloneableConfigurationComponent
Specified by:
clone in interface EvictionAlgorithmConfig
Overrides:
clone in class EvictionAlgorithmConfigBase
Returns:
a clone of the EvictionAlgorithmConfig.
Throws:
CloneNotSupportedException


Copyright © 2009 JBoss, a division of Red Hat. All Rights Reserved.