org.erights.e.elib.serial
Class Unserializer

java.lang.Object
  |
  +--org.erights.e.elib.serial.Reviver
        |
        +--org.erights.e.elib.serial.Unserializer

public class Unserializer
extends Reviver

Safe: Used to specialize the UnserializationStream for reviving from state serialized using a corresponding Serializer, where this reviving uses no magic authority.

Therefore, we declare the class Unserializer to be safe.

Unserializer is specializable from E by providing a reviveFunc so that, on reincarnating for example, a restored object may be revives as a different object to be checkpointed as its representative.

Author:
Mark S. Miller

Field Summary
private  OneArgFunc myReviveFunc
           
static Unserializer THE_ONE
          Enabled: The canonical instance
 
Constructor Summary
Unserializer(OneArgFunc reviveFunc)
          Enabled:
 
Method Summary
 Object substitute(Object ref)
          Enabled: Currently, just returns reviveFunc(ref).
 
Methods inherited from class org.erights.e.elib.serial.Reviver
getUnserializationStream, play, playFile
 
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 Unserializer THE_ONE
Enabled: The canonical instance


myReviveFunc

private final OneArgFunc myReviveFunc
Constructor Detail

Unserializer

public Unserializer(OneArgFunc reviveFunc)
Enabled:

Parameters:
reviveFunc -
Method Detail

substitute

public Object substitute(Object ref)
Enabled: Currently, just returns reviveFunc(ref).

XXX Bug: Must make sure that classes are safe and that (therefore?) instances are instances of classes that grant no authority by virtue of creation.

Specified by:
substitute in class Reviver
Parameters:
ref - The object that was reconstructed from the serialization stream.
Returns:
The object to return in its stead -- as its revival.


comments?