public class

MarshalInputStream

extends ObjectInputStream
java.lang.Object
   ↳ java.io.InputStream
     ↳ java.io.ObjectInputStream
       ↳ sun.rmi.server.MarshalInputStream

Class Overview

MarshalInputStream is an extension of ObjectInputStream. When resolving a class, it reads an object from the stream written by a corresponding MarshalOutputStream. If the class to be resolved is not available locally, from the first class loader on the execution stack, or from the context class loader of the current thread, it will attempt to load the class from the location annotated by the sending MarshalOutputStream. This location object must be a string representing a path of URLs. A new MarshalInputStream should be created to deserialize remote objects or graphs containing remote objects. Objects are created from the stream using the ObjectInputStream.readObject method.

Summary

[Expand]
Inherited Constants
From interface java.io.ObjectStreamConstants
Fields
protected static Map permittedSunClasses table to hold sun classes to which access is explicitly permitted
[Expand]
Inherited Fields
From interface java.io.ObjectStreamConstants
Public Constructors
MarshalInputStream(InputStream in)
Create a new MarshalInputStream object.
Public Methods
void close()
Closes this stream, implicitly invoking done() first.
void done()
Indicates that the user of this MarshalInputStream is done reading objects from it, so all callbacks registered with the setDoneCallback method should now be (synchronously) executed.
Runnable getDoneCallback(Object key)
Returns a callback previously registered via the setDoneCallback method with given key, or null if no callback has yet been registered with that key.
void setDoneCallback(Object key, Runnable callback)
Registers a callback to make when this stream's done() method is invoked, along with a key for retrieving the same callback instance subsequently from the getDoneCallback method.
Protected Methods
Object readLocation()
Return the location for the class in the stream.
Class resolveClass(ObjectStreamClass classDesc)
resolveClass is extended to acquire (if present) the location from which to load the specified class.
Class resolveProxyClass(String[] interfaces)
resolveProxyClass is extended to acquire (if present) the location to determine the class loader to define the proxy class in.
[Expand]
Inherited Methods
From class java.io.ObjectInputStream
From class java.io.InputStream
From class java.lang.Object
From interface java.io.Closeable
From interface java.io.DataInput
From interface java.io.ObjectInput

Fields

protected static Map permittedSunClasses

table to hold sun classes to which access is explicitly permitted

Public Constructors

public MarshalInputStream (InputStream in)

Create a new MarshalInputStream object.

Public Methods

public void close ()

Closes this stream, implicitly invoking done() first.

Throws
IOException

public void done ()

Indicates that the user of this MarshalInputStream is done reading objects from it, so all callbacks registered with the setDoneCallback method should now be (synchronously) executed. When this method returns, there are no more callbacks registered. This method is implicitly invoked by close() before it delegates to the superclass's close method.

public Runnable getDoneCallback (Object key)

Returns a callback previously registered via the setDoneCallback method with given key, or null if no callback has yet been registered with that key.

public void setDoneCallback (Object key, Runnable callback)

Registers a callback to make when this stream's done() method is invoked, along with a key for retrieving the same callback instance subsequently from the getDoneCallback method.

Protected Methods

protected Object readLocation ()

Return the location for the class in the stream. This method can be overridden by subclasses that store this annotation somewhere else than as the next object in the stream, as is done by this class.

protected Class resolveClass (ObjectStreamClass classDesc)

resolveClass is extended to acquire (if present) the location from which to load the specified class. It will find, load, and return the class.

Parameters
classDesc an instance of class ObjectStreamClass
Returns
  • a Class object corresponding to desc

protected Class resolveProxyClass (String[] interfaces)

resolveProxyClass is extended to acquire (if present) the location to determine the class loader to define the proxy class in.

Parameters
interfaces the list of interface names that were deserialized in the proxy class descriptor
Returns
  • a proxy class for the specified interfaces