A media-specific persistence handler for reading and writing
snapshots.
PersistencePlugin defines the API that media-specific persistence
plugins must implement. A persistence plugin defines a medium that
can be used to store a series of persistence snapshots. When an
agent restarts, a set of these snapshots called a rehydration set
is retrieved from the persistence medium to reconstitute or
"rehydrate" the previous state of the agent.
getDatabaseConnection(Object locker) Get the connection to the database into which persistence
deltas are being written for coordinated transaction
management.
init(PersistencePluginSupport pps, String name, String[] params, boolean deleteOldPersistence) Initialize the plugin with PersistencePluginSupport and
parameters.
boolean
isWritable() Is this persistence medium writable? Non-writable media are only
used for rehydration.
void
lockOwnership() Lock out other instances of this agent.
releaseDatabaseConnection(Object locker) Release the connection to the database into which persistence
deltas are being written for coordinated transaction
management.
Clean up after output was aborted.
Called in response to an exception during the writing of the
current stream.
Parameters: retainNumbers - the numbers of the deltas excluding theone just written that comprise a complete rehydration set.Subsequent calls to readSequenceNumbers should return thesevalues.
Cleanup old deltas as specified by cleanupNumbers. These deltas
are never part of the current state. When archiving is
enabled, the old deltas constituting an archive are not
discarded.
Parameters: cleanupNumbers - the numbers to be discarded (or archived).
Clean up after closing the output stream. This method is called
within a mutual exclusion semaphore such that multiple
instances of the same agent cannot both be calling this or
related methods. This is the opportunity to rename the output
stream to its real identity.
Parameters: retainNumbers - the numbers of the deltas including theone just written that comprise a complete rehydration set.Subsequent calls to readSequenceNumbers should return thesevalues.
Gets the names of all media-specific controls. The names of
these controls must not conflict with the
(@link BasePersistence#getMediaControlNames names that all
media plugins have}.
an array of the names of the controls for this mediaplugin.
Gets the list of allowed ranges for values of the named
control. Values supplied to
PersistencePlugin.setControl are guaranteed
to be in the specified ranges.
the list or allowed ranges.
Get the connection to the database into which persistence
deltas are being written for coordinated transaction
management. Non-database implementations should throw an
UnsupportedOperationException
Gets the name of the PersistencePlugin. Every PersistencePlugin
should have a distinct name. The name can be computed by the
plugin based on its class and parameters or it can be specified
as an argument in the constructor.
Get a specific plugin parameter.
Parameters: i - the index of the desired parameter. Must be between 0(inclusive) and the value returned byPersistencePlugin.getParamCount getParamCount (exclusive). the value of the specified parameter.
Initialize the plugin with PersistencePluginSupport and
parameters. After initialization, the plugin should be ready to
service all methods.
Parameters: pps - the persistence plugin support specifies the contextwithin which persistence is being performed. Parameters: name - the name of this plugin. Parameters: params - String parameters to configure the plugin. Theparameters come from configuration information andinterpretation is up to the plugin.
Open an OutputStream onto which a persistence delta can be
written. The stream returned should be relatively non-blocking
since it is possible for the entire agent to be blocked waiting
for completion. Implementations that may block indefinitely
should perform buffering as needed. Also, the OutputStream
should be unique relative to other instances of the same agent
Parameters: deltaNumber - the number of the delta that will bewritten. Numbers are never re-used so this number can be usedto uniquely identify the delta. Parameters: full - indicates that the information to be written is acomplete state dump and does not depend on any earlier deltas.It may be useful to distinctively mark such deltas.
Read the specified set of sequence numbers. These numbers
should identify a complete set of persistence deltas needed to
restore the specified state. A specific archive may be
specified using the suffix argument.
an array of possible rehydration sets. The timestamp ofeach indicates how recent each rehydration set is. Parameters: suffix - identifies which set of persistence deltas arewanted. A non-empty suffix specifies an specific, archivedstate. An empty suffix specifies all available sets.
Release the connection to the database into which persistence
deltas are being written for coordinated transaction
management. Non-database implementations should throw an
UnsupportedOperationException
Set value of a particular control. Values are guaranteed to be
in the ranges specified by
PersistencePlugin.getControlValues Parameters: controlName - the name of the control Parameters: newValue - the new value of the control
Store an encrypted key for a particular delta number
Parameters: deltaNumber - the number of the delta for which the key is used. Parameters: key - has the encrypted key to be stored