org.jboss.remoting.serialization.impl.java
Class JavaMarshalledValue

java.lang.Object
  extended by org.jboss.remoting.serialization.RemotingMarshalledValue
      extended by org.jboss.remoting.serialization.impl.java.JavaMarshalledValue
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, IMarshalledValue

public class JavaMarshalledValue
extends RemotingMarshalledValue
implements java.io.Externalizable

A simple replacement for the RMI MarshalledObject that uses the thread context class loader for resolving classes and proxies. This currently does not support class annotations and dynamic class loading.

Version:
$Revision: 566 $
Author:
Scott.Stark@jboss.org, Clebert.suconic@jboss.org (refactored packages and names only)
See Also:
Serialized Form

Constructor Summary
JavaMarshalledValue()
          Exposed for externalization.
JavaMarshalledValue(java.lang.Object obj)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.Object get()
          The object has to be unserialized only when the first get is executed.
 int hashCode()
          Return a hash code for the serialized form of the value.
 void readExternal(java.io.ObjectInput in)
          The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays.
 int size()
           
 byte[] toByteArray()
           
 void writeExternal(java.io.ObjectOutput out)
          The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaMarshalledValue

public JavaMarshalledValue()
Exposed for externalization.


JavaMarshalledValue

public JavaMarshalledValue(java.lang.Object obj)
                    throws java.io.IOException
Throws:
java.io.IOException
Method Detail

get

public java.lang.Object get()
                     throws java.io.IOException,
                            java.lang.ClassNotFoundException
Description copied from class: RemotingMarshalledValue
The object has to be unserialized only when the first get is executed.

Specified by:
get in interface IMarshalledValue
Specified by:
get in class RemotingMarshalledValue
Throws:
java.io.IOException
java.lang.ClassNotFoundException

toByteArray

public byte[] toByteArray()

size

public int size()

hashCode

public int hashCode()
Return a hash code for the serialized form of the value.

Overrides:
hashCode in class java.lang.Object
Returns:
the serialized form value hash.

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays. The readExternal method must read the values in the same sequence and with the same types as were written by writeExternal.

Specified by:
readExternal in interface java.io.Externalizable
Parameters:
in - the stream to read data from in order to restore the object
Throws:
java.io.IOException - if I/O errors occur
java.lang.ClassNotFoundException - If the class for an object being restored cannot be found.

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays.

Specified by:
writeExternal in interface java.io.Externalizable
Parameters:
out - the stream to write the object to
Throws:
java.io.IOException - Includes any I/O exceptions that may occur


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