Package 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
Modifier and TypeMethodDescription<P extends ResourcePool>
PgetPoolForResource(ResourceType<P> resourceType) Gets a specificResourcePoolbased on its type.Set<ResourceType<?>>Gets the set ofResourceTypes present in theResourcePools.validateAndMerge(ResourcePools toBeUpdated) Get a copy of thisResourcePoolsmerged with the givenResourcePools, validating that the updates to the containedResourcePools are legal.
-
Method Details
-
getPoolForResource
Gets a specificResourcePoolbased 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
Set<ResourceType<?>> getResourceTypeSet()Gets the set ofResourceTypes present in theResourcePools.- Returns:
- the set of
ResourceType
-
validateAndMerge
ResourcePools validateAndMerge(ResourcePools toBeUpdated) throws IllegalArgumentException, UnsupportedOperationException Get a copy of thisResourcePoolsmerged with the givenResourcePools, validating that the updates to the containedResourcePools are legal.- Parameters:
toBeUpdated- theResourcePoolsto merge with the current one.- Returns:
- a validated and merged
ResourcePools - Throws:
IllegalArgumentException- thrown when an illegal resource value is being givenUnsupportedOperationException- thrown when an unsupported update is requested
-