org.jboss.serial.persister
Interface Persister

All Known Implementing Classes:
ArrayPersister, ClassReferencePersister, ExternalizePersister, ProxyPersister, RegularObjectPersister

public interface Persister

Interface used to define how to load complex objects from the repository or streaming $Id: Persister.java,v 1.11 2006/04/24 23:49:40 csuconic Exp $

Author:
clebert suconic

Method Summary
 boolean canPersist(java.lang.Object obj)
          Ask the persister if the persister can handle this object
 byte getId()
          You need to always return what was sent by setId.
 java.lang.Object readData(java.lang.ClassLoader loader, StreamingClass streaming, ClassMetaData metaData, int referenceId, ObjectsCache cache, java.io.ObjectInput input, ObjectSubstitutionInterface substitution)
           
 void setId(byte id)
           
 void writeData(ClassMetaData metaData, java.io.ObjectOutput out, java.lang.Object obj, ObjectSubstitutionInterface substitution)
           
 

Method Detail

getId

byte getId()
You need to always return what was sent by setId. This is to enable Streaming to discover what Persister to use


setId

void setId(byte id)

writeData

void writeData(ClassMetaData metaData,
               java.io.ObjectOutput out,
               java.lang.Object obj,
               ObjectSubstitutionInterface substitution)
               throws java.io.IOException
Throws:
java.io.IOException

readData

java.lang.Object readData(java.lang.ClassLoader loader,
                          StreamingClass streaming,
                          ClassMetaData metaData,
                          int referenceId,
                          ObjectsCache cache,
                          java.io.ObjectInput input,
                          ObjectSubstitutionInterface substitution)
                          throws java.io.IOException
Parameters:
loader -
metaData -
referenceId -
cache - It's the persister job to assign the cache with a created object, right after its creation, as if in case of circular references those references are respected.
input -
substitution -
Returns:
Throws:
java.io.IOException

canPersist

boolean canPersist(java.lang.Object obj)
Ask the persister if the persister can handle this object



JBoss Serialization, a new approach to java-serialization.