Methods Summary |
---|
public int | countBlockingKeepAlive()Return the number of blocking keep-alive connection
if (maxKeepAliveRequests == -1) return -1;
return maxKeepAliveRequests - keepAliveLeft;
|
protected boolean | doProcess(java.io.InputStream input, java.io.OutputStream output)Process an HTTP request using a blocking socket
boolean keptAlive = false;
while (started && !error && keepAlive) {
boolean exitWhile = parseRequest(input,output,keptAlive);
if (exitWhile) break;
invokeAdapter();
postResponse();
}
return true;
|
public void | doTask()Execute the HTTP request by parsing the header/body,
and then by delegating the process to the Catalina container.
try {
process(socket.getInputStream(),socket.getOutputStream());
} catch(Throwable ex){
ex.printStackTrace();
SelectorThread.logger().log(Level.FINE,
"processorTask.errorProcessingRequest", ex);
} finally {
terminateProcess();
}
|
public int | getMaxKeepAliveRequests()Return the number of Keep-Alive requests that we will honor.
return maxKeepAliveRequests;
|
public org.apache.tomcat.util.net.SSLImplementation | getSSLImplementation()Return the current SSLImplementation this Thread
return sslImplementation;
|
public void | initialize()Initialize the stream and the buffer used to parse the request.
started = true;
request = new Request();
response = new Response();
response.setHook(this);
inputBuffer = new InternalInputBuffer(request,requestBufferSize);
outputBuffer = new InternalOutputBuffer(response,
maxHttpHeaderSize);
request.setInputBuffer(inputBuffer);
response.setOutputBuffer(outputBuffer);
request.setResponse(response);
initializeFilters();
|
public boolean | parseRequest(java.io.InputStream input, java.io.OutputStream output, boolean keptAlive)Parse the request line and the http header.
boolean exitWhile = super.parseRequest(input,output,keptAlive);
if (maxKeepAliveRequests > 0 && --keepAliveLeft == 0)
keepAlive = false;
return exitWhile;
|
public void | preProcess(java.io.InputStream input, java.io.OutputStream output)Pre process the request by decoding the request line and the header.
// Make sure this object has been initialized.
if ( !started ){
initialize();
}
// Setting up the I/O
inputBuffer.setInputStream(input);
outputBuffer.setOutputStream(output);
configPreProcess();
|
public boolean | process(java.io.InputStream input, java.io.OutputStream output)Process pipelined HTTP requests using the specified input and output
streams.
preProcess(input,output);
if (sslImplementation != null) {
sslSupport = sslImplementation.getSSLSupport(socket);
}
doProcess(input,output);
postProcess(input,output);
return keepAlive;
|
public void | recycle()Recyle this object.
socket = null;
dropConnection = false;
|
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.
this.maxKeepAliveRequests = maxKeepAliveRequests;
|
public void | setSSLImplementation(org.apache.tomcat.util.net.SSLImplementation sslImplementation)Set the SSLImplementation used by this thread.It usually
means HTTPS will be used.
this.sslImplementation = sslImplementation;
|
public void | taskEvent(com.sun.enterprise.web.connector.grizzly.TaskEvent event)
if ( event.getStatus() == TaskEvent.START) {
taskContext = (TaskContext)event.attachement();
if ( taskEvent == null ) {
taskEvent = new TaskEvent<TaskContext>();
}
taskEvent.attach(taskContext);
execute();
}
|
public void | terminateProcess()Notify the TaskListener that the request has been
fully processed.
taskEvent.setStatus(TaskEvent.COMPLETED);
fireTaskEvent(taskEvent);
|