Package javax.cache
Interface CacheLifecycle
-
- All Known Subinterfaces:
Cache<K,V>
- All Known Implementing Classes:
CacheImpl
public interface CacheLifecycleCache resources may have non-trivial initialisation and disposal procedures. As such it is unrealistic to expect them to be avaiable for service after object creation. This interface defines a lifecycle for these resources and associates aStatuswith each. TheStatusof a newly created resource isStatus.UNINITIALISED.- Since:
- 1.0
- Author:
- Greg Luck
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StatusgetStatus()Returns the cache status.voidstart()Notifies providers to start themselves.voidstop()Providers may be doing all sorts of exotic things and need to be able to clean up on stop.
-
-
-
Method Detail
-
start
void start()
Notifies providers to start themselves. This method is called during the resource's start method after it has changed its status to alive. Cache operations are legal in this method. At the completion of this method invocationgetStatus()must returnStatus.STARTED.- Throws:
CacheException- if ????? TODO describe when
-
stop
void stop()
Providers may be doing all sorts of exotic things and need to be able to clean up on stop. Cache operations are illegal after this method is called. AIllegalStateExceptionwill be Resources will change status toStatus.STOPPEDwhen this method completes. Stop must free any JVM resources used.- Throws:
CacheException- if ????? TODO describe whenIllegalStateException- thrown if an operation is performed on a cache unless it is started.
-
-