com.sun.grizzly.http
Class TaskContext

java.lang.Object
  extended by com.sun.grizzly.http.TaskContext

public class TaskContext
extends Object

This class encapsulates the logic required to synchronized unblocking socket request with the blocked stream architecture of Tomcat.

Author:
Jean-Francois Arcand

Constructor Summary
TaskContext()
          Create a instance of this object.
 
Method Summary
 void flush()
          Flush bytes to the NonBlockinginputStream
 InputStream getInputStream()
          Return the input stream used by this request.
 OutputStream getOutputStream()
           
 void recycle()
          Recycle all streams used by this object.
 void setInputStream(InputStream inputStream)
           
 void setOutputStream(ByteBufferStream outputStream)
           
 void write(ByteBuffer byteBuffer)
          Fill the current output stream with the available bytes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TaskContext

public TaskContext()
Create a instance of this object.

Method Detail

getInputStream

public InputStream getInputStream()
Return the input stream used by this request. The default stream is an instance of NonBlockinginputStream


getOutputStream

public OutputStream getOutputStream()

setInputStream

public void setInputStream(InputStream inputStream)

setOutputStream

public void setOutputStream(ByteBufferStream outputStream)

write

public void write(ByteBuffer byteBuffer)
           throws IOException
Fill the current output stream with the available bytes

Throws:
IOException

flush

public void flush()
           throws IOException
Flush bytes to the NonBlockinginputStream

Throws:
IOException

recycle

public void recycle()
             throws IOException
Recycle all streams used by this object.

Throws:
IOException


Copyright © 2010 SUN Microsystems. All Rights Reserved.