Package org.ehcache
Interface UserManagedCache<K,V>
-
- Type Parameters:
K- the key type for the cacheV- the value type for the cache
- All Superinterfaces:
java.lang.AutoCloseable,Cache<K,V>,java.io.Closeable,java.lang.Iterable<Cache.Entry<K,V>>
- All Known Subinterfaces:
PersistentUserManagedCache<K,V>
public interface UserManagedCache<K,V> extends Cache<K,V>, java.io.Closeable
Represents aCachethat is not managed by aCacheManager.These caches must be
closedin order to release all their resources.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.ehcache.Cache
Cache.Entry<K,V>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()Transitions thisUserManagedCachetoUNINITIALIZED.StatusgetStatus()Returns the currentStatusof thisUserManagedCache.voidinit()Transitions thisUserManagedCachetoAVAILABLE.-
Methods inherited from interface org.ehcache.Cache
clear, containsKey, get, getAll, getRuntimeConfiguration, iterator, put, putAll, putIfAbsent, remove, remove, removeAll, replace, replace
-
-
-
-
Method Detail
-
init
void init() throws StateTransitionException
Transitions thisUserManagedCachetoAVAILABLE.If an error occurs before the
UserManagedCacheisAVAILABLE, it will revert toUNINITIALIZEDand attempt to properly release all resources.- Throws:
java.lang.IllegalStateException- if theUserManagedCacheis notUNINITIALIZEDStateTransitionException- if theUserManagedCachecould not be madeAVAILABLE
-
close
void close() throws StateTransitionExceptionTransitions thisUserManagedCachetoUNINITIALIZED.This will release all resources held by this cache.
Failure to release a resource will not prevent other resources from being released.
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
StateTransitionException- if theUserManagedCachecould not reachUNINITIALIZEDcleanlyjava.lang.IllegalStateException- if theUserManagedCacheis notAVAILABLE
-
-