Interface ICacheService
public interface ICacheService
-
Method Summary
Modifier and TypeMethodDescription<K,V> javax.cache.Cache<K, V> Looks up a managedCachegiven its name.voidregisterCacheableService(CacheableService<?, ?> cs) Registers a new CacheableServicevoidshutdown()Shutdown the cache service and the cache manager.
-
Method Details
-
getCache
Looks up a managedCachegiven its name.Use this method to check runtime key and value types.
Use
getCache(String)where this check is not required.Implementations must ensure that the key and value types are the same as those configured for the
Cacheprior to returning from this method.Implementations may further perform type checking on mutative cache operations and throw a
ClassCastExceptionif these checks fail.Implementations that support declarative mechanisms for pre-configuring
Caches may return a pre-configuredCacheinstead ofnull.- Type Parameters:
K- the type of keyV- the type of value- Parameters:
cacheName- the name of the managedCacheto acquirekeyType- the expectedClassof the keyvalueType- the expectedClassof the value- Returns:
- the Cache or null if it does exist or can't be pre-configured
- Throws:
IllegalStateException- if theCacheManageris#isClosed()ClassCastException- if the specified key and/or value types are incompatible with the configured cache.NullPointerException- if either keyType or classType is null.SecurityException- when the operation could not be performed due to the current security settings
-
shutdown
void shutdown()Shutdown the cache service and the cache manager. Should be called when the webapp is stopped. -
registerCacheableService
Registers a new CacheableService- Parameters:
cs- The CacheableService
-