org.jboss.serial.persister
Class ClassReferencePersister
java.lang.Object
org.jboss.serial.persister.ClassReferencePersister
- All Implemented Interfaces:
- Persister
public class ClassReferencePersister
- extends java.lang.Object
- implements Persister
$Id: ClassReferencePersister.java,v 1.19 2006/06/08 16:39:43 csuconic Exp $
- Author:
- Clebert Suconic
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ClassReferencePersister
public ClassReferencePersister()
getId
public byte getId()
- Description copied from interface:
Persister
- You need to always return what was sent by setId. This is to enable Streaming to discover what Persister to use
- Specified by:
getId
in interface Persister
setId
public void setId(byte id)
- Specified by:
setId
in interface Persister
writeData
public void writeData(ClassMetaData clazzMetaData,
java.io.ObjectOutput output,
java.lang.Object obj,
ObjectSubstitutionInterface substitution)
throws java.io.IOException
- Specified by:
writeData
in interface Persister
- Throws:
java.io.IOException
readData
public 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
- Specified by:
readData
in interface Persister
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.
- Returns:
-
- Throws:
java.io.IOException
canPersist
public boolean canPersist(java.lang.Object obj)
- Description copied from interface:
Persister
- Ask the persister if the persister can handle this object
- Specified by:
canPersist
in interface Persister
JBoss Serialization, a new approach to java-serialization.