Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
public interface PersistentMBean
load()
method should be
called on construction in order to reload the stored
state. The store()
method should be called
sometime during the bean's lifetime in order to create
a persistent copy of the bean's instance data. This
method may also be called by the MBeanServer
as a result of the Descriptor
of an
javax.management.modelmbean.ModelMBean
.
Method Summary | |
void | |
void |
public void load() throws MBeanException, RuntimeOperationsException, InstanceNotFoundException
Instantiates the bean with the data previously stored using a call tostore()
. The data stored can include values held by attributes as well as those returned by operations. This method should be called during construction or initialisation of the bean, before it becomes registered with anMBeanServer
.
- Throws:
MBeanException
- if persistence is not supported, or another exception is thrown (which this then wraps).RuntimeOperationsException
- if the persistence mechanism throws an exception.InstanceNotFoundException
- if the bean can not be found in the persistent store.
public void store() throws MBeanException, RuntimeOperationsException, InstanceNotFoundException
Captures the current state of the bean and stores it for future retrieval by theload()
method. The data stored can include values held by attributes as well as those returned by operations.Whether the state is stored or not depends on the
persistPolicy
field of the MBean/attribute descriptor. The state should be stored if the policy is set to any of the following:
always
onTimer
andnow
is greater than or equal tolastPersistTime + persistPeriod
.noMoreOftenThan
andnow
is greater than or equal tolastPersistTime + persistPeriod
.- onUnregister
If the policy is set to any of the following, the state should not be stored:
never
onUpdate
onTimer
andnow
is less thanlastPersistTime + persistPeriod
.
- Throws:
MBeanException
- if persistence is not supported, or another exception is thrown (which this then wraps).RuntimeOperationsException
- if the persistence mechanism throws an exception.InstanceNotFoundException
- if the persistent store can not be found or accessed.