|
JBoss Marshalling 1.3.0.CR9 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.marshalling.ModularClassResolver
public final class ModularClassResolver
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 be used when the marshalling and unmarshalling side may have differing class files.
Method Summary | |
---|---|
void |
annotateClass(Marshaller marshaller,
Class<?> clazz)
Add optional information about a class to a stream. |
void |
annotateProxyClass(Marshaller marshaller,
Class<?> proxyClass)
Add optional information about a proxy class to a stream. |
String |
getClassName(Class<?> clazz)
Get the class name to write for a given class. |
static ModularClassResolver |
getInstance(org.jboss.modules.ModuleLoader moduleLoader)
Construct a new instance using the given module loader. |
String[] |
getProxyInterfaces(Class<?> proxyClass)
Get the interface names to write for a given proxy class. |
Class<?> |
resolveClass(Unmarshaller unmarshaller,
String className,
long serialVersionUID)
Load the local class for a class descriptor. |
Class<?> |
resolveProxyClass(Unmarshaller unmarshaller,
String[] names)
Load a proxy class that implements the given interfaces. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static ModularClassResolver getInstance(org.jboss.modules.ModuleLoader moduleLoader)
moduleLoader
- the module loader
public void annotateClass(Marshaller marshaller, Class<?> clazz) throws IOException
annotateClass
in interface ClassResolver
marshaller
- the marshaller to write toclazz
- the class that was written
IOException
- if an error occursObjectOutputStream.annotateClass(Class)
public void annotateProxyClass(Marshaller marshaller, Class<?> proxyClass) throws IOException
annotateProxyClass
in interface ClassResolver
marshaller
- the marshaller to write toproxyClass
- the class that was written
IOException
- if an error occursObjectOutputStream.annotateProxyClass(Class)
public String getClassName(Class<?> clazz) throws IOException
getClassName
in interface ClassResolver
clazz
- the class
IOException
- if an error occurspublic String[] getProxyInterfaces(Class<?> proxyClass) throws IOException
getProxyInterfaces
in interface ClassResolver
proxyClass
- the proxy class
IOException
- if an error occurspublic Class<?> resolveClass(Unmarshaller unmarshaller, String className, long serialVersionUID) throws IOException, ClassNotFoundException
ClassResolver.annotateClass(Marshaller, Class)
should be read by this method.
resolveClass
in interface ClassResolver
unmarshaller
- the unmarshaller from which to read annotation data, if anyclassName
- the class nameserialVersionUID
- the serial version UID
IOException
- if an I/O error occurs
ClassNotFoundException
- if the class could not be loadedObjectInputStream.resolveClass(java.io.ObjectStreamClass)
public Class<?> resolveProxyClass(Unmarshaller unmarshaller, String[] names) throws IOException, ClassNotFoundException
resolveProxyClass
in interface ClassResolver
unmarshaller
- the unmarshaller from which to read annotation data, if anynames
- the class descriptor
IOException
- if an I/O error occurs
ClassNotFoundException
- if the proxy class could not be loadedObjectInputStream.resolveProxyClass(String[])
|
JBoss Marshalling 1.3.0.CR9 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |