org.erights.e.elib.serial
Class Replacer

java.lang.Object
  |
  +--org.erights.e.elib.serial.Replacer
Direct Known Subclasses:
CapTPReplacer, PersistenceReplacer, Serializer

public abstract class Replacer
extends Object

Untamed: Used to parameterize a SerializationStream.

Replacer will probably need more parameters, but we should add them as we find we need them, rather than create another subclass.

Likely additional parameters:

Author:
Mark S. Miller

Constructor Summary
Replacer()
          Enabled:
 
Method Summary
 SerializationStream getSerializationStream(OutputStream out)
          Enabled:
 byte[] record(Object specimen)
          Enabled: Record the seriaized form of the specimen and return the resulting byte array.
 void recordFile(File file, Object specimen)
          Enabled:
protected abstract  Object substitute(Object ref)
          Called by SerializationStream to change what gets serialized.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Replacer

public Replacer()
Enabled:

Method Detail

substitute

protected abstract Object substitute(Object ref)
Called by SerializationStream to change what gets serialized.

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

getSerializationStream

public SerializationStream getSerializationStream(OutputStream out)
                                           throws IOException
Enabled:

Parameters:
out -
Returns:
Throws:
IOException

record

public byte[] record(Object specimen)
              throws IOException
Enabled: Record the seriaized form of the specimen and return the resulting byte array.

Such recordings can be play()ed by a corresponding Reviver.

IOException

recordFile

public void recordFile(File file,
                       Object specimen)
                throws IOException
Enabled:

IOException


comments?