org.jboss.remoting.marshal.serializable
Class SerializableUnMarshaller

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

public class SerializableUnMarshaller
extends java.lang.Object
implements UnMarshaller (src)

Will perform the deserialization of objects off the wire.

See Also:
Serialized Form

Field Summary
static java.lang.String DATATYPE
           
 
Constructor Summary
SerializableUnMarshaller()
           
 
Method Summary
 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 (src)
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 (src)
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 (src)
Parameters:
classloader -