org.jboss.cache.eviction
Class ElementSizeAlgorithmConfig

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

public class ElementSizeAlgorithmConfig
extends EvictionAlgorithmConfigBase

Configuration for ElementSizeAlgorithm.

Requires a positive "maxElementsPerNode" value otherwise a ConfigurationException is thrown.

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
ElementSizeAlgorithmConfig()
           
ElementSizeAlgorithmConfig(int maxNodes, int maxElementsPerNode)
           
 
Method Summary
 ElementSizeAlgorithmConfig clone()
           
 boolean equals(Object obj)
           
 int getMaxElementsPerNode()
           
 int hashCode()
           
 void reset()
          Resets the values to their defaults.
 void setMaxElementsPerNode(int maxElementsPerNode)
           
 String toString()
           
 void validate()
          Requires a positive maxElementsPerNode 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

ElementSizeAlgorithmConfig

public ElementSizeAlgorithmConfig()

ElementSizeAlgorithmConfig

public ElementSizeAlgorithmConfig(int maxNodes,
                                  int maxElementsPerNode)
Method Detail

getMaxElementsPerNode

public int getMaxElementsPerNode()

setMaxElementsPerNode

public void setMaxElementsPerNode(int maxElementsPerNode)

validate

public void validate()
              throws ConfigurationException
Requires a positive maxElementsPerNode 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 obj)
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 ElementSizeAlgorithmConfig 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.