org.apache.cxf.transport.http
Class HTTPConduit.WrappedOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by org.apache.cxf.io.AbstractWrappedOutputStream
          extended by org.apache.cxf.transport.http.HTTPConduit.WrappedOutputStream
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable
Enclosing class:
HTTPConduit

protected class HTTPConduit.WrappedOutputStream
extends AbstractWrappedOutputStream

Wrapper output stream responsible for flushing headers and handling the incoming HTTP-level response (not necessarily the MEP response).


Field Summary
protected  CacheAndWriteOutputStream cachedStream
          This field contains the output stream with which we cache the request.
protected  boolean cachingForRetransmission
          This boolean is true if the request must be cached.
protected  boolean chunking
          If we are going to be chunking, we won't flush till close which causes new chunks, small network packets, etc..
protected  java.net.HttpURLConnection connection
          This field contains the currently active connection.
protected  Message outMessage
           
 
Fields inherited from class org.apache.cxf.io.AbstractWrappedOutputStream
wrappedStream, written
 
Constructor Summary
protected HTTPConduit.WrappedOutputStream(Message m, java.net.HttpURLConnection c, boolean possibleRetransmit, boolean isChunking)
           
 
Method Summary
 void close()
          Perform any actions required on stream closure (handle response etc.)
 void flush()
           
protected  void handleHeadersTrustCaching()
           
protected  void handleResponse()
          This procedure is called on the close of the output stream so we are ready to handle the response from the connection.
protected  void handleResponseInternal()
           
protected  void handleRetransmits()
          This procedure handles all retransmits, if any.
protected  void onFirstWrite()
          Perform any actions required on stream flush (freeze headers, reset output stream ...
 
Methods inherited from class org.apache.cxf.io.AbstractWrappedOutputStream
write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

connection

protected java.net.HttpURLConnection connection
This field contains the currently active connection.


cachingForRetransmission

protected boolean cachingForRetransmission
This boolean is true if the request must be cached.


chunking

protected final boolean chunking
If we are going to be chunking, we won't flush till close which causes new chunks, small network packets, etc..


cachedStream

protected CacheAndWriteOutputStream cachedStream
This field contains the output stream with which we cache the request. It maybe null if we are not caching.


outMessage

protected Message outMessage
Constructor Detail

HTTPConduit.WrappedOutputStream

protected HTTPConduit.WrappedOutputStream(Message m,
                                          java.net.HttpURLConnection c,
                                          boolean possibleRetransmit,
                                          boolean isChunking)
Method Detail

onFirstWrite

protected void onFirstWrite()
                     throws java.io.IOException
Perform any actions required on stream flush (freeze headers, reset output stream ... etc.)

Overrides:
onFirstWrite in class AbstractWrappedOutputStream
Throws:
java.io.IOException

handleHeadersTrustCaching

protected void handleHeadersTrustCaching()
                                  throws java.io.IOException
Throws:
java.io.IOException

flush

public void flush()
           throws java.io.IOException
Specified by:
flush in interface java.io.Flushable
Overrides:
flush in class AbstractWrappedOutputStream
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Perform any actions required on stream closure (handle response etc.)

Specified by:
close in interface java.io.Closeable
Overrides:
close in class AbstractWrappedOutputStream
Throws:
java.io.IOException

handleRetransmits

protected void handleRetransmits()
                          throws java.io.IOException
This procedure handles all retransmits, if any.

Throws:
java.io.IOException

handleResponse

protected void handleResponse()
                       throws java.io.IOException
This procedure is called on the close of the output stream so we are ready to handle the response from the connection. We may retransmit until we finally get a response.

Throws:
java.io.IOException

handleResponseInternal

protected void handleResponseInternal()
                               throws java.io.IOException
Throws:
java.io.IOException


Apache CXF