javax.management
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
.void load() throws MBeanException, RuntimeOperationsException, InstanceNotFoundException
store()
. 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 an MBeanServer
.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.void store() throws MBeanException, RuntimeOperationsException, InstanceNotFoundException
Captures the current state of the bean and stores it
for future retrieval by the load()
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
and now
is
greater than or equal to lastPersistTime +
persistPeriod
.noMoreOftenThan
and now
is
greater than or equal to lastPersistTime +
persistPeriod
.If the policy is set to any of the following, the state should not be stored:
never
onUpdate
onTimer
and now
is
less than lastPersistTime + persistPeriod
.
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.