JBoss Marshalling 1.3.0.CR9

org.jboss.marshalling
Class ChainingObjectTable

java.lang.Object
  extended by org.jboss.marshalling.ChainingObjectTable
All Implemented Interfaces:
ObjectTable

public class ChainingObjectTable
extends Object
implements ObjectTable

An object table that multiplexes up to 256 class tables. The protocol works by prepending the custom object table with an identifier byte.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.jboss.marshalling.ObjectTable
ObjectTable.Writer
 
Constructor Summary
ChainingObjectTable(ObjectTable[] objectTables)
          Construct a new instance.
 
Method Summary
 ObjectTable.Writer getObjectWriter(Object obj)
          Determine whether the given object reference is a valid predefined reference.
 Object readObject(Unmarshaller unmarshaller)
          Read an instance from the stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChainingObjectTable

public ChainingObjectTable(ObjectTable[] objectTables)
Construct a new instance. The given array may be sparse, but it may not be more than 256 elements in length. Object tables are checked in order of increasing array index.

Parameters:
objectTables - the object tables to delegate to
Method Detail

getObjectWriter

public ObjectTable.Writer getObjectWriter(Object obj)
                                   throws IOException
Determine whether the given object reference is a valid predefined reference.

Specified by:
getObjectWriter in interface ObjectTable
Parameters:
obj - the candidate object
Returns:
the object writer, or null to use the default mechanism
Throws:
IOException - if an I/O error occurs

readObject

public Object readObject(Unmarshaller unmarshaller)
                  throws IOException,
                         ClassNotFoundException
Read an instance from the stream. The instance will have been written by the ObjectTable.getObjectWriter(Object) method's Writer instance, as defined above.

Specified by:
readObject in interface ObjectTable
Parameters:
unmarshaller - the unmarshaller to read from
Returns:
the object instance
Throws:
IOException - if an I/O error occurs
ClassNotFoundException - if a class could not be found

JBoss Marshalling 1.3.0.CR9

Copyright © 2011 JBoss, a division of Red Hat, Inc.