org.jboss.cache.eviction
Class ElementSizeConfiguration

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

public class ElementSizeConfiguration
extends EvictionPolicyConfigBase

Configuration for ElementSizePolicy.

If configured via XML, expects the following:

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

Version:
$Revision: 4682 $
Author:
Daniel Huang, Brian Stansberry
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jboss.cache.config.ConfigurationComponent
log
 
Constructor Summary
ElementSizeConfiguration()
           
 
Method Summary
 ElementSizeConfiguration clone()
           
 boolean equals(Object obj)
           
 int getMaxElementsPerNode()
           
 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 setMaxElementsPerNode(int maxElementsPerNode)
           
 String toString()
           
 void validate()
          Requires a positive maxElementsPerNode value or ConfigurationException is thrown.
 
Methods inherited from class org.jboss.cache.eviction.EvictionPolicyConfigBase
getEvictionPolicyClass, getMaxNodes, getMinTimeToLiveSeconds, setEvictionPolicyClass, setMaxNodes, setMinTimeToLiveSeconds
 
Methods inherited from class org.jboss.cache.config.ConfigurationComponent
addChildConfig, addChildConfigs, passCacheToChildConfig, removeChildConfig, removeChildConfigs, replaceChildConfig, replaceChildConfigs, safeEquals, setCache, testImmutability
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ElementSizeConfiguration

public ElementSizeConfiguration()
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

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 EvictionPolicyConfig
Overrides:
validate in class EvictionPolicyConfigBase
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 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

clone

public ElementSizeConfiguration clone()
                               throws CloneNotSupportedException
Overrides:
clone in class ConfigurationComponent
Throws:
CloneNotSupportedException


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