com.sun.grizzly.http
Class ProcessorTask

java.lang.Object
  extended by com.sun.grizzly.http.TaskBase
      extended by com.sun.grizzly.http.ProcessorTask
All Implemented Interfaces:
Task, ActionHook, Processor, Runnable, Callable
Direct Known Subclasses:
SSLProcessorTask

public class ProcessorTask
extends TaskBase
implements Processor, ActionHook

Process HTTP request. This class is based on com.sun.grizzly.tcp.http11.Http11Processor

Author:
Jean-Francois Arcand

Nested Class Summary
static interface ProcessorTask.PostProcessor
           
 
Field Summary
protected  Adapter adapter
          Associated adapter.
protected  boolean aptCancelKey
          True if AsyncProtocolFilter should cancel the selectionkey in the terminateProcess() call
protected  boolean asyncExecution
          Is asynchronous mode enabled?
protected  AsyncHandler asyncHandler
          When the asynchronous mode is enabled, the execution of this object will be delegated to the AsyncHandler
protected  boolean bufferResponse
          Buffer the response until the buffer is full.
protected  String[] compressableMimeTypes
          List of MIMES which could be gzipped
protected  int compressionLevel
          Allowed compression level.
protected  int compressionMinSize
          Minimum contentsize to make compression.
protected  boolean connectionHeaderValueSet
          Connection: value
protected  boolean contentDelimitation
          Content delimitator for the request (if false, the connection will be closed at the end of the request).
protected  String defaultResponseType
          The default response-type
protected  boolean disableUploadTimeout
          Flag to disable setting a different time-out on uploads.
protected  boolean dropConnection
          Allow client of this class to force connection closing.
protected  boolean error
          Error flag.
protected  String forcedRequestType
          The forced request-type
protected  boolean handleKeepAliveBlockingThread
           
protected  boolean hasRequestInfoRegistered
          Has the request associated with this ProcessorTask been registered with the RequestGroupInfo
protected  char[] hostNameC
          Host name (used to avoid useless B2C conversion on the host name).
protected  boolean http09
          HTTP/0.9 flag.
protected  boolean http11
          HTTP/1.1 flag.
protected  InternalInputBuffer inputBuffer
          Input.
protected  InputStream inputStream
          Input Stream.
protected  boolean isAsyncHttpWriteEnabled
          Flag, which indicates if async HTTP write is enabled
protected  boolean keepAlive
          Keep-alive.
protected  int keepAliveLeft
          The current keep-alive count left before closing the connection.
protected  String localAddr
          The local Host address.
protected  String localName
          Local Host associated with the current connection.
protected  int localPort
          Local port to which the socket is connected
protected  int maxHttpHeaderSize
          Default HTTP header buffer size.
protected  int maxKeepAliveRequests
          Max keep-alive request before timing out.
protected  int maxPostSize
          Max post size.
protected  String[] noCompressionUserAgents
          List of user agents to not use gzip with
protected  ObjectName oname
          ObjectName under which this ProcessorTask will be JMX-registered if monitoring has been turned on
protected  SocketChannelOutputBuffer outputBuffer
          Output.
protected  OutputStream outputStream
          Output Stream.
protected  String remoteAddr
          Remote Address associated with the current connection.
protected  String remoteHost
          Remote Host associated with the current connection.
protected  int remotePort
          Remote port to which the socket is connected
protected  Request request
          Request object.
protected  int requestBufferSize
          The input request buffer size.
protected static int requestCount
          The number of requests ProcessorTask has proceeded.
protected  RequestInfo requestInfo
          The code>RequestInfo used to gather stats.
protected  boolean reRegisterSelectionKey
          False prevents the selectionkey from being re registered after async is done in the terminateProcess() call
protected  Response response
          Response object.
protected  String[] restrictedUserAgents
          List of restricted user agents.
protected static StringManager sm
          The string manager for this package.
protected  Socket socket
          Socket associated with the current connection.
protected  SSLSupport sslSupport
          SSL information.
protected  boolean started
          State flag.
protected  StreamAlgorithm streamAlgorithm
          The StreamAlgorithm used by this Task to manipulate the request.
protected  int uploadTimeout
          Maximum uploadTimeout on uploads.
 
Fields inherited from class com.sun.grizzly.http.TaskBase
key, selectorHandler, selectorThread, threadPool, type
 
