Top Description Fields Constructors Methods
org.jboss.marshalling

public Class ChainingClassTable

extends Object
implements ClassTable
Class Inheritance
All Implemented Interfaces
org.jboss.marshalling.ClassTable
Imports
java.util.List, .ArrayList, java.io.IOException, .StreamCorruptedException

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

Field Summary

Modifier and TypeField and Description
private final ClassTable[]
private final List<Pair<ClassTable, ClassTable.Writer>>

Constructor Summary

AccessConstructor and Description
public
ChainingClassTable(final ClassTable[]
the class tables to delegate to
classTables
)

Construct a new instance.

Method Summary

Modifier and TypeMethod and Description
public ClassTable.Writer
getClassWriter(final Class<?>
the candidate class
clazz
)

Implements org.jboss.marshalling.ClassTable.getClassWriter.

Determine whether the given class reference is a valid predefined reference.
private static Pair<ClassTable, ClassTable.Writer>
pair(final ClassTable classTable, final ClassTable.Writer writer)

public Class<?>
readClass(final Unmarshaller
the unmarshaller to read from
unmarshaller
)

Implements org.jboss.marshalling.ClassTable.readClass.

Read a class from the stream.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

readersback to summary
private final ClassTable[] readers
writersback to summary
private final List<Pair<ClassTable, ClassTable.Writer>> writers

Constructor Detail

ChainingClassTableback to summary
public ChainingClassTable(final 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:ClassTable[]

the class tables to delegate to

Method Detail

getClassWriterback to summary
public ClassTable.Writer getClassWriter(final Class<?> clazz) throws IOException

Implements org.jboss.marshalling.ClassTable.getClassWriter.

Doc from org.jboss.marshalling.ClassTable.getClassWriter.

Determine whether the given class reference is a valid predefined reference.

Parameters
clazz:Class<?>

the candidate class

Returns:ClassTable.Writer

the class writer, or null to use the default mechanism

Exceptions
IOException:
if an I/O error occurs
pairback to summary
private static Pair<ClassTable, ClassTable.Writer> pair(final ClassTable classTable, final ClassTable.Writer writer)
readClassback to summary
public Class<?> readClass(final Unmarshaller unmarshaller) throws IOException, ClassNotFoundException

Implements org.jboss.marshalling.ClassTable.readClass.

Doc from org.jboss.marshalling.ClassTable.readClass.

Read a class from the stream. The class will have been written by the getClassWriter(Class) method's Writer instance, as defined above.

Parameters
unmarshaller:Unmarshaller

the unmarshaller to read from

Returns:Class<?>

the class

Exceptions
IOException:
if an I/O error occurs
ClassNotFoundException:
if a class could not be found