org.jboss.remoting.marshal.serializable
Class SerializableUnMarshaller

java.lang.Object
  extended byorg.jboss.remoting.marshal.serializable.SerializableUnMarshaller
All Implemented Interfaces:
java.io.Serializable, UnMarshaller
Direct Known Subclasses:
HTTPUnMarshaller

public class SerializableUnMarshaller
extends java.lang.Object
implements UnMarshaller

Will perform the deserialization of objects off the wire.

Author:
Tom Elrod
See Also:
Serialized Form

Field Summary
protected  java.lang.ClassLoader customClassLoader
           
static java.lang.String DATATYPE
           
 
Constructor Summary
SerializableUnMarshaller()
           
 
Method Summary
 UnMarshaller cloneUnMarshaller()
           
 java.lang.Object read(java.io.InputStream inputStream, java.util.Map metadata)
          Reads the data from the input stream and converts to an Object.
 void setClassLoader(java.lang.ClassLoader classloader)
          Sets the classloader to be used when deserializing objects off the wire.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DATATYPE

public static final java.lang.String DATATYPE
See Also:
Constant Field Values

customClassLoader

protected java.lang.ClassLoader customClassLoader
Constructor Detail

SerializableUnMarshaller

public SerializableUnMarshaller()
Method Detail

read

public java.lang.Object read(java.io.InputStream inputStream,
                             java.util.Map metadata)
                      throws java.io.IOException,
                             java.lang.ClassNotFoundException
Reads the data from the input stream and converts to an Object.

If the inputStream passed is an ObjectInputStream (which would prefer it not be), it will just use it as given. If the input stream is not an instance of ObjectInputStream, will wrap it with a custom ObjectInputStream (ObjectInputStreamWithClassLoader) and use it. The ObjectInputStreamWithClassLoader will use the custom class loader set in order to ensure that any classes not found within the local classloader can be loaded from the server and used within the client VM. If the inpustream is of type ObjectInputStreamWithClassLoader, then will just set the classloader to the custom classloader and proceed.

Specified by:
read in interface UnMarshaller
Parameters:
inputStream -
metadata -
Returns:
Throws:
java.io.IOException
java.lang.ClassNotFoundException

setClassLoader

public void setClassLoader(java.lang.ClassLoader classloader)
Sets the classloader to be used when deserializing objects off the wire. This will ONLY be used in the when the input stream passed to the read() method is NOT an instance of ObjectInputStream.

Specified by:
setClassLoader in interface UnMarshaller
Parameters:
classloader -

cloneUnMarshaller

public UnMarshaller cloneUnMarshaller()
                               throws java.lang.CloneNotSupportedException
Specified by:
cloneUnMarshaller in interface UnMarshaller
Throws:
java.lang.CloneNotSupportedException


Copyright © 1998-2005 JBoss Inc . All Rights Reserved.