com.sun.grid.proxy
Class ProxyOutputStream

java.lang.Object
  |
  +--java.io.OutputStream
        |
        +--java.io.ObjectOutputStream
              |
              +--sun.rmi.server.MarshalOutputStream
                    |
                    +--com.sun.grid.proxy.ProxyOutputStream
All Implemented Interfaces:
java.io.DataOutput, java.io.ObjectOutput, java.io.ObjectStreamConstants

public class ProxyOutputStream
extends sun.rmi.server.MarshalOutputStream

This class allows the annotation for classes being written to the stream to be explicitly set.


Nested Class Summary
 
Nested classes inherited from class java.io.ObjectOutputStream
java.io.ObjectOutputStream.PutField
 
Field Summary
private  java.lang.String annotation
          The annotation to be used when writing objects to the stream.
 
Fields inherited from class java.io.ObjectOutputStream
 
Fields inherited from interface java.io.ObjectStreamConstants
baseWireHandle, PROTOCOL_VERSION_1, PROTOCOL_VERSION_2, SC_BLOCK_DATA, SC_EXTERNALIZABLE, SC_SERIALIZABLE, SC_WRITE_METHOD, STREAM_MAGIC, STREAM_VERSION, SUBCLASS_IMPLEMENTATION_PERMISSION, SUBSTITUTION_PERMISSION, TC_ARRAY, TC_BASE, TC_BLOCKDATA, TC_BLOCKDATALONG, TC_CLASS, TC_CLASSDESC, TC_ENDBLOCKDATA, TC_EXCEPTION, TC_LONGSTRING, TC_MAX, TC_NULL, TC_OBJECT, TC_PROXYCLASSDESC, TC_REFERENCE, TC_RESET, TC_STRING
 
Constructor Summary
ProxyOutputStream(java.io.OutputStream out)
          Creates a new instance of ProxyOutputStream
 
Method Summary
protected  void annotateClass(java.lang.Class cl)
          This method overrides its parent's method to write the annotation object specified regardless of what class is being written.
 void setAnnotation(java.lang.String annotation)
          This method sets the annotation to be used.
 
Methods inherited from class sun.rmi.server.MarshalOutputStream
annotateProxyClass, replaceObject, writeLocation
 
Methods inherited from class java.io.ObjectOutputStream
close, defaultWriteObject, drain, enableReplaceObject, flush, putFields, 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
 

Field Detail

annotation

private java.lang.String annotation
The annotation to be used when writing objects to the stream.

Constructor Detail

ProxyOutputStream

public ProxyOutputStream(java.io.OutputStream out)
                  throws java.io.IOException,
                         java.io.StreamCorruptedException
Creates a new instance of ProxyOutputStream

Parameters:
out - the OutputStream to wrap
Throws:
java.io.IOException - if an error occurs while writing to the stream
java.io.StreamCorruptedException - if the object stream is invalid
Method Detail

setAnnotation

public void setAnnotation(java.lang.String annotation)
This method sets the annotation to be used.

Parameters:
annotation - The annotation to use

annotateClass

protected void annotateClass(java.lang.Class cl)
                      throws java.io.IOException
This method overrides its parent's method to write the annotation object specified regardless of what class is being written.

Overrides:
annotateClass in class sun.rmi.server.MarshalOutputStream
Parameters:
cl - the class to annotate
Throws:
java.io.IOException - if an error occurs while writing to the stream