Fields inherited from interface com.sun.grizzly.http.Task
ACCEPT_TASK, PROCESSOR_TASK, READ_TASK
 
Constructor Summary
ProcessorTask()
           
ProcessorTask(boolean init)
           
ProcessorTask(boolean init, boolean bufferResponse)
           
 
Method Summary
 void action(ActionCode actionCode, Object param)
          Send an action to the connector.
 void addCompressableMimeType(String mimeType)
          Add a mime-type which will be compressable The mime-type String will be exactly matched in the response mime-type header .
protected  void addFilter(String className)
          Add input or output filter.
protected  boolean addInputFilter(InputFilter[] inputFilters, String encodingName)
          Add an input filter to the current request.
 void addNoCompressionUserAgent(String userAgent)
          Add user-agent for which gzip compression didn't works The user agent String given will be exactly matched to the user-agent header submitted by the client.
 void addRestrictedUserAgent(String userAgent)
          Add restricted user-agent (which will downgrade the connector to HTTP/1.0 mode).
protected  void configPreProcess()
          Prepare this object before parsing the request.
protected  Request createRequest()
          Creates Request object.
protected  Response createResponse()
          Creates Response object.
protected  OutputFilter detectCompression()
          Check for compression.
protected  boolean doProcess()
          Process an HTTP request using a non blocking Socket
 void doTask()
          Execute the HTTP request by parsing the header/body, and then by delegating the process to the Catalina container.
protected  int findBytes(ByteChunk bc, byte[] b)
          Specialized utility method: find a sequence of lower case bytes inside a ByteChunk.
 String[] findCompressableMimeTypes()
          Return the list of comprassable mime types.
 String[] findNoCompressionUserAgents()
          Return the list of no compression user agents.
 String[] findRestrictedUserAgents()
          Return the list of restricted user agents.
 void finishResponse()
          Finish the response
 Adapter getAdapter()
          Get the associated adapter.
 boolean getAptCancelKey()
          True if AsyncProtocolFilter should cancel the selectionkey in the terminateProcess() call
 AsyncHandler getAsyncHandler()
          Return the AsyncHandler used when asynchronous execution is enabled.
 int getBufferSize()
          Return the request input buffer size
 String getCompression()
          Return compression level.
 int getCompressionMinSize()
           
 String getDefaultResponseType()
          Return the default response type used
 boolean getDisableUploadTimeout()
          Get the flag that controls upload time-outs.
 boolean getDropConnection()
          Is the keep-alive mechanism enabled or disabled.
 String getForcedRequestType()
          Return the default request type used
 boolean getForceKeepAlive()
          Is keep-alive forced?
 InputStream getInputStream()
           
 int getMaxHttpHeaderSize()
           
 int getMaxPostSize()
          Return the maximum size of a POST which will be buffered in SSL mode.
 Request getRequest()
          Return the internal Request object.
 String getRequestURI()
          Get the request URI associated with this processor.
 boolean getReRegisterSelectionKey()
          False prevents the selectionkey from being re registered after async is done in the terminateProcess() call.
 int getSendBufferSize()
           
 SSLSupport getSSLSupport()
          Return the SSLSupport object used by this instance.
 StreamAlgorithm getStreamAlgorithm()
          Return the StreamAlgorithm used by this instance.
 int getTimeout()
          Get the upload uploadTimeout.
 int getTransactionTimeout()
          Set the maximum time, in milliseconds, a WorkerThread executing an instance of this class can execute.
 long getWorkerThreadID()
          Return the current WorkerThread ID associated with this instance.
 boolean hasNextRequest()
           
 void initialize()
          Initialize the stream and the buffer used to parse the request.
protected  void initializeFilters()
          Initialize standard input and output filters.
 void invokeAdapter()
          Invoke the Adapter, which usualy invoke the Servlet Container.
 boolean isAsyncExecutionEnabled()
          Is asynchronous execution enabled?
 boolean isAsyncHttpWriteEnabled()
          Is async HTTP write enabled.
 boolean isError()
           
 boolean isInitialized()
          Returns true, if ProcessorTask was initialized, or false otherwise.
 boolean isKeepAlive()
           
 boolean isSkipPostExecute()
          returns value and resets it to false.
 boolean isUseChunking()
          Is chunking encoding used.
protected  OutputFilter lookupCompressionFilter(MessageBytes encoding)
           
