| 
GigaSpaces XAP 9.1 API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.OutputStream
java.io.ObjectOutputStream
net.jini.io.MarshalOutputStream
public class MarshalOutputStream
An extension of ObjectOutputStream that implements the
 dynamic class loading semantics of Java(TM) Remote Method Invocation
 (Java RMI) argument and result
 marshalling (using RMIClassLoader).  A
 MarshalOutputStream writes data that is intended to be
 written by a corresponding MarshalInputStream.
 
MarshalOutputStream implements the output side of
 the dynamic class loading semantics by overriding annotateClass and annotateProxyClass to
 annotate class descriptors in the stream with codebase strings
 obtained using RMIClassLoader.getClassAnnotation.
 
MarshalOutputStream writes class annotations to its
 own stream; a subclass may override the writeAnnotation method to write the class annotations to a
 different location.
 
MarshalOutputStream does not modify the stream
 protocol version of its instances' superclass state (see ObjectOutputStream.useProtocolVersion).
| Nested Class Summary | 
|---|
| Nested classes/interfaces inherited from class java.io.ObjectOutputStream | 
|---|
ObjectOutputStream.PutField | 
| Field Summary | 
|---|
| Constructor Summary | |
|---|---|
MarshalOutputStream(OutputStream out,
                    Collection context)
Creates a new MarshalOutputStream that writes
 marshalled data to the specified underlying
 OutputStream. | 
|
| Method Summary | |
|---|---|
protected  void | 
annotateClass(Class cl)
Annotates the stream descriptor for the class cl. | 
protected  void | 
annotateProxyClass(Class cl)
Annotates the stream descriptor for the proxy class cl. | 
 Collection | 
getObjectStreamContext()
Returns the collection of context information objects that was passed to this stream's constructor.  | 
protected  void | 
writeAnnotation(String annotation)
Writes a class annotation string value (possibly null) to be read by a corresponding
 MarshalInputStream implementation. | 
| Methods inherited from class java.io.ObjectOutputStream | 
|---|
close, defaultWriteObject, drain, enableReplaceObject, flush, putFields, replaceObject, reset, useProtocolVersion, write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeClassDescriptor, writeDouble, writeFields, writeFloat, writeInt, writeLong, writeObject, writeObjectOverride, writeShort, writeStreamHeader, writeUnshared, writeUTF | 
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
public MarshalOutputStream(OutputStream out,
                           Collection context)
                    throws IOException
MarshalOutputStream that writes
 marshalled data to the specified underlying
 OutputStream.
 This constructor passes out to the superclass
 constructor that has an OutputStream parameter.
 
context will be used as the return value of the
 created stream's getObjectStreamContext method.
out - the output stream to write marshalled data tocontext - the collection of context information objects to
 be returned by this stream's getObjectStreamContext method
IOException - if the superclass's constructor throws an
 IOException
SecurityException - if the superclass's constructor
 throws a SecurityException
NullPointerException - if out or
 context is null| Method Detail | 
|---|
public Collection getObjectStreamContext()
getObjectStreamContext in interface ObjectStreamContext
protected void annotateClass(Class cl)
                      throws IOException
cl.
 MarshalOutputStream implements this method as
 follows:
 
This method invokes RMIClassLoader.getClassAnnotation with cl to get
 the appropriate class annotation string value (possibly
 null), and then it invokes this stream's writeAnnotation method with that string to
 record the annotation.
annotateClass in class ObjectOutputStreamcl - the class to annotate
IOException - if writeAnnotation throws an
 IOException
NullPointerException - if cl is
 null
protected void annotateProxyClass(Class cl)
                           throws IOException
cl.
 MarshalOutputStream implements this method as
 follows:
 
This method invokes RMIClassLoader.getClassAnnotation with cl to get
 the appropriate class annotation string value (possibly
 null), and then it invokes this stream's writeAnnotation method with that string to
 record the annotation.
annotateProxyClass in class ObjectOutputStreamcl - the proxy class to annotate
IOException - if writeAnnotation throws an
 IOException
NullPointerException - if cl is
 null
protected void writeAnnotation(String annotation)
                        throws IOException
null) to be read by a corresponding
 MarshalInputStream implementation.
 MarshalOutputStream implements this method to
 just write the annotation value to this stream using writeObject.
 
A subclass can override this method to write the annotation to a different location.
annotation - the class annotation string value (possibly
 null) to write
IOException - if I/O exception occurs writing the
 annotation
  | 
GigaSpaces XAP 9.1 API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||