org.jboss.cache.eviction
Class EvictionAlgorithmConfigBase

java.lang.Object
  extended by org.jboss.cache.config.ConfigurationComponent
      extended by org.jboss.cache.eviction.EvictionAlgorithmConfigBase
All Implemented Interfaces:
Serializable, Cloneable, CloneableConfigurationComponent, EvictionAlgorithmConfig
Direct Known Subclasses:
ElementSizeAlgorithmConfig, ExpirationAlgorithmConfig, FIFOAlgorithmConfig, LFUAlgorithmConfig, LRUAlgorithmConfig, MRUAlgorithmConfig

public abstract class EvictionAlgorithmConfigBase
extends ConfigurationComponent
implements EvictionAlgorithmConfig

A base class used for configuring eviction algorithms.

Since:
3.0
Author:
Manik Surtani (manik AT jboss DOT org)
See Also:
Serialized Form

Field Summary
protected  String evictionAlgorithmClassName
           
protected  int maxNodes
           
protected  long minTimeToLive
           
 
Fields inherited from class org.jboss.cache.config.ConfigurationComponent
log
 
Constructor Summary
protected EvictionAlgorithmConfigBase()
          Can only be instantiated by a subclass.
 
Method Summary
 EvictionAlgorithmConfig clone()
           
 boolean equals(Object o)
           
 String getEvictionAlgorithmClassName()
          Gets the class name of the EvictionAlgorithm implementation this object will configure.
 int getMaxNodes()
           
 long getMinTimeToLive()
           
 int hashCode()
           
 void reset()
          Resets the values to their defaults.
 void setMaxNodes(int maxNodes)
           
 void setMinTimeToLive(long minTimeToLive)
           
 void setMinTimeToLive(long time, TimeUnit timeUnit)
           
 void setMinTimeToLiveSeconds(long time)
          Deprecated. 
 void validate()
          Validate the configuration.
 
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, toString, wait, wait, wait
 

Field Detail

evictionAlgorithmClassName

protected String evictionAlgorithmClassName

maxNodes

@Dynamic
protected int maxNodes

minTimeToLive

@Dynamic
protected long minTimeToLive
Constructor Detail

EvictionAlgorithmConfigBase

protected EvictionAlgorithmConfigBase()
Can only be instantiated by a subclass.

Method Detail

getEvictionAlgorithmClassName

public String getEvictionAlgorithmClassName()
Description copied from interface: EvictionAlgorithmConfig
Gets the class name of the EvictionAlgorithm implementation this object will configure.

Specified by:
getEvictionAlgorithmClassName in interface EvictionAlgorithmConfig
Returns:
fully qualified class name

getMaxNodes

public int getMaxNodes()

setMaxNodes

public void setMaxNodes(int maxNodes)

getMinTimeToLive

public long getMinTimeToLive()
Returns:
The minimum time to live, in milliseconds.

setMinTimeToLive

public void setMinTimeToLive(long minTimeToLive)
Parameters:
minTimeToLive - time to live, in milliseconds

setMinTimeToLive

public void setMinTimeToLive(long time,
                             TimeUnit timeUnit)

setMinTimeToLiveSeconds

@Deprecated
public void setMinTimeToLiveSeconds(long time)
Deprecated. 


validate

public void validate()
              throws ConfigurationException
Description copied from interface: EvictionAlgorithmConfig
Validate the configuration. Will be called after any configuration properties are set.

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

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object

reset

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

Specified by:
reset in interface EvictionAlgorithmConfig

clone

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


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