|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.cache.LifecycleManager
public class LifecycleManager
Added in 2.2.0 to handle the lifecycle of the cache. I.e., to control the starting and stopping process, as defined
by the Cache.start()
and Cache.stop()
API methods.
ComponentRegistry
, which it constructs in its constructor
as a place to hold all components of a given cache instance.
It also holds the status of the cache, which can be queried.
Constructor Summary | |
---|---|
LifecycleManager(Configuration configuration)
Constructs a new instance, also constructs a ComponentRegistry instance which can
then be retrieved using getComponentRegistry() . |
Method Summary | |
---|---|
void |
create()
Creates the components needed by a cache instance and sets the cache status to CacheStatus.CREATED
when it is done. |
void |
destroy()
Destroys the cache and frees up any resources. |
CacheStatus |
getCacheStatus()
|
ComponentRegistry |
getComponentRegistry()
|
void |
initialize(Configuration configuration,
Notifier notifier,
RegionManager regionManager,
NodeFactory nodeFactory,
DataContainer cacheData,
BuddyManager buddyManager,
RPCManager rpcManager,
ComponentRegistry componentRegistry)
|
boolean |
invocationsAllowed(boolean originLocal)
Asserts whether invocations are allowed on the cache or not. |
void |
setCacheStatus(CacheStatus cacheStatus)
|
void |
start()
Starts the components needed by a cache instance, and then starts the cache instance itself. |
void |
stop()
Stops the cache and sets the cache status to CacheStatus.STOPPED once it is done. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LifecycleManager(Configuration configuration)
ComponentRegistry
instance which can
then be retrieved using getComponentRegistry()
. When constructed, the cache status is set to CacheStatus.INSTANTIATED
.
configuration
- with which to create this class.Method Detail |
---|
public void initialize(Configuration configuration, Notifier notifier, RegionManager regionManager, NodeFactory nodeFactory, DataContainer cacheData, BuddyManager buddyManager, RPCManager rpcManager, ComponentRegistry componentRegistry)
public void create() throws CacheException
CacheStatus.CREATED
when it is done.
CacheException
- if there is a problem with construction.public void start() throws CacheException
CacheStatus.STARTED
once it is done.
If the cache status is not CacheStatus.CREATED
when this is called, it will first call create()
to create the cache.
CacheException
- if there is a problem with starting the cache.public void destroy()
CacheStatus.DESTROYED
when it is done.
If the cache is in CacheStatus.STARTED
when this method is called, it will first call stop()
to stop the cache.
public void stop()
CacheStatus.STOPPED
once it is done. If the cache is not in
the CacheStatus.STARTED
state, this is a no-op.
public boolean invocationsAllowed(boolean originLocal)
CacheStatus.STARTING
,
this method will block for up to Configuration.getStateRetrievalTimeout()
millis, checking
for a valid state.
originLocal
- true if the call originates locally (i.e., from the CacheInvocationDelegate
or false if it originates remotely, i.e., from the CommandAwareRpcDispatcher
.
public CacheStatus getCacheStatus()
public ComponentRegistry getComponentRegistry()
public void setCacheStatus(CacheStatus cacheStatus)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |