public interface ConfigurableCacheFactory
DefaultConfigurableCacheFactory
Modifier and Type | Method and Description |
---|---|
void |
activate()
Activate prepares the factory to be used within a container and should be called before any other factory method.
|
void |
destroyCache(NamedCache<?,?> cache)
Release and destroy this instance of NamedCache.
|
void |
dispose()
Dispose of this factory.
|
default NamedCache<Object,Object> |
ensureCache(String sCacheName, ClassLoader loader)
Ensure an Object-based cache for the given name.
|
Service |
ensureService(String sServiceName)
Ensure a service for the given name.
|
<K,V> NamedCache<K,V> |
ensureTypedCache(String sCacheName, ClassLoader loader, TypeAssertion<K,V> assertion)
Ensure a cache for the given name satisfying the specified type assertion.
|
InterceptorRegistry |
getInterceptorRegistry()
Return the
InterceptorRegistry for this factory. |
ResourceRegistry |
getResourceRegistry()
Return the
ResourceRegistry for this factory. |
boolean |
isCacheActive(String sCacheName, ClassLoader loader)
Validate whether a cache with the given name is active in the context of the given
ClassLoader . |
void |
releaseCache(NamedCache<?,?> cache)
Release a cache and its associated resources.
|
void activate()
IllegalStateException
- if this factory has already been activatedvoid dispose()
getResourceRegistry()
. This factory may not be used after invoking dispose.IllegalStateException
- if this factory is not activedefault NamedCache<Object,Object> ensureCache(String sCacheName, ClassLoader loader)
sCacheName
- the cache nameloader
- ClassLoader that should be used to deserialize objects in the cache<K,V> NamedCache<K,V> ensureTypedCache(String sCacheName, ClassLoader loader, TypeAssertion<K,V> assertion)
sCacheName
- the cache nameloader
- the ClassLoader
to use for deserializing cache entriesassertion
- the TypeAssertion
for asserting the type of keys and values for the NamedCachevoid releaseCache(NamedCache<?,?> cache)
Releasing a cache makes it no longer usable, but does not affect the cache itself. In other words, all other references to the cache will still be valid, and the cache data is not affected by releasing the reference. Any attempt to use the released cache reference afterword will result in an exception.
cache
- the cache to releasevoid destroyCache(NamedCache<?,?> cache)
Warning: This method is used to completely destroy the specified cache across the cluster. All references in the entire cluster to this cache will be invalidated, the cached data will be cleared, and all internal and associated resources will be released.
cache
- the cache to releaseService ensureService(String sServiceName)
sServiceName
- the service nameInterceptorRegistry getInterceptorRegistry()
InterceptorRegistry
for this factory. EventInterceptor
s registered with this registry will be scoped to services and caches created by this factory.InterceptorRegistry
for this factoryResourceRegistry getResourceRegistry()
ResourceRegistry
for this factory.boolean isCacheActive(String sCacheName, ClassLoader loader)
ClassLoader
. The ClassLoader should be the same as provided to a previous call to ensureCache(String sCacheName, ClassLoader loader)
.sCacheName
- the cache nameloader
- the ClassLoader that should be used to deserialize objects in the cache