protected  String messageDropConnection(int status)
           
 void parseHost(MessageBytes valueMB)
          Parse host.
 boolean parseRequest()
          Parse the request line and the http header.
 void postProcess()
          Post process the http request, after the response has been commited.
 void postResponse()
          Prepare and post the response.
 void prepareForNextRequest()
           
protected  void prepareRequest()
          After reading the request headers, we have to setup the request filters.
protected  void prepareResponse()
          When committing the response, we have to validate the set of headers, as well as setup the response filters.
 void preProcess()
          Pre process the request by decoding the request line and the header.
 void preProcess(InputStream input, OutputStream output)
          Pre process the request by decoding the request line and the header.
 boolean process(InputStream input, OutputStream output)
          Process pipelined HTTP requests using the specified input and output streams.
 void recycle()
          Recycle this object.
 void setAdapter(Adapter adapter)
          Set the associated adapter.
 void setAptCancelKey(boolean aptCancelKey)
          True if AsyncProtocolFilter should cancel the selectionkey in the terminateProcess() call
 void setAsyncHandler(AsyncHandler asyncHandler)
          Set the AsyncHandler used when asynchronous execution is enabled.
 void setAsyncHttpWriteEnabled(boolean isAsyncHttpWriteEnabled)
          Set if async HTTP write enabled.
 void setBufferSize(int requestBufferSize)
          Set the request input buffer size
 void setCompressableMimeType(String[] compressableMimeTypes)
          Set compressable mime-type list (this method is best when used with a large number of connectors, where it would be better to have all of them referenced a single array).
 void setCompressableMimeTypes(String compressableMimeTypes)
          Set compressable mime-type list List contains users agents separated by ',' : ie: "text/html,text/xml,text/plain"
 void setCompressableMimeTypes(String[] compressableMimeTypes)
          Set compressable mime-type list (this method is best when used with a large number of connectors, where it would be better to have all of them referenced a single array).
 void setCompression(String compression)
          Set compression level.
 void setCompressionMinSize(int compressionMinSize)
           
 void setConnectionHeaderValueSet(boolean connectionHeaderValueSet)
           
 void setDefaultResponseType(String defaultResponseType)
          Set the default response type used.
 void setDisableUploadTimeout(boolean isDisabled)
          Set the flag to control upload time-outs.
 void setDropConnection(boolean dropConnection)
          Enable or disable the keep-alive mechanism.
 void setEnableAsyncExecution(boolean asyncExecution)
          Enable/disable asynchronous execution of this object.
 void setForcedRequestType(String forcedRequestType)
          Sets the forced request type, which is forced onto requests that do not already specify any MIME type.
 void setForceKeepAlive(boolean forceKeepAlive)
          Force keep-alive no mather what the client support.
 void setInputStream(InputStream inputStream)
           
 void setMaxHttpHeaderSize(int maxHttpHeaderSize)
           
 void setMaxPostSize(int mps)
          Set the maximum size of a POST which will be buffered in SSL mode.
 void setNoCompressionUserAgents(String[] noCompressionUserAgents)
          Set no compression user agent list (this method is best when used with a large number of connectors, where it would be better to have all of them referenced a single array).
 void setReRegisterSelectionKey(boolean reRegisterSelectionKey)
          False prevents the selectionkey from being re registered after async is done in the terminateProcess() call.
 void setRestrictedUserAgents(String[] restrictedUserAgents)
          Set restricted user agent list (this method is best when used with a large number of connectors, where it would be better to have all of them referenced a single array).
 void setSendBufferSize(int sendBufferSize)
           
 void setSocket(Socket socket)
          Set the socket associated with this HTTP connection.
 void setSSLSupport(SSLSupport sslSupport)
          Set the SSLSupport object used by this instance.
 void setStreamAlgorithm(StreamAlgorithm streamAlgorithm)
          Set the StreamAlgorithm used by this class.
 void setTimeout(int timeouts)
          Set the upload uploadTimeout.
 void setTransactionTimeout(int transactionTimeout)
          Set the maximum time, in milliseconds, a WorkerThread processing an instance of this class.
 void setUseChunking(boolean useChunking)
          Enable chunking the http response.
protected  boolean statusDropsConnection(int status)
          Determine if we must drop the connection because of the HTTP status code.
 void terminateProcess()
          Notify the TaskListener that the request has been fully processed.
protected  void unregisterMonitoring()
          Unregisters the MBean corresponding to this ProcessorTask.
 
