com.sun.grizzly.http.jk.common
Class JkInputStream

java.lang.Object
  extended by com.sun.grizzly.http.jk.common.JkInputStream
All Implemented Interfaces:
InputBuffer, OutputBuffer

public class JkInputStream
extends Object
implements InputBuffer, OutputBuffer

Generic input stream impl on top of ajp


Constructor Summary
JkInputStream(MsgContext context)
          Deprecated.  
JkInputStream(MsgContext context, int bsize)
           
 
Method Summary
 void appendHead(Response res)
           
 int doRead(ByteChunk responseChunk, Request req)
          Return from the input stream.
 int doWrite(ByteChunk chunk, Response res)
          Writes the response.
 void endMessage()
           
 boolean isReadRequired()
          Return the flag saying that the server is sending a body
 boolean receive()
          Receive a chunk of data.
 void recycle()
          Must be called before or after each request
 void setIsReadRequired(boolean irr)
          Set the flag saying that the server is sending a body
 void setReplay(ByteChunk replay)
          Set the replay buffer for Form auth
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JkInputStream

public JkInputStream(MsgContext context,
                     int bsize)

JkInputStream

public JkInputStream(MsgContext context)
Deprecated. 

Method Detail

setIsReadRequired

public void setIsReadRequired(boolean irr)
Set the flag saying that the server is sending a body


isReadRequired

public boolean isReadRequired()
Return the flag saying that the server is sending a body


recycle

public void recycle()
Must be called before or after each request


endMessage

public void endMessage()
                throws IOException
Throws:
IOException

doWrite

public int doWrite(ByteChunk chunk,
                   Response res)
            throws IOException
Description copied from interface: OutputBuffer
Writes the response. The caller ( tomcat ) owns the chunks.

Specified by:
doWrite in interface OutputBuffer
Parameters:
chunk - Data to write
res - Used to allow buffers that can be shared by multiple responses.
Throws:
IOException

doRead

public int doRead(ByteChunk responseChunk,
                  Request req)
           throws IOException
Description copied from interface: InputBuffer
Return from the input stream. IMPORTANT: the current model assumes that the protocol will 'own' the buffer and return a pointer to it in ByteChunk ( i.e. the param will have chunk.getBytes()==null before call, and the result after the call ).

Specified by:
doRead in interface InputBuffer
Throws:
IOException

receive

public boolean receive()
                throws IOException
Receive a chunk of data. Called to implement the 'special' packet in ajp13 and to receive the data after we send a GET_BODY packet

Throws:
IOException

appendHead

public void appendHead(Response res)
                throws IOException
Throws:
IOException

setReplay

public void setReplay(ByteChunk replay)
Set the replay buffer for Form auth



Copyright © 2013 Oracle Corporation. All Rights Reserved.