Package org.ehcache
Interface UserManagedCache<K,V>
- Type Parameters:
K- the key type for the cacheV- the value type for the cache
- All Superinterfaces:
AutoCloseable,Cache<K,,V> Closeable,Iterable<Cache.Entry<K,V>>
- All Known Subinterfaces:
PersistentUserManagedCache<K,V>
Represents a
Cache that is not managed by a CacheManager.
These caches must be closed in order to release all their resources.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.ehcache.Cache
Cache.Entry<K,V> -
Method Summary
Methods inherited from interface org.ehcache.Cache
clear, containsKey, get, getAll, getRuntimeConfiguration, iterator, put, putAll, putIfAbsent, remove, remove, removeAll, replace, replaceMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
init
Transitions thisUserManagedCachetoAVAILABLE.If an error occurs before the
UserManagedCacheisAVAILABLE, it will revert toUNINITIALIZEDand attempt to properly release all resources.- Throws:
IllegalStateException- if theUserManagedCacheis notUNINITIALIZEDStateTransitionException- if theUserManagedCachecould not be madeAVAILABLE
-
close
Transitions 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 interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
StateTransitionException- if theUserManagedCachecould not reachUNINITIALIZEDcleanlyIllegalStateException- if theUserManagedCacheis notAVAILABLE
-
getStatus
Status getStatus()Returns the currentStatusof thisUserManagedCache.- Returns:
- the current
Status
-