java.rmi
Class MarshalledObject

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.rmi.MarshalledObject
All Implemented Interfaces:
Serializable sample code for java.io.Serializable definition code for java.io.Serializable

public final class MarshalledObject
extends Object sample code for java.lang.Object definition code for java.lang.Object
implements Serializable sample code for java.io.Serializable definition code for java.io.Serializable

A MarshalledObject contains a byte stream with the serialized representation of an object given to its constructor. The get method returns a new copy of the original object, as deserialized from the contained byte stream. The contained object is serialized and deserialized with the same serialization semantics used for marshaling and unmarshaling parameters and return values of RMI calls: When the serialized form is created:

When copy of the object is retrieved (via the get method), if the class is not available locally, it will be loaded from the appropriate location (specified the URL annotated with the class descriptor when the class was serialized.

MarshalledObject facilitates passing objects in RMI calls that are not automatically deserialized immediately by the remote peer.

Since:
1.2
See Also:
Serialized Form

Constructor Summary
MarshalledObject sample code for java.rmi.MarshalledObject.MarshalledObject(java.lang.Object) definition code for java.rmi.MarshalledObject.MarshalledObject(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  obj)
          Creates a new MarshalledObject that contains the serialized representation of the current state of the supplied object.
 
Method Summary
 boolean equals sample code for java.rmi.MarshalledObject.equals(java.lang.Object) definition code for java.rmi.MarshalledObject.equals(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  obj)
          Compares this MarshalledObject to another object.
 Object sample code for java.lang.Object definition code for java.lang.Object get sample code for java.rmi.MarshalledObject.get() definition code for java.rmi.MarshalledObject.get() ()
          Returns a new copy of the contained marshalledobject.
 int hashCode sample code for java.rmi.MarshalledObject.hashCode() definition code for java.rmi.MarshalledObject.hashCode() ()
          Return a hash code for this MarshalledObject.
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

MarshalledObject sample code for java.rmi.MarshalledObject(java.lang.Object) definition code for java.rmi.MarshalledObject(java.lang.Object)

public MarshalledObject(Object sample code for java.lang.Object definition code for java.lang.Object  obj)
                 throws IOException sample code for java.io.IOException definition code for java.io.IOException 
Creates a new MarshalledObject that contains the serialized representation of the current state of the supplied object. The object is serialized with the semantics used for marshaling parameters for RMI calls.

Parameters:
obj - the object to be serialized (must be serializable)
Throws:
IOException sample code for java.io.IOException definition code for java.io.IOException - if an IOException occurs; an IOException may occur if obj is not serializable.
Since:
1.2
Method Detail

get sample code for java.rmi.MarshalledObject.get() definition code for java.rmi.MarshalledObject.get()

public Object sample code for java.lang.Object definition code for java.lang.Object  get()
           throws IOException sample code for java.io.IOException definition code for java.io.IOException ,
                  ClassNotFoundException sample code for java.lang.ClassNotFoundException definition code for java.lang.ClassNotFoundException 
Returns a new copy of the contained marshalledobject. The internal representation is deserialized with the semantics used for unmarshaling paramters for RMI calls.

Returns:
a copy of the contained object
Throws:
IOException sample code for java.io.IOException definition code for java.io.IOException - if an IOException occurs while deserializing the object from its internal representation.
ClassNotFoundException sample code for java.lang.ClassNotFoundException definition code for java.lang.ClassNotFoundException - if a ClassNotFoundException occurs while deserializing the object from its internal representation. could not be found
Since:
1.2

hashCode sample code for java.rmi.MarshalledObject.hashCode() definition code for java.rmi.MarshalledObject.hashCode()

public int hashCode()
Return a hash code for this MarshalledObject.

Overrides:
hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() in class Object sample code for java.lang.Object definition code for java.lang.Object
Returns:
a hash code
See Also:
Object.equals(java.lang.Object) sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable

equals sample code for java.rmi.MarshalledObject.equals(java.lang.Object) definition code for java.rmi.MarshalledObject.equals(java.lang.Object)

public boolean equals(Object sample code for java.lang.Object definition code for java.lang.Object  obj)
Compares this MarshalledObject to another object. Returns true if and only if the argument refers to a MarshalledObject that contains exactly the same serialized representation of an object as this one does. The comparison ignores any class codebase annotation, meaning that two objects are equivalent if they have the same serialized representation except for the codebase of each class in the serialized representation.

Overrides:
equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) in class Object sample code for java.lang.Object definition code for java.lang.Object
Parameters:
obj - the object to compare with this MarshalledObject
Returns:
true if the argument contains an equaivalent serialized object; false otherwise
Since:
1.2
See Also:
Object.hashCode() sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable