This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.


java.rmi
class MarshalledObject

java.lang.Object extended by java.rmi.MarshalledObject
All Implemented Interfaces:
Serializable

Most common way to construct:

ObjectInputStream in = …;

MarshalledObject mobj = (MarshalledObject)in.readObject();

Based on 7 examples


public final class MarshalledObject
extends Object
implements 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.


Constructor Summary

          Creates a new MarshalledObject that contains the serialized representation of the current state of the supplied object.
 
Method Summary
 boolean

          Compares this MarshalledObject to another object.
 Object
get()

          Returns a new copy of the contained marshalledobject.
 int

          Return a hash code for this MarshalledObject.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MarshalledObject

public MarshalledObject(Object obj)
                 throws 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 - if an IOException occurs; an IOException may occur if obj is not serializable.
Method Detail

equals

public boolean equals(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 in class Object
Parameters:
obj - the object to compare with this MarshalledObject
Returns:
true if the argument contains an equaivalent serialized object; false otherwise

get

public Object get()
           throws IOException,
                  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 - if an IOException occurs while deserializing the object from its internal representation.
ClassNotFoundException - if a ClassNotFoundException occurs while deserializing the object from its internal representation. could not be found

hashCode

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

Overrides:
hashCode in class Object
Returns:
a hash code


This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.
This page displays the Jadeite version of the documention, which is derived from the offical documentation that contains this copyright notice:
Copyright 2008 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
The official Sun™ documentation can be found here at http://java.sun.com/javase/6/docs/api/.