wt.method
Class OutputStreamProxy

java.lang.Object
  extended bywt.method.OutputStreamProxy
All Implemented Interfaces:
Externalizable, Serializable

public class OutputStreamProxy
extends Object
implements Externalizable

A Windchill RMI method server argument class to proxy an output stream from server-side code to a client-side output stream. It works whether the client and server code are separate or colocated in the same process.

See Also:
Serialized Form

Nested Class Summary
static class OutputStreamProxy.Sender
           
(package private) static class OutputStreamProxy.Server
           
static class OutputStreamProxy.Test
           
 
Field Summary
private static int BUFSIZ
           
private  OutputStream clientOut
           
private  boolean clientOutputPerformed
           
private  OutputStreamProxy.Sender sender
           
private static ThreadLocal threadLocalProxy
           
 
Constructor Summary
OutputStreamProxy()
           
OutputStreamProxy(OutputStream client_output_stream)
          Create an output stream proxy for a given client output stream.
 
Method Summary
 void closeOutputStream()
          Signal the end of proxied output.
 OutputStream getOutputStream()
          Get output stream in server that will write to client's output stream.
(package private) static OutputStreamProxy getThreadLocalProxy()
           
 void readExternal(ObjectInput in)
           
(package private)  void setClientOutputPerformed(boolean performed)
           
(package private) static void setThreadLocalProxy(OutputStreamProxy proxy)
           
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BUFSIZ

private static final int BUFSIZ
See Also:
Constant Field Values

threadLocalProxy

private static ThreadLocal threadLocalProxy

clientOut

private transient OutputStream clientOut

sender

private transient OutputStreamProxy.Sender sender

clientOutputPerformed

private transient boolean clientOutputPerformed
Constructor Detail

OutputStreamProxy

public OutputStreamProxy(OutputStream client_output_stream)
Create an output stream proxy for a given client output stream. Only one such argument is allowed per call.


OutputStreamProxy

public OutputStreamProxy()
Method Detail

getOutputStream

public OutputStream getOutputStream()
                             throws IOException
Get output stream in server that will write to client's output stream. Caller MUST call closeOutputStream in a finally block when done writing. The returned output stream is already buffered for efficient transfer.

Throws:
IOException

closeOutputStream

public void closeOutputStream()
                       throws IOException
Signal the end of proxied output. This is required by the communication protocol, but it does not close the client's output stream.

Throws:
IOException

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Throws:
IOException

readExternal

public void readExternal(ObjectInput in)
                  throws IOException
Specified by:
readExternal in interface Externalizable
Throws:
IOException

setClientOutputPerformed

void setClientOutputPerformed(boolean performed)

setThreadLocalProxy

static void setThreadLocalProxy(OutputStreamProxy proxy)

getThreadLocalProxy

static OutputStreamProxy getThreadLocalProxy()