org.ehcache
Interface UserManagedCache<K,V>

Type Parameters:
K - the key type for the cache
V - the value type for the cache
All Superinterfaces:
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 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
 void close()
          Transitions this UserManagedCache to UNINITIALIZED.
 Status getStatus()
          Returns the current Status of this UserManagedCache.
 void init()
          Transitions this UserManagedCache to 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()
          throws StateTransitionException
Transitions this UserManagedCache to AVAILABLE.

If an error occurs before the UserManagedCache is AVAILABLE, it will revert to UNINITIALIZED and attempt to properly release all resources.

Throws:
java.lang.IllegalStateException - if the UserManagedCache is not UNINITIALIZED
StateTransitionException - if the UserManagedCache could not be made AVAILABLE

close

void close()
           throws StateTransitionException
Transitions this UserManagedCache to UNINITIALIZED.

This will release all resources held by this cache.

Failure to release a resource will not prevent other resources from being released.

Specified by:
close in interface java.io.Closeable
Throws:
StateTransitionException - if the UserManagedCache could not reach UNINITIALIZED cleanly
java.lang.IllegalStateException - if the UserManagedCache is not AVAILABLE

getStatus

Status getStatus()
Returns the current Status of this UserManagedCache.

Returns:
the current Status