org.ehcache
Interface UserManagedCache<K,V>

Type Parameters:
K - the type of the keys used to access data within this cache
V - the type of the values held within this cache
All Superinterfaces:
Cache<K,V>, java.lang.Iterable<Cache.Entry<K,V>>
All Known Subinterfaces:
PersistentUserManagedCache<K,V>
All Known Implementing Classes:
Ehcache, PersistentUserManagedEhcache

public interface UserManagedCache<K,V>
extends Cache<K,V>

Represents a Cache that is not managed by a CacheManager, as such that needs to have close() invoked in order to release all its resources.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.ehcache.Cache
Cache.Entry<K,V>
 
Method Summary
 void close()
          Releases all data held in this UserManagedCache.
 Status getStatus()
          Returns the current Status for this CacheManager
 void init()
          Attempts at having this UserManagedCache go to Status.AVAILABLE.
 
Methods inherited from interface org.ehcache.Cache
clear, containsKey, get, getAll, getRuntimeConfiguration, put, putAll, putIfAbsent, remove, remove, removeAll, replace, replace
 
Methods inherited from interface java.lang.Iterable
iterator
 

Method Detail

init

void init()
Attempts at having this UserManagedCache go to Status.AVAILABLE.

Should this throw, while the UserManagedCache isn't yet Status.AVAILABLE, it will try to go back to Status.UNINITIALIZED properly.

Throws:
java.lang.IllegalStateException - if the UserManagedCache isn't in Status.UNINITIALIZED state
StateTransitionException - if the UserManagedCache couldn't be made Status.AVAILABLE
java.lang.RuntimeException - if any exception is thrown, but still results in the UserManagedCache transitioning to Status.AVAILABLE

close

void close()
Releases all data held in this UserManagedCache.

Should this throw, while the UserManagedCache isn't yet Status.UNINITIALIZED, it will keep on trying to go to Status.UNINITIALIZED properly.

Throws:
StateTransitionException - if the UserManagedCache couldn't be cleanly made Status.UNINITIALIZED, wrapping the first exception encountered
java.lang.RuntimeException - if any exception is thrown, like from Listeners

getStatus

Status getStatus()
Returns the current Status for this CacheManager

Returns:
the current Status