com.sun.enterprise.web.connector.grizzly.blocking
Class ProcessorBlockingTask

java.lang.Object
  extended by com.sun.enterprise.web.connector.grizzly.TaskBase
      extended by com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask
          extended by com.sun.enterprise.web.connector.grizzly.blocking.ProcessorBlockingTask
All Implemented Interfaces:
ProcessorTask, Task, TaskListener, Runnable, Callable, ActionHook, Processor

public class ProcessorBlockingTask
extends DefaultProcessorTask

Process HTTP request. This class is based on org.apache.coyote.http11.Http11Processor. This class must be used when NIO Blocking is enabled.

Author:
Jean-Francois Arcand

Field Summary
protected  SSLImplementation sslImplementation
          The wrapper used to support SSL.
 
Fields inherited from class com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask
adapter, asyncExecution, asyncHandler, bufferResponse, compressableMimeTypes, compressionLevel, compressionMinSize, connectionHeaderValueSet, contentDelimitation, defaultResponseType, disableUploadTimeout, dropConnection, error, forcedRequestType, handler, hasRequestInfoRegistered, hostNameC, http09, http11, inputBuffer, keepAlive, keepAliveLeft, localAddr, localName, localPort, maxHttpHeaderSize, maxKeepAliveRequests, maxPostSize, noCompressionUserAgents, oname, outputBuffer, remoteAddr, remoteHost, remotePort, request, requestBufferSize, requestCount, requestInfo, response, restrictedUserAgents, socket, sslSupport, started, taskContext, taskEvent, uploadTimeout
 
Fields inherited from class com.sun.enterprise.web.connector.grizzly.TaskBase
key, listeners, pipeline, recycle, selectorThread, type
 
Fields inherited from interface com.sun.enterprise.web.connector.grizzly.Task
ACCEPT_TASK, PROCESSOR_TASK, READ_TASK
 
Constructor Summary
ProcessorBlockingTask()
           
ProcessorBlockingTask(boolean init)
           
 
Method Summary
 int countBlockingKeepAlive()
          Return the number of blocking keep-alive connection
protected  boolean doProcess(InputStream input, OutputStream output)
          Process an HTTP request using a blocking socket
 void doTask()
          Execute the HTTP request by parsing the header/body, and then by delegating the process to the Catalina container.
 int getMaxKeepAliveRequests()
          Return the number of Keep-Alive requests that we will honor.
 SSLImplementation getSSLImplementation()
          Return the current SSLImplementation this Thread
 void initialize()
          Initialize the stream and the buffer used to parse the request.
 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 setMaxKeepAliveRequests(int maxKeepAliveRequests)
          Set the maximum number of Keep-Alive requests to honor.
 void setSSLImplementation(SSLImplementation sslImplementation)
          Set the SSLImplementation used by this thread.It usually means HTTPS will be used.
 void taskEvent(TaskEvent event)
          This method is invoked when a WorkerThread starts processing a Task object.
 void terminateProcess()
          Notify the TaskListener that the request has been fully processed.
 
Methods inherited from class com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask
action, addCompressableMimeType, addFilter, addInputFilter, addNoCompressionUserAgent, addRestrictedUserAgent, configPreProcess, doProcess, findBytes, findCompressableMimeTypes, findNoCompressionUserAgents, findRestrictedUserAgents, getAdapter, getAsyncHandler, getBufferSize, getCompression, getCompressionMinSize, getDefaultResponseType, getDisableUploadTimeout, getDropConnection, getForcedRequestType, getHandler, getMaxHttpHeaderSize, getMaxPostSize, getRequest, getRequestURI, getSocket, getSSLSupport, getTimeout, getWorkerThreadID, initializeFilters, invokeAdapter, isAsyncExecutionEnabled, isError, isKeepAlive, parseHost, parseRequest, parseRequest, postProcess, postProcess, postResponse, prepareRequest, prepareResponse, preProcess, setAdapter, setAsyncHandler, setBufferSize, setCompressableMimeType, setCompressableMimeTypes, setCompressableMimeTypes, setCompression, setCompressionMinSize, setConnectionHeaderValueSet, setDefaultResponseType, setDisableUploadTimeout, setDropConnection, setEnableAsyncExecution, setError, setForcedRequestType, setForceKeepAlive, setHandler, setMaxHttpHeaderSize, setMaxPostSize, setNoCompressionUserAgents, setRestrictedUserAgents, setSocket, setSSLSupport, setTimeout, statusDropsConnection
 
Methods inherited from class com.sun.enterprise.web.connector.grizzly.TaskBase
addTaskListener, call, cancelTask, clearTaskListeners, execute, fireTaskEvent, getKeepAliveStats, getPipeline, getRecycle, getRequestGroupInfo, getSelectionKey, getSelectorThread, getTaskListeners, getType, isMonitoringEnabled, removeTaskListener, run, setPipeline, setRecycle, setSelectionKey, setSelectorThread
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.sun.enterprise.web.connector.grizzly.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

sslImplementation

protected SSLImplementation sslImplementation
The wrapper used to support SSL.

Constructor Detail

ProcessorBlockingTask

public ProcessorBlockingTask()

ProcessorBlockingTask

public ProcessorBlockingTask(boolean init)
Method Detail

initialize

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

Specified by:
initialize in interface ProcessorTask
Overrides:
initialize in class DefaultProcessorTask

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
Overrides:
doTask in class DefaultProcessorTask
Throws:
IOException

taskEvent

public void taskEvent(TaskEvent event)
Description copied from interface: TaskListener
This method is invoked when a WorkerThread starts processing a Task object.

Specified by:
taskEvent in interface TaskListener
Overrides:
taskEvent in class DefaultProcessorTask

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
Overrides:
process in class DefaultProcessorTask
Parameters:
input - stream from which the HTTP requests will be read
output - stream which will be used to output the HTTP responses
Returns:
true is an error occured.
Throws:
Exception - error during an I/O operation

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
Overrides:
preProcess in class DefaultProcessorTask
Parameters:
input - the InputStream to read bytes
output - the OutputStream to write bytes
Throws:
Exception

doProcess

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

Overrides:
doProcess in class DefaultProcessorTask
Parameters:
input - the InputStream to read bytes
output - the OutputStream to write bytes
Throws:
Exception

terminateProcess

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

Specified by:
terminateProcess in interface ProcessorTask
Overrides:
terminateProcess in class DefaultProcessorTask

setMaxKeepAliveRequests

public void setMaxKeepAliveRequests(int maxKeepAliveRequests)
Set the maximum number of Keep-Alive requests to honor. This is to safeguard from DoS attacks. Setting to a negative value disables the check.


getMaxKeepAliveRequests

public int getMaxKeepAliveRequests()
Return the number of Keep-Alive requests that we will honor.


countBlockingKeepAlive

public int countBlockingKeepAlive()
Return the number of blocking keep-alive connection


getSSLImplementation

public SSLImplementation getSSLImplementation()
Return the current SSLImplementation this Thread


setSSLImplementation

public void setSSLImplementation(SSLImplementation sslImplementation)
Set the SSLImplementation used by this thread.It usually means HTTPS will be used.


recycle

public void recycle()
Recyle this object.

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


Copyright © 2005-2015 Oracle Corporation. All Rights Reserved.