Methods inherited from class com.sun.grizzly.http.TaskBase
call, execute, execute, getSelectionKey, getSelectorHandler, getSelectorThread, getTaskListener, getThreadPool, getType, run, setSelectionKey, setSelectorHandler, setSelectorThread, setTaskListener, setThreadPool
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sm

protected static final StringManager sm
The string manager for this package.


adapter

protected Adapter adapter
Associated adapter.


request

protected Request request
Request object.


response

protected Response response
Response object.


inputBuffer

protected InternalInputBuffer inputBuffer
Input.


inputStream

protected InputStream inputStream
Input Stream.


outputStream

protected OutputStream outputStream
Output Stream.


outputBuffer

protected SocketChannelOutputBuffer outputBuffer
Output.


started

protected boolean started
State flag.


error

protected boolean error
Error flag.


keepAlive

protected boolean keepAlive
Keep-alive.


connectionHeaderValueSet

protected boolean connectionHeaderValueSet
Connection: value


http11

protected boolean http11
HTTP/1.1 flag.


http09

protected boolean http09
HTTP/0.9 flag.


contentDelimitation

protected boolean contentDelimitation
Content delimitator for the request (if false, the connection will be closed at the end of the request).


sslSupport

protected SSLSupport sslSupport
SSL information.


socket

protected Socket socket
Socket associated with the current connection.


remoteAddr

protected String remoteAddr
Remote Address associated with the current connection.


remoteHost

protected String remoteHost
Remote Host associated with the current connection.


localName

protected String localName
Local Host associated with the current connection.


localPort

protected int localPort
Local port to which the socket is connected


remotePort

protected int remotePort
Remote port to which the socket is connected


localAddr

protected String localAddr
The local Host address.


uploadTimeout

protected int uploadTimeout
Maximum uploadTimeout on uploads. 5 minutes as in Apache HTTPD server.


maxPostSize

protected int maxPostSize
Max post size.


hostNameC

protected char[] hostNameC
Host name (used to avoid useless B2C conversion on the host name).


hasRequestInfoRegistered

protected boolean hasRequestInfoRegistered
Has the request associated with this ProcessorTask been registered with the RequestGroupInfo


maxHttpHeaderSize

protected int maxHttpHeaderSize
Default HTTP header buffer size.


requestCount

protected static int requestCount
The number of requests ProcessorTask has proceeded.


requestBufferSize

protected int requestBufferSize
The input request buffer size.


oname

protected ObjectName oname
ObjectName under which this ProcessorTask will be JMX-registered if monitoring has been turned on


dropConnection

protected boolean dropConnection
Allow client of this class to force connection closing.


keepAliveLeft

protected int keepAliveLeft
The current keep-alive count left before closing the connection.


streamAlgorithm

protected StreamAlgorithm streamAlgorithm
The StreamAlgorithm used by this Task to manipulate the request.


defaultResponseType

protected String defaultResponseType
The default response-type


forcedRequestType

protected String forcedRequestType
The forced request-type


asyncExecution

protected boolean asyncExecution
Is asynchronous mode enabled?


requestInfo

protected RequestInfo requestInfo
The code>RequestInfo used to gather stats.


asyncHandler

protected AsyncHandler asyncHandler
When the asynchronous mode is enabled, the execution of this object will be delegated to the AsyncHandler


noCompressionUserAgents

protected String[] noCompressionUserAgents
List of user agents to not use gzip with


compressableMimeTypes

protected String[] compressableMimeTypes
List of MIMES which could be gzipped


compressionLevel

protected int compressionLevel
Allowed compression level.


compressionMinSize

protected int compressionMinSize
Minimum contentsize to make compression.


restrictedUserAgents

protected String[] restrictedUserAgents
List of restricted user agents.


bufferResponse

protected boolean bufferResponse
Buffer the response until the buffer is full.


disableUploadTimeout

protected boolean disableUploadTimeout
Flag to disable setting a different time-out on uploads.


isAsyncHttpWriteEnabled

protected boolean isAsyncHttpWriteEnabled
Flag, which indicates if async HTTP write is enabled


maxKeepAliveRequests

protected int maxKeepAliveRequests
Max keep-alive request before timing out.


handleKeepAliveBlockingThread

protected boolean handleKeepAliveBlockingThread

reRegisterSelectionKey

