JBoss Marshalling 1.3.0.CR9

org.jboss.marshalling
Class ChainingClassTable

java.lang.Object
  extended by org.jboss.marshalling.ChainingClassTable
All Implemented Interfaces:
ClassTable

public class ChainingClassTable
extends Object
implements ClassTable

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


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.jboss.marshalling.ClassTable
ClassTable.Writer
 
Constructor Summary
ChainingClassTable(ClassTable[] classTables)
          Construct a new instance.
 
Method Summary
 ClassTable.Writer getClassWriter(Class<?> clazz)
          Determine whether the given class reference is a valid predefined reference.
 Class<?> readClass(Unmarshaller unmarshaller)
          Read a class from the stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChainingClassTable

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

Parameters:
classTables - the class tables to delegate to
Method Detail

getClassWriter

public ClassTable.Writer getClassWriter(Class<?> clazz)
                                 throws IOException
Determine whether the given class reference is a valid predefined reference.

Specified by:
getClassWriter in interface ClassTable
Parameters:
clazz - the candidate class
Returns:
the class writer, or null to use the default mechanism
Throws:
IOException - if an I/O error occurs

readClass

public Class<?> readClass(Unmarshaller unmarshaller)
                   throws IOException,
                          ClassNotFoundException
Read a class from the stream. The class will have been written by the ClassTable.getClassWriter(Class) method's Writer instance, as defined above.

Specified by:
readClass in interface ClassTable
Parameters:
unmarshaller - the unmarshaller to read from
Returns:
the class
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.