com.sun.grizzly.http
Class DefaultProcessorTask

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

public class DefaultProcessorTask
extends TaskBase
implements Processor, ActionHook, ProcessorTask

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

Author:
Jean-Francois Arcand

Field Summary
protected  Adapter adapter
          Associated adapter.
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  Interceptor handler
          The handler used by this Task to manipulate the request.
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 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 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  InternalOutputBuffer 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  Response response
          Response object.
protected  String[] restrictedUserAgents
          List of restricted user agents.
protected  Socket socket
          Socket associated with the current connection.
protected  SSLSupport sslSupport
          SSL information.
protected  boolean started
          State flag.
protected  int uploadTimeout
          Maximum uploadTimeout on uploads.
 
Fields inherited from class com.sun.grizzly.http.TaskBase
key, listeners, pipeline, recycle, selectorThread, type
 
Fields inherited from interface com.sun.grizzly.http.Task
ACCEPT_TASK, PROCESSOR_TASK, READ_TASK
 
Constructor Summary
DefaultProcessorTask()
           
DefaultProcessorTask(boolean init)
           
DefaultProcessorTask(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  boolean doProcess()
          Process an HTTP request using a non blocking socket
protected  boolean doProcess(InputStream input, OutputStream output)
          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.
 Adapter getAdapter()
          Get the associated adapter.
 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
 Interceptor getHandler()
          Return the Interceptor used by this instance.
 InputStream getInputStream()
          Get the InputStream associated with HTTP connection
 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.
 Socket getSocket()
          Return the current Socket used by this instance
 SSLSupport getSSLSupport()
          Return the SSLSupport object used by this instance.
 int getTimeout()
          Get the upload uploadTimeout.
 long getWorkerThreadID()
          Return the current WorkerThread ID associated with this instance.
 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 isError()
          Has an error occured duing the HTTP parsing?
 boolean isKeepAlive()
          Return true if the connection header was keep-alive.
 void parseHost(MessageBytes valueMB)
          Parse host.
 void parseRequest()
          Parse the request line and the http header.
 boolean parseRequest(InputStream input, OutputStream output, boolean keptAlive)
          Parse the request line and the http header.
 void postProcess()
          Post process the http request, after the response has been commited.
 void postProcess(InputStream input, OutputStream output)
          Post process the http request, after the response has been commited.
 void postResponse()
          Prepare and post the response.
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()
          Recyle this object.
 void setAdapter(Adapter adapter)
          Set the associated adapter.
 void setAsyncHandler(AsyncHandler asyncHandler)
          Set the AsyncHandler used when asynchronous execution is 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 setError(boolean error)
           
 void setForcedRequestType(String forcedRequestType)
          Sets the forced request type, which is forced onto requests that do not already specify any MIME type.
 void setHandler(Interceptor handler)
          Set the Interceptor used by this class.
 void setInputStream(InputStream inputStream)
          Set the InputStream associated with HTTP connection
 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 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 setSocket(Socket socket)
          Set the socket associated with this HTTP connection.
 void setSSLSupport(SSLSupport sslSupport)
          Set the SSLSupport object used by this instance.
 void setTimeout(int timeouts)
          Set the upload uploadTimeout.
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.
 
Methods inherited from class com.sun.grizzly.http.TaskBase
addTaskListener, call, cancelTask, clearTaskListeners, execute, fireTaskEvent, getKeepAliveStats, getPipeline, getRecycle, getRequestGroupInfo, getSelectionKey, getSelectorThread, getTaskListeners, getType, isMonitoringEnabled, removeTaskListener, run, setPipeline, setRecycle, setSelectionKey, setSelectorThread, taskEvent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.sun.grizzly.http.Task
addTaskListener, cancelTask, clearTaskListeners, execute, getKeepAliveStats, getPipeline, getRecycle, getRequestGroupInfo, getSelectionKey, getSelectorThread, getTaskListeners, getType, isMonitoringEnabled, removeTaskListener, setPipeline, setRecycle, setSelectionKey, setSelectorThread
 
Methods inherited from interface java.lang.Runnable
run
 
Methods inherited from interface java.util.concurrent.Callable
call
 

Field Detail

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 InternalOutputBuffer 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.


handler

protected Interceptor handler
The handler 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.

Constructor Detail

DefaultProcessorTask

public DefaultProcessorTask()

DefaultProcessorTask

public DefaultProcessorTask(boolean init)

DefaultProcessorTask

public DefaultProcessorTask(boolean init,
                            boolean bufferResponse)
Method Detail

initialize

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

Specified by:
initialize in interface ProcessorTask

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.

Specified by:
preProcess in interface ProcessorTask
Throws:
Exception

preProcess

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

Specified by:
preProcess in interface ProcessorTask
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

doProcess

protected boolean doProcess(InputStream input,
                            OutputStream output)
                     throws Exception
Process an HTTP request using a non blocking socket

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

postResponse

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

Specified by:
postResponse in interface ProcessorTask
Parameters:
input - the InputStream to read bytes
output - the OutputStream to write bytes
Throws:
Exception

invokeAdapter

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

Specified by:
invokeAdapter in interface ProcessorTask

parseRequest

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

Specified by:
parseRequest in interface ProcessorTask
Throws:
Exception

parseRequest

public boolean parseRequest(InputStream input,
                            OutputStream output,
                            boolean keptAlive)
                     throws Exception
Parse the request line and the http header.

Specified by:
parseRequest in interface ProcessorTask
Parameters:
input - the InputStream to read bytes
output - the OutputStream to write bytes
Returns:
true if the parsing was successful.
Throws:
Exception

postProcess

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

Specified by:
postProcess in interface ProcessorTask
Throws:
Exception

postProcess

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

Specified by:
postProcess in interface ProcessorTask
Throws:
Exception

terminateProcess

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

Specified by:
terminateProcess in interface ProcessorTask

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 ProcessorTask
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.

Specified by:
getRequestURI in interface ProcessorTask

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.


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.

Specified by:
setMaxPostSize in interface ProcessorTask

getMaxPostSize

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

Specified by:
getMaxPostSize in interface ProcessorTask

setSocket

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

Specified by:
setSocket in interface ProcessorTask

setTimeout

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

Specified by:
setTimeout in interface ProcessorTask

getTimeout

public int getTimeout()
Get the upload uploadTimeout.


getMaxHttpHeaderSize

public int getMaxHttpHeaderSize()

setMaxHttpHeaderSize

public void setMaxHttpHeaderSize(int maxHttpHeaderSize)
Specified by:
setMaxHttpHeaderSize in interface ProcessorTask

setBufferSize

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

Specified by:
setBufferSize in interface ProcessorTask

getBufferSize

public int getBufferSize()
Return the request input buffer size

Specified by:
getBufferSize in interface ProcessorTask

getSocket

public Socket getSocket()
Return the current Socket used by this instance

Specified by:
getSocket in interface ProcessorTask
Overrides:
getSocket in class TaskBase
Returns:
socket the current Socket used by this instance

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 '

Specified by:
setDropConnection in interface ProcessorTask

getDropConnection

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

Specified by:
getDropConnection in interface ProcessorTask

setHandler

public void setHandler(Interceptor handler)
Set the Interceptor used by this class.

Specified by:
setHandler in interface ProcessorTask

getHandler

public Interceptor getHandler()
Return the Interceptor used by this instance.

Specified by:
getHandler in interface ProcessorTask

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()
Recyle 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.


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.

Specified by:
getWorkerThreadID in interface ProcessorTask

isKeepAlive

public boolean isKeepAlive()
Description copied from interface: ProcessorTask
Return true if the connection header was keep-alive.

Specified by:
isKeepAlive in interface ProcessorTask

setConnectionHeaderValueSet

public void setConnectionHeaderValueSet(boolean connectionHeaderValueSet)

isError

public boolean isError()
Description copied from interface: ProcessorTask
Has an error occured duing the HTTP parsing?

Specified by:
isError in interface ProcessorTask

setError

public void setError(boolean error)

getInputStream

public InputStream getInputStream()
Description copied from interface: ProcessorTask
Get the InputStream associated with HTTP connection

Specified by:
getInputStream in interface ProcessorTask

setInputStream

public void setInputStream(InputStream inputStream)
Description copied from interface: ProcessorTask
Set the InputStream associated with HTTP connection

Specified by:
setInputStream in interface ProcessorTask

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.



Copyright © 2011 SUN Microsystems. All Rights Reserved.