protected boolean reRegisterSelectionKey
False prevents the selectionkey from being re registered after async is done in the terminateProcess() call


aptCancelKey

protected boolean aptCancelKey
True if AsyncProtocolFilter should cancel the selectionkey in the terminateProcess() call

Constructor Detail

ProcessorTask

public ProcessorTask()

ProcessorTask

public ProcessorTask(boolean init)

ProcessorTask

public ProcessorTask(boolean init,
                     boolean bufferResponse)
Method Detail

initialize

public void initialize()
Initialize the stream and the buffer used to parse the request.


createRequest

protected Request createRequest()
Creates Request object.

Returns:
Request object.

createResponse

protected Response createResponse()
Creates Response object.

Returns:
Response object.

doTask

public void doTask()
            throws IOException
Execute the HTTP request by parsing the header/body, and then by delegating the process to the Catalina container.

Specified by:
doTask in interface Task
Throws:
IOException

preProcess

public void preProcess()
                throws Exception
Pre process the request by decoding the request line and the header.

Throws:
Exception

preProcess

public void preProcess(InputStream input,
                       OutputStream output)
                throws Exception
Pre process the request by decoding the request line and the header.

Parameters:
input - the InputStream to read bytes
output - the OutputStream to write bytes
Throws:
Exception

configPreProcess

protected void configPreProcess()
                         throws Exception
Prepare this object before parsing the request.

Throws:
Exception

doProcess

protected boolean doProcess()
                     throws Exception
Process an HTTP request using a non blocking Socket

Throws:
Exception

hasNextRequest

public boolean hasNextRequest()

postResponse

public void postResponse()
                  throws Exception
Prepare and post the response.

Throws:
Exception

finishResponse

public void finishResponse()
Finish the response


invokeAdapter

public void invokeAdapter()
Invoke the Adapter, which usualy invoke the Servlet Container.


parseRequest

public boolean parseRequest()
                     throws Exception
Parse the request line and the http header.

Throws:
Exception

postProcess

public void postProcess()
                 throws Exception
Post process the http request, after the response has been commited.

Throws:
Exception

terminateProcess

public void terminateProcess()
Notify the TaskListener that the request has been fully processed.


process

public boolean process(InputStream input,
                       OutputStream output)
                throws Exception
Process pipelined HTTP requests using the specified input and output streams.

Specified by:
process in interface Processor
Parameters:
input - stream from which the HTTP requests will be read
output - stream which will be used to output the HTTP responses
Returns:
true if the connection needs to be keep-alived.
Throws:
Exception - error during an I/O operation

getRequestURI

public String getRequestURI()
Get the request URI associated with this processor.


action

public void action(ActionCode actionCode,
                   Object param)
Send an action to the connector.

Specified by:
action in interface ActionHook
Parameters:
actionCode - Type of the action
param - Action parameter

setAdapter

public void setAdapter(Adapter adapter)
Set the associated adapter.

Specified by:
setAdapter in interface Processor
Parameters:
adapter - the new adapter

getAdapter

public Adapter getAdapter()
Get the associated adapter.

Specified by:
getAdapter in interface Processor
Returns:
the associated adapter

prepareRequest

protected void prepareRequest()
After reading the request headers, we have to setup the request filters.


parseHost

public void parseHost(MessageBytes valueMB)
Parse host.


prepareResponse

protected void prepareResponse()
When committing the response, we have to validate the set of headers, as well as setup the response filters.


initializeFilters

protected void initializeFilters()
Initialize standard input and output filters.


addInputFilter

protected boolean addInputFilter(InputFilter[] inputFilters,
                                 String encodingName)
Add an input filter to the current request.

Returns:
false if the encoding was not found (which would mean it is unsupported)

findBytes

protected int findBytes(ByteChunk bc,
                        byte[] b)
Specialized utility method: find a sequence of lower case bytes inside a ByteChunk.


statusDropsConnection

protected boolean statusDropsConnection(int status)
Determine if we must drop the connection because of the HTTP status code. Use the same list of codes as Apache/httpd.


messageDropConnection

protected String messageDropConnection(int status)

addFilter

protected void addFilter(String className)
Add input or output filter.

Parameters:
className - class name of the filter

setMaxPostSize

public void setMaxPostSize(int mps)
Set the maximum size of a POST which will be buffered in SSL mode.


getMaxPostSize

public int getMaxPostSize()
Return the maximum size of a POST which will be buffered in SSL mode.


