Top Description Fields Constructors Methods
org.jboss.marshalling

public Class ChainingObjectTable

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

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

Field Summary

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

Constructor Summary

AccessConstructor and Description
public
ChainingObjectTable(final ObjectTable[]
the object tables to delegate to
objectTables
)

Construct a new instance.

Method Summary

Modifier and TypeMethod and Description
public ObjectTable.Writer
getObjectWriter(final Object
the candidate object
obj
)

Implements org.jboss.marshalling.ObjectTable.getObjectWriter.

Determine whether the given object reference is a valid predefined reference.
private static Pair<ObjectTable, ObjectTable.Writer>
pair(final ObjectTable objectTable, final ObjectTable.Writer writer)

public Object
readObject(final Unmarshaller
the unmarshaller to read from
unmarshaller
)

Implements org.jboss.marshalling.ObjectTable.readObject.

Read an instance from the stream.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

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

Constructor Detail

ChainingObjectTableback to summary
public ChainingObjectTable(final 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:ObjectTable[]

the object tables to delegate to

Method Detail

getObjectWriterback to summary
public ObjectTable.Writer getObjectWriter(final Object obj) throws IOException

Implements org.jboss.marshalling.ObjectTable.getObjectWriter.

Doc from org.jboss.marshalling.ObjectTable.getObjectWriter.

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

Parameters
obj:Object

the candidate object

Returns:ObjectTable.Writer

the object writer, or null to use the default mechanism

Exceptions
IOException:
if an I/O error occurs
pairback to summary
private static Pair<ObjectTable, ObjectTable.Writer> pair(final ObjectTable objectTable, final ObjectTable.Writer writer)
readObjectback to summary
public Object readObject(final Unmarshaller unmarshaller) throws IOException, ClassNotFoundException

Implements org.jboss.marshalling.ObjectTable.readObject.

Doc from org.jboss.marshalling.ObjectTable.readObject.

Read an instance from the stream. The instance will have been written by the getObjectWriter(Object) method's Writer instance, as defined above.

Parameters
unmarshaller:Unmarshaller

the unmarshaller to read from

Returns:Object

the object instance

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