org.ehcache.config
Interface ResourcePools

All Known Implementing Classes:
ResourcePoolsImpl

public interface ResourcePools

A collection of resource pools a cache has at its disposal to store its mappings.


Method Summary
 ResourcePool getPoolForResource(ResourceType resourceType)
          Get a specific ResourcePool based on its type.
 java.util.Set<ResourceType> getResourceTypeSet()
          Get the set of ResourceType of all the pools present in the ResourcePools
 ResourcePools validateAndMerge(ResourcePools toBeUpdated)
          Get a copy of the current ResourcePools merged with another ResourcePools and validate that the updates to the contained ResourcePools are legal.
 

Method Detail

getPoolForResource

ResourcePool getPoolForResource(ResourceType resourceType)
Get a specific ResourcePool based on its type.

Parameters:
resourceType - the type of resource the pool is tracking.
Returns:
the ResourcePool, or null if there is no pool tracking the requested type.

getResourceTypeSet

java.util.Set<ResourceType> getResourceTypeSet()
Get the set of ResourceType of all the pools present in the ResourcePools

Returns:
the set of ResourceType

validateAndMerge

ResourcePools validateAndMerge(ResourcePools toBeUpdated)
                               throws java.lang.IllegalArgumentException,
                                      java.lang.UnsupportedOperationException
Get a copy of the current ResourcePools merged with another ResourcePools and validate that the updates to the contained ResourcePools are legal.

Parameters:
toBeUpdated - the ResourcePools to merge with the current one.
Returns:
A merged and validated ResourcePools copy.
Throws:
java.lang.IllegalArgumentException - thrown when an illegal resource value is being given, for instance a negative size.
java.lang.UnsupportedOperationException - thrown when an unsupported update is requested, for instance trying to change the ResourceUnit.