org.ehcache.config
Interface ResourcePools


public interface ResourcePools

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

Implementations must be immutable.


Method Summary
<P extends ResourcePool>
P
getPoolForResource(ResourceType<P> resourceType)
          Gets a specific ResourcePool based on its type.
 java.util.Set<ResourceType<?>> getResourceTypeSet()
          Gets the set of ResourceTypes present in the ResourcePools.
 ResourcePools validateAndMerge(ResourcePools toBeUpdated)
          Get a copy of this ResourcePools merged with the given ResourcePools, validating that the updates to the contained ResourcePools are legal.
 

Method Detail

getPoolForResource

<P extends ResourcePool> P getPoolForResource(ResourceType<P> resourceType)
Gets a specific ResourcePool based on its type.

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

getResourceTypeSet

java.util.Set<ResourceType<?>> getResourceTypeSet()
Gets the set of ResourceTypes 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 this ResourcePools merged with the given ResourcePools, validating that the updates to the contained ResourcePools are legal.

Parameters:
toBeUpdated - the ResourcePools to merge with the current one.
Returns:
a validated and merged ResourcePools
Throws:
java.lang.IllegalArgumentException - thrown when an illegal resource value is being given
java.lang.UnsupportedOperationException - thrown when an unsupported update is requested