org.erights.e.extern.persist
Class PersistenceReplacer

java.lang.Object
  |
  +--org.erights.e.elib.serial.Replacer
        |
        +--org.erights.e.extern.persist.PersistenceReplacer

public class PersistenceReplacer
extends Replacer

Untamed: Used to specialize the SerializationStream so that, on checkpointing, a live object may be replaced by a different object to be checkpointed as its representative.

The corresponding revived object is not simply this representative. It is this representative as resolved by org.erights.e.extern.persist.PersistenceReviver.

Author:
Mark S. Miller

Field Summary
private  boolean myIsStrict
          Do we blow up on a NEAR reference to a non-Persistent (strict), or do we instead serialize a broken reference (non-strict)?
private  ConstMap myScalpel
          A mapping from nears to Strings.
 
Constructor Summary
PersistenceReplacer(ConstMap scalpel)
          Enabled: isStrict defaults to true.
PersistenceReplacer(ConstMap scalpel, boolean isStrict)
          Enabled:
 
Method Summary
 Object substitute(Object ref)
          Enabled: XXX comment is stale:
 
Methods inherited from class org.erights.e.elib.serial.Replacer
getSerializationStream, record, recordFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myScalpel

private final ConstMap myScalpel
A mapping from nears to Strings.


myIsStrict

private final boolean myIsStrict
Do we blow up on a NEAR reference to a non-Persistent (strict), or do we instead serialize a broken reference (non-strict)?

Constructor Detail

PersistenceReplacer

public PersistenceReplacer(ConstMap scalpel)
Enabled: isStrict defaults to true.


PersistenceReplacer

public PersistenceReplacer(ConstMap scalpel,
                           boolean isStrict)
Enabled:

Method Detail

substitute

public Object substitute(Object ref)
Enabled: XXX comment is stale:

If ref isPersistent, then this currently just returns ref; otherwise an appropriately broken reference.

This way, a non-persistent object in a graph doesn't prevent the graph from being checkpointed. However, that doesn't mean such a partially-broken graph will be revivable or useful.

Specified by:
substitute in class Replacer
Parameters:
ref - The object that needs to somehow get serialized.
Returns:
The object to actually serialize in its stead -- its representative.


comments?