setSocket

public void setSocket(Socket socket)
Set the socket associated with this HTTP connection.


setTimeout

public void setTimeout(int timeouts)
Set the upload uploadTimeout.


getTimeout

public int getTimeout()
Get the upload uploadTimeout.


isAsyncHttpWriteEnabled

public boolean isAsyncHttpWriteEnabled()
Is async HTTP write enabled.

Returns:
true, if async HTTP write enabled, or false otherwise.

setAsyncHttpWriteEnabled

public void setAsyncHttpWriteEnabled(boolean isAsyncHttpWriteEnabled)
Set if async HTTP write enabled.

Parameters:
isAsyncHttpWriteEnabled - true, if async HTTP write enabled, or false otherwise.

unregisterMonitoring

protected void unregisterMonitoring()
Unregisters the MBean corresponding to this ProcessorTask.


getMaxHttpHeaderSize

public int getMaxHttpHeaderSize()

setMaxHttpHeaderSize

public void setMaxHttpHeaderSize(int maxHttpHeaderSize)

setBufferSize

public void setBufferSize(int requestBufferSize)
Set the request input buffer size


getBufferSize

public int getBufferSize()
Return the request input buffer size


setDropConnection

public void setDropConnection(boolean dropConnection)
Enable or disable the keep-alive mechanism. Setting this value to false will automatically add the following header to the response ' Connection: close '


getDropConnection

public boolean getDropConnection()
Is the keep-alive mechanism enabled or disabled.


setStreamAlgorithm

public void setStreamAlgorithm(StreamAlgorithm streamAlgorithm)
Set the StreamAlgorithm used by this class.


getStreamAlgorithm

public StreamAlgorithm getStreamAlgorithm()
Return the StreamAlgorithm used by this instance.


setDefaultResponseType

public void setDefaultResponseType(String defaultResponseType)
Set the default response type used. Specified as a semi-colon delimited string consisting of content-type, encoding, language, charset


getDefaultResponseType

public String getDefaultResponseType()
Return the default response type used


setForcedRequestType

public void setForcedRequestType(String forcedRequestType)
Sets the forced request type, which is forced onto requests that do not already specify any MIME type.


getForcedRequestType

public String getForcedRequestType()
Return the default request type used


setEnableAsyncExecution

public void setEnableAsyncExecution(boolean asyncExecution)
Enable/disable asynchronous execution of this object.


isAsyncExecutionEnabled

public boolean isAsyncExecutionEnabled()
Is asynchronous execution enabled?


setAsyncHandler

public void setAsyncHandler(AsyncHandler asyncHandler)
Set the AsyncHandler used when asynchronous execution is enabled.


getAsyncHandler

public AsyncHandler getAsyncHandler()
Return the AsyncHandler used when asynchronous execution is enabled.


getRequest

public Request getRequest()
Return the internal Request object.


recycle

public void recycle()
Recycle this object.

Specified by:
recycle in interface Task
Overrides:
recycle in class TaskBase

getCompression

public String getCompression()
Return compression level.


setCompression

public void setCompression(String compression)
Set compression level.


addNoCompressionUserAgent

public void addNoCompressionUserAgent(String userAgent)
Add user-agent for which gzip compression didn't works The user agent String given will be exactly matched to the user-agent header submitted by the client.

Parameters:
userAgent - user-agent string

setNoCompressionUserAgents

public void setNoCompressionUserAgents(String[] noCompressionUserAgents)
Set no compression user agent list (this method is best when used with a large number of connectors, where it would be better to have all of them referenced a single array).


findNoCompressionUserAgents

public String[] findNoCompressionUserAgents()
Return the list of no compression user agents.


addCompressableMimeType

public void addCompressableMimeType(String mimeType)
Add a mime-type which will be compressable The mime-type String will be exactly matched in the response mime-type header .

Parameters:
mimeType - mime-type string

setCompressableMimeTypes

public void setCompressableMimeTypes(String[] compressableMimeTypes)
Set compressable mime-type list (this method is best when used with a large number of connectors, where it would be better to have all of them referenced a single array).


setCompressableMimeTypes

public void setCompressableMimeTypes(String compressableMimeTypes)
Set compressable mime-type list List contains users agents separated by ',' : ie: "text/html,text/xml,text/plain"


setCompressableMimeType

