Class java.rmi.server.MarshalOutputStream
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.rmi.server.MarshalOutputStream

java.lang.Object
   |
   +----java.io.OutputStream
           |
           +----java.io.FilterOutputStream
                   |
                   +----java.io.DataOutputStream
                           |
                           +----java.io.ObjectOutputStream
                                   |
                                   +----java.rmi.server.MarshalOutputStream

public class MarshalOutputStream
extends ObjectOutputStream
implements MarshalOutput
A MarshalOutputStream extends ObjectOutputStream to add functions specific to marshaling of remote object references. If it is necessary to serialize remote objects or objects that contain references to remote objects a MarshalOutputStream must be used instead of ObjectOutputStream.

A new MarshalOutputStream is constructed to serialize remote objects or graphs containing remote objects. Objects are written to the stream using the ObjectOutputStream.writeObject method.

MarshalOutputStream maps remote objects to the corresponding remote stub and embeds the location from which to load the stub classes. The location may be ignored by the client but is supplied.


Constructor Index

 o MarshalOutputStream(OutputStream)
Create a marshaling stream to handle RMI marshaling

Method Index

 o annotateClass(Class)
annotateClass() is extended to serialize a location from which to load the the specified class.
 o replaceObject(Object)
replaceObject is extended to check for instances of Remote that need to be serialized as proxy objects.

Constructors

 o MarshalOutputStream
  public MarshalOutputStream(OutputStream out) throws IOException
Create a marshaling stream to handle RMI marshaling

Methods

 o replaceObject
  protected Object replaceObject(Object obj) throws IOException
replaceObject is extended to check for instances of Remote that need to be serialized as proxy objects. RemoteServer.getProxy is called to check for and find the stub.
Overrides:
replaceObject in class ObjectOutputStream
 o annotateClass
  protected void annotateClass(Class cl) throws IOException
annotateClass() is extended to serialize a location from which to load the the specified class. Only classes loaded with the StubClassLoader qualify.
Overrides:
annotateClass in class ObjectOutputStream

All Packages  Class Hierarchy  This Package  Previous  Next  Index