org.erights.e.elib.serial
Class Serializer

java.lang.Object
  |
  +--org.erights.e.elib.serial.Replacer
        |
        +--org.erights.e.elib.serial.Serializer

public final class Serializer
extends Replacer

Safe: A SerializationStream as specialized by a Serializer should represent no magic authority -- the serialized infomation it produces should only include information obtainable by unprivileged code all written in E.

Therefore, we declare the class Serializer to be safe.

Serializer is specializable from E by providing replaceFunc(ref) so that, on checkpointing for example, 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 Unserializer.

Author:
Mark S. Miller

Field Summary
private  OneArgFunc myReplaceFunc
           
static Serializer THE_ONE
          Enabled: The canonical instance
 
Constructor Summary
Serializer(OneArgFunc replaceFunc)
          Enabled:
 
Method Summary
 Object substitute(Object ref)
          Enabled:
 
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

THE_ONE

public static final Serializer THE_ONE
Enabled: The canonical instance


myReplaceFunc

private final OneArgFunc myReplaceFunc
Constructor Detail

Serializer

public Serializer(OneArgFunc replaceFunc)
Enabled:

Parameters:
replaceFunc -
Method Detail

substitute

public Object substitute(Object ref)
Enabled:

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?