public void setCompressableMimeType(String[] compressableMimeTypes)
Set compressable mime-type list (this method is best when used with a large number of connectors, where it would be better to have all of them referenced a single array).


findCompressableMimeTypes

public String[] findCompressableMimeTypes()
Return the list of comprassable mime types.


detectCompression

protected OutputFilter detectCompression()
Check for compression. Compression is onlky supported when http/1.1 is used.


lookupCompressionFilter

protected OutputFilter lookupCompressionFilter(MessageBytes encoding)

getCompressionMinSize

public int getCompressionMinSize()

setCompressionMinSize

public void setCompressionMinSize(int compressionMinSize)

addRestrictedUserAgent

public void addRestrictedUserAgent(String userAgent)
Add restricted user-agent (which will downgrade the connector to HTTP/1.0 mode). The user agent String given will be exactly matched to the user-agent header submitted by the client.

Parameters:
userAgent - user-agent string

setRestrictedUserAgents

public void setRestrictedUserAgents(String[] restrictedUserAgents)
Set restricted user agent list (this method is best when used with a large number of connectors, where it would be better to have all of them referenced a single array).


findRestrictedUserAgents

public String[] findRestrictedUserAgents()
Return the list of restricted user agents.


getSSLSupport

public SSLSupport getSSLSupport()
Return the SSLSupport object used by this instance.


setSSLSupport

public void setSSLSupport(SSLSupport sslSupport)
Set the SSLSupport object used by this instance.


getWorkerThreadID

public long getWorkerThreadID()
Return the current WorkerThread ID associated with this instance.


isKeepAlive

public boolean isKeepAlive()

setConnectionHeaderValueSet

public void setConnectionHeaderValueSet(boolean connectionHeaderValueSet)

isError

public boolean isError()

getInputStream

public InputStream getInputStream()

setInputStream

public void setInputStream(InputStream inputStream)

setDisableUploadTimeout

public void setDisableUploadTimeout(boolean isDisabled)
Set the flag to control upload time-outs.


getDisableUploadTimeout

public boolean getDisableUploadTimeout()
Get the flag that controls upload time-outs.


getTransactionTimeout

public int getTransactionTimeout()
Set the maximum time, in milliseconds, a WorkerThread executing an instance of this class can execute.

Returns:
the maximum time, in milliseconds

setTransactionTimeout

public void setTransactionTimeout(int transactionTimeout)
Set the maximum time, in milliseconds, a WorkerThread processing an instance of this class.

Parameters:
transactionTimeout - the maximum time, in milliseconds.

isUseChunking

public boolean isUseChunking()
Is chunking encoding used. Default is true;

Returns:
Is chunking encoding used.

setUseChunking

public void setUseChunking(boolean useChunking)
Enable chunking the http response. Default is true.

Parameters:
useChunking -

setReRegisterSelectionKey

public void setReRegisterSelectionKey(boolean reRegisterSelectionKey)
False prevents the selectionkey from being re registered after async is done in the terminateProcess() call. default is true.

Parameters:
reRegisterSelectionKey -

getReRegisterSelectionKey

public boolean getReRegisterSelectionKey()
False prevents the selectionkey from being re registered after async is done in the terminateProcess() call. default is true.

Returns:

setAptCancelKey

public void setAptCancelKey(boolean aptCancelKey)
True if AsyncProtocolFilter should cancel the selectionkey in the terminateProcess() call

Parameters:
aptCancelKey -

getAptCancelKey

public boolean getAptCancelKey()
True if AsyncProtocolFilter should cancel the selectionkey in the terminateProcess() call


setForceKeepAlive

public void setForceKeepAlive(boolean forceKeepAlive)
Force keep-alive no mather what the client support.


getForceKeepAlive

public boolean getForceKeepAlive()
Is keep-alive forced?


getSendBufferSize

public int getSendBufferSize()
Returns:
the sendBufferSize

setSendBufferSize

public void setSendBufferSize(int sendBufferSize)
Parameters:
sendBufferSize - the sendBufferSize to set

isSkipPostExecute

public boolean isSkipPostExecute()
returns value and resets it to false.

Returns:

isInitialized

public boolean isInitialized()
Returns true, if ProcessorTask was initialized, or false otherwise.

Returns:
true, if ProcessorTask was initialized, or false otherwise.

prepareForNextRequest

public void prepareForNextRequest()


Copyright © 2012 Oracle Corporation. All Rights Reserved.