public interface CustomPassivationMechanism
An object that reports on, saves, loads, and deletes passivated PRPC session data. This interface is provided as an extension point that allow's PRPC's passivation mechanism to use any third-party storage provider. Implementers of this interface do not need detailed knowledge of PRPC's internals. Implementers of this interface must provide a public, zero argument constructor so that instances can be safely created via reflection. Once a class implements this interface has been installed into PRPC's code base, it can be activated by setting the following prconfig settings:
<env name="initialization/persistrequestor/storage" value="custom" />: Setting this value to 'custom' indicates to PRPC that you wish to use a custom passivation mechanism. <env name="initialization/persistrequestor/storage/custom/class" value="com.custom.ImplementationClassName" />: Set this value to the fully-qualified class name of a class that implements this interface. If this class cannot be found on node startup, PRPC will fall back to filesystem passivation.Note that all methods on this interface can and will be called concurrently from multiple threads. It is therefore necessary that all implementations are thread safe.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT |
static java.lang.String |
VERSION |
Modifier and Type | Method and Description |
---|---|
void |
delete(PassivationKey aPartialKey)
Delete all
PassivationRecord s that match the provided partial key. |
void |
initialize()
Use this method for any initialization code, it is called by PRPC during node startup.
|
java.util.Iterator<PassivationDigest> |
list(PassivationKey aPartialKey,
java.lang.String aOperatorId,
java.lang.String aSystemId,
java.util.Date aExpiredBefore)
List
PassivationDigest s that match the given search criteria. |
PassivationRecord |
load(PassivationKey aKey)
Load a
PassivationRecord matching the provided key. |
void |
save(PassivationRecord aRecord)
Save the given
PassivationRecord , overwriting any existing record with the same PassivationKey . |
void |
shutdown()
This method will be called during PRPC's shutdown sequence.
|
static final java.lang.String VERSION
static final java.lang.String COPYRIGHT
java.util.Iterator<PassivationDigest> list(PassivationKey aPartialKey, java.lang.String aOperatorId, java.lang.String aSystemId, java.util.Date aExpiredBefore) throws java.lang.Exception
PassivationDigest
s that match the given search criteria. After this object has been shutdown()
, this method should always return an empty
Iterator
.aPartialKey
- A PassivationKey
, which may be a partially specified key. All returned PassivationDigest.getKey()
must match this key as specified in
PassivationKey.matches(PassivationKey)
.aOperatorId
- An operator ID, which may be null
. If non-null, all returned PassivationDigest.getMetadata()
objects must have an operator ID that exactly
matches the provided operator ID.aSystemId
- A PRPC unique system identifier, which may be null
. If non-null, all returned PassivationDigest.getMetadata()
objects must have a system ID
that exactly matches the provided system ID.aExpiredBefore
- A date, which may be null
. If non-null, all returned PassivationDigest.getMetadata()
objects must have an expiration time before the
provided date.Iterator
over all PassivationDigest
s that match the search criteria. If there are no matches, return an empty Iterator
.java.lang.Exception
- If there are any fatal errors, throw from any type extending Exception
.void delete(PassivationKey aPartialKey) throws java.lang.Exception
PassivationRecord
s that match the provided partial key. After this object has been shutdown()
, this method should do nothing when called.aPartialKey
- PassivationKey
, which may be a partially specified key. All deleted PassivationDigest.getKey()
must match this key as specified in
PassivationKey.matches(PassivationKey)
.java.lang.Exception
- If there are any fatal errors, throw from any type extending Exception
.PassivationRecord load(PassivationKey aKey) throws java.lang.Exception
PassivationRecord
matching the provided key. After this object has been shutdown()
, this method should always return null
.aKey
- An exact key for a PassivationRecord
. This will never be a partial key and therefore cannot have type PassivationKey.Type.ANY
.PassivationRecord
with the provided key, or null
if there is no record for the given key.java.lang.Exception
- If there are any fatal errors, throw from any type extending Exception
.void save(PassivationRecord aRecord) throws java.lang.Exception
PassivationRecord
, overwriting any existing record with the same PassivationKey
. After this object has been shutdown()
, this method
should do nothing when called.aRecord
- The record to save.java.lang.Exception
- If there are any fatal errors, throw from any type extending Exception
.void initialize() throws java.lang.Exception
java.lang.Exception
- If there are any fatal errors, throw from any type extending Exception
. If errors are thrown from this method, PRPC will fall back to using file system
passivation.void shutdown()
load(PassivationKey)
should return null
and save(PassivationRecord)
should take no action. Note that
errors occurring during shutdown()
are considered non-fatal, so this method throws no exceptions.Copyright © 2015 Pegasystems Inc. All Rights Reserved.