Top Description Inners Fields Constructors Methods
org.jboss.marshalling

public final Class ModularClassTable

extends Object
implements ClassTable
Class Inheritance
All Implemented Interfaces
org.jboss.marshalling.ClassTable
Imports
java.io.IOException, .InvalidClassException, .StreamCorruptedException, java.lang.reflect.Proxy, org.jboss.modules.Module, .ModuleIdentifier, .ModuleLoadException, .ModuleLoader

A class table which implements an alternate class resolution strategy based on JBoss Modules. Each class name is stored along with its corresponding module identifier, which allows the object graph to be exactly reconstituted on the remote side. This class should only be used when the marshalling and unmarshalling side share the same class files.
Author
David M. Lloyd

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class

Field Summary

Modifier and TypeField and Description
private static final ClassTable.Writer
private final ModuleLoader
private static final ClassTable.Writer

Constructor Summary

AccessConstructor and Description
private
ModularClassTable(final ModuleLoader moduleLoader)

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.
public static ModularClassTable

Returns:

the modular class table
getInstance
(final ModuleLoader
the module loader to use
moduleLoader
)

Get an instance using the given module loader.

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

CLASS_WRITERback to summary
private static final ClassTable.Writer CLASS_WRITER
moduleLoaderback to summary
private final ModuleLoader moduleLoader
PROXY_WRITERback to summary
private static final ClassTable.Writer PROXY_WRITER

Constructor Detail

ModularClassTableback to summary
private ModularClassTable(final ModuleLoader moduleLoader)

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
getInstanceback to summary
public static ModularClassTable getInstance(final ModuleLoader moduleLoader)

Get an instance using the given module loader.

Parameters
moduleLoader:ModuleLoader

the module loader to use

Returns:ModularClassTable

the modular class table

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
org.jboss.marshalling back to summary

private final Class ModularClassTable.ClassWriter

extends Object
implements Writer
Class Inheritance
All Implemented Interfaces
org.jboss.marshalling.ClassTable.Writer

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
writeClass(final Marshaller
the marshaller to write to
marshaller
,
final Class<?>
the class reference to write
clazz
)

Implements org.jboss.marshalling.ClassTable.Writer.writeClass.

Write the predefined class reference to the stream.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ClassWriterback to summary
private ClassWriter()

Method Detail

writeClassback to summary
public void writeClass(final Marshaller marshaller, final Class<?> clazz) throws IOException

Implements org.jboss.marshalling.ClassTable.Writer.writeClass.

Doc from org.jboss.marshalling.ClassTable.Writer.writeClass.

Write the predefined class reference to the stream.

Parameters
marshaller:Marshaller

the marshaller to write to

clazz:Class<?>

the class reference to write

Exceptions
IOException:
if an I/O error occurs
org.jboss.marshalling back to summary

private final Class ModularClassTable.ProxyWriter

extends Object
implements Writer
Class Inheritance
All Implemented Interfaces
org.jboss.marshalling.ClassTable.Writer

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
writeClass(final Marshaller
the marshaller to write to
marshaller
,
final Class<?>
the class reference to write
clazz
)

Implements org.jboss.marshalling.ClassTable.Writer.writeClass.

Write the predefined class reference to the stream.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ProxyWriterback to summary
private ProxyWriter()

Method Detail

writeClassback to summary
public void writeClass(final Marshaller marshaller, final Class<?> clazz) throws IOException

Implements org.jboss.marshalling.ClassTable.Writer.writeClass.

Doc from org.jboss.marshalling.ClassTable.Writer.writeClass.

Write the predefined class reference to the stream.

Parameters
marshaller:Marshaller

the marshaller to write to

clazz:Class<?>

the class reference to write

Exceptions
IOException:
if an I/O error occurs