A {@link CacheManager} provides a means of establishing, configuring,acquiring, closing and destroying uniquely named {@link Cache}s.
{@link Cache}s produced and owned by a {@link CacheManager} typically sharecommon infrastructure, for example, a common {@link ClassLoader} andimplementation specific {@link Properties}.
Implementations of {@link CacheManager} may additionally provide and shareexternal resources between the {@link Cache}s being managed, for example, the content of the managed {@link Cache}s may be stored in the same cluster.
By default {@link CacheManager} instances are typically acquired through theuse of a {@link CachingProvider}. Implementations however may additionally provide other mechanisms to create, acquire, manage and configure {@link CacheManager}s, including:
- making use of {@link java.util.ServiceLoader}s,
- permitting the use of the
new
operator to create a concrete implementation, - providing the construction through the use of one or more builders, and
- through the use of dependency injection.
The default {@link CacheManager} however can always be acquired using thedefault configured {@link CachingProvider} obtained by the {@link Caching}class. For example:
CachingProvider provider = Caching.getCachingProvider(); CacheManager manager = provider.getCacheManager();
Within a Java process {@link CacheManager}s and the {@link Cache}s they manage are scoped and uniquely identified by a {@link URI}, the meaning of which is implementation specific. To obtain the default {@link URI}, {@link ClassLoader} and {@link Properties} for an implementation, consult the{@link CachingProvider} class.
@author Greg Luck
@author Yannis Cosmadopoulos
@author Brian Oliver
@see Caching
@see CachingProvider
@see Cache
@since 1.0