ehcache

net.sf.ehcache.config
Class SizeOfPolicyConfiguration

java.lang.Object
  extended by net.sf.ehcache.config.SizeOfPolicyConfiguration
All Implemented Interfaces:
Cloneable

public class SizeOfPolicyConfiguration
extends Object
implements Cloneable

Class to hold the SizeOf policy configuration.

Author:
Ludovic Orban

Nested Class Summary
static class SizeOfPolicyConfiguration.MaxDepthExceededBehavior
          Enum of the possible behaviors of the SizeOf engine when the max depth is exceeded
 
Field Summary
static SizeOfPolicyConfiguration.MaxDepthExceededBehavior DEFAULT_MAX_DEPTH_EXCEEDED_BEHAVIOR
          Default max traversal depth exceeded behavior
static int DEFAULT_MAX_SIZEOF_DEPTH
          Default max traversal depth
 
Constructor Summary
SizeOfPolicyConfiguration()
           
 
Method Summary
 boolean equals(Object obj)
           
 int getMaxDepth()
          Gets the maximum depth the SizeOf engine can normally traverse
 SizeOfPolicyConfiguration.MaxDepthExceededBehavior getMaxDepthExceededBehavior()
          Gets the behavior of the SizeOf engine when the max depth is reached
 int hashCode()
           
 SizeOfPolicyConfiguration maxDepth(int maxDepth)
          Builder method to set the maximum depth the SizeOf engine can normally traverse
 SizeOfPolicyConfiguration maxDepthExceededBehavior(SizeOfPolicyConfiguration.MaxDepthExceededBehavior maxDepthExceededBehavior)
          Builder method to set the behavior of the SizeOf engine when the max depth is reached
 SizeOfPolicyConfiguration maxDepthExceededBehavior(String maxDepthExceededBehavior)
          Builder method to set the behavior of the SizeOf engine when the max depth is reached using a String object
static SizeOfPolicyConfiguration.MaxDepthExceededBehavior resolveBehavior(Ehcache cache)
          Helper method which resolves the MaxDepthExceededBehavior of a cache, using the cache manager's one if none was configured on the cache itself.
static int resolveMaxDepth(Ehcache cache)
          Helper method which resolves the max depth of a cache, using the cache manager's one if none was configured on the cache itself.
 void setMaxDepth(int maxDepth)
          Sets the maximum depth the SizeOf engine can normally traverse
 void setMaxDepthExceededBehavior(String maxDepthExceededBehavior)
          Sets the behavior of the SizeOf engine when the max depth is reached
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_MAX_SIZEOF_DEPTH

public static final int DEFAULT_MAX_SIZEOF_DEPTH
Default max traversal depth

See Also:
Constant Field Values

DEFAULT_MAX_DEPTH_EXCEEDED_BEHAVIOR

public static final SizeOfPolicyConfiguration.MaxDepthExceededBehavior DEFAULT_MAX_DEPTH_EXCEEDED_BEHAVIOR
Default max traversal depth exceeded behavior

Constructor Detail

SizeOfPolicyConfiguration

public SizeOfPolicyConfiguration()
Method Detail

getMaxDepth

public int getMaxDepth()
Gets the maximum depth the SizeOf engine can normally traverse

Returns:
the maximum depth the SizeOf engine can normally traverse

setMaxDepth

public void setMaxDepth(int maxDepth)
Sets the maximum depth the SizeOf engine can normally traverse

Parameters:
maxDepth - the maximum depth the SizeOf engine can normally traverse

maxDepth

public SizeOfPolicyConfiguration maxDepth(int maxDepth)
Builder method to set the maximum depth the SizeOf engine can normally traverse

Parameters:
maxDepth - the maximum depth the SizeOf engine can normally traverse
Returns:
this SizeOfPolicyConfiguration object

getMaxDepthExceededBehavior

public SizeOfPolicyConfiguration.MaxDepthExceededBehavior getMaxDepthExceededBehavior()
Gets the behavior of the SizeOf engine when the max depth is reached

Returns:
the behavior of the SizeOf engine when the max depth is reached

setMaxDepthExceededBehavior

public void setMaxDepthExceededBehavior(String maxDepthExceededBehavior)
Sets the behavior of the SizeOf engine when the max depth is reached

Parameters:
maxDepthExceededBehavior - the behavior of the SizeOf engine when the max depth is reached

maxDepthExceededBehavior

public SizeOfPolicyConfiguration maxDepthExceededBehavior(SizeOfPolicyConfiguration.MaxDepthExceededBehavior maxDepthExceededBehavior)
Builder method to set the behavior of the SizeOf engine when the max depth is reached

Parameters:
maxDepthExceededBehavior - the behavior of the SizeOf engine when the max depth is reached
Returns:
this SizeOfPolicyConfiguration object

maxDepthExceededBehavior

public SizeOfPolicyConfiguration maxDepthExceededBehavior(String maxDepthExceededBehavior)
Builder method to set the behavior of the SizeOf engine when the max depth is reached using a String object

Parameters:
maxDepthExceededBehavior - the behavior of the SizeOf engine when the max depth is reached
Returns:
this SizeOfPolicyConfiguration object

resolveMaxDepth

public static int resolveMaxDepth(Ehcache cache)
Helper method which resolves the max depth of a cache, using the cache manager's one if none was configured on the cache itself.

Parameters:
cache - the cache from which to resolve the max depth
Returns:
the resolved max depth

resolveBehavior

public static SizeOfPolicyConfiguration.MaxDepthExceededBehavior resolveBehavior(Ehcache cache)
Helper method which resolves the MaxDepthExceededBehavior of a cache, using the cache manager's one if none was configured on the cache itself.

Parameters:
cache - the cache from which to resolve the MaxDepthExceededBehavior
Returns:
the resolved MaxDepthExceededBehavior

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

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

ehcache

Copyright 2001-2014, Terracotta, Inc.