Apache Tomcat 7.0.4

org.apache.coyote.http11
Class Http11NioProcessor

java.lang.Object
  extended by org.apache.coyote.http11.AbstractHttp11Processor
      extended by org.apache.coyote.http11.Http11NioProcessor
All Implemented Interfaces:
ActionHook, Processor

public class Http11NioProcessor
extends AbstractHttp11Processor

Processes HTTP requests.

Author:
Remy Maucherat, Filip Hanik

Field Summary
protected  boolean comet
          Comet used.
protected  boolean cometClose
          Closed flag, a Comet async thread can signal for this Nio processor to be closed and recycled instead of waiting for a timeout.
protected  NioEndpoint endpoint
          Associated endpoint.
protected  InternalNioInputBuffer inputBuffer
          Input.
protected  InternalNioOutputBuffer outputBuffer
          Output.
protected  NioEndpoint.SendfileData sendfileData
          Sendfile data.
protected  NioChannel socket
          Socket associated with the current connection.
protected  boolean ssl
          SSL enabled ?
protected  SSLSupport sslSupport
          SSL information.
 
Fields inherited from class org.apache.coyote.http11.AbstractHttp11Processor
adapter, asyncStateMachine, compressableMimeTypes, compressionLevel, compressionMinSize, contentDelimitation, disableUploadTimeout, error, expectation, hostNameC, http09, http11, isSecurityEnabled, keepAlive, keepAliveTimeout, localAddr, localName, localPort, maxKeepAliveRequests, maxSavePostSize, noCompressionUserAgents, remoteAddr, remoteHost, remotePort, request, response, restrictedUserAgents, server, sm, socketBuffer, timeout
 
Constructor Summary
Http11NioProcessor(int maxHttpHeaderSize, NioEndpoint endpoint)
           
 
Method Summary
 void actionInternal(ActionCode actionCode, Object param)
          Send an action to the connector.
 AbstractEndpoint.Handler.SocketState asyncDispatch(SocketStatus status)
          Process pipelined HTTP requests using the specified input and output streams.
 AbstractEndpoint.Handler.SocketState event(SocketStatus status)
          Process pipelined HTTP requests using the specified input and output streams.
protected  int findBytes(ByteChunk bc, byte[] b)
          Specialized utility method: find a sequence of lower case bytes inside a ByteChunk.
protected  AbstractEndpoint getEndpoint()
          Expose the endpoint.
 Executor getExecutor()
           
protected  AbstractInputBuffer getInputBuffer()
          Exposes input buffer to super class to allow better code re-use.
protected  Log getLog()
           
protected  AbstractOutputBuffer getOutputBuffer()
          Exposes output buffer to super class to allow better code re-use.
 SSLSupport getSslSupport()
           
 void parseHost(MessageBytes valueMB)
          Parse host.
protected  void prepareRequest()
          After reading the request headers, we have to setup the request filters.
protected  boolean prepareSendfile(OutputFilter[] outputFilters)
           
 AbstractEndpoint.Handler.SocketState process(NioChannel socket)
          Process pipelined HTTP requests using the specified input and output streams.
 void recycleInternal()
           
 void setSslSupport(SSLSupport sslSupport)
          Set the SSL information for this HTTP connection.
protected  boolean statusDropsConnection(int status)
          Determine if we must drop the connection because of the HTTP status code.
 
Methods inherited from class org.apache.coyote.http11.AbstractHttp11Processor
action, addCompressableMimeType, addFilter, addInputFilter, addNoCompressionUserAgent, addRestrictedUserAgent, asyncPostProcess, endRequest, findCompressableMimeTypes, findRestrictedUserAgents, getAdapter, getCompression, getDisableUploadTimeout, getKeepAliveTimeout, getMaxKeepAliveRequests, getMaxSavePostSize, getRequest, getServer, getSocketBuffer, getTimeout, initializeFilters, isAsync, recycle, setAdapter, setCompressableMimeTypes, setCompressableMimeTypes, setCompression, setCompressionMinSize, setDisableUploadTimeout, setKeepAliveTimeout, setMaxKeepAliveRequests, setMaxSavePostSize, setNoCompressionUserAgents, setNoCompressionUserAgents, setRestrictedUserAgents, setRestrictedUserAgents, setServer, setSocketBuffer, setTimeout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sslSupport

protected SSLSupport sslSupport
SSL information.


inputBuffer

protected InternalNioInputBuffer inputBuffer
Input.


outputBuffer

protected InternalNioOutputBuffer outputBuffer
Output.


sendfileData

protected NioEndpoint.SendfileData sendfileData
Sendfile data.


comet

protected boolean comet
Comet used.


cometClose

protected boolean cometClose
Closed flag, a Comet async thread can signal for this Nio processor to be closed and recycled instead of waiting for a timeout. Closed by HttpServletResponse.getWriter().close()


ssl

protected boolean ssl
SSL enabled ?


socket

protected NioChannel socket
Socket associated with the current connection.


endpoint

protected NioEndpoint endpoint
Associated endpoint.

Constructor Detail

Http11NioProcessor

public Http11NioProcessor(int maxHttpHeaderSize,
                          NioEndpoint endpoint)
Method Detail

getLog

protected Log getLog()
Specified by:
getLog in class AbstractHttp11Processor

getEndpoint

protected AbstractEndpoint getEndpoint()
Expose the endpoint.


event

public AbstractEndpoint.Handler.SocketState event(SocketStatus status)
                                           throws IOException
Process pipelined HTTP requests using the specified input and output streams.

Throws:
IOException - error during an I/O operation

asyncDispatch

public AbstractEndpoint.Handler.SocketState asyncDispatch(SocketStatus status)
                                                   throws IOException
Process pipelined HTTP requests using the specified input and output streams.

Throws:
IOException - error during an I/O operation

process

public AbstractEndpoint.Handler.SocketState process(NioChannel socket)
                                             throws IOException
Process pipelined HTTP requests using the specified input and output streams.

Throws:
IOException - error during an I/O operation

recycleInternal

public void recycleInternal()
Specified by:
recycleInternal in class AbstractHttp11Processor

actionInternal

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

Parameters:
actionCode - Type of the action
param - Action parameter

getSslSupport

public SSLSupport getSslSupport()

prepareRequest

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


parseHost

public void parseHost(MessageBytes valueMB)
Parse host.


prepareSendfile

protected boolean prepareSendfile(OutputFilter[] outputFilters)

findBytes

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

Overrides:
findBytes in class AbstractHttp11Processor

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.

Overrides:
statusDropsConnection in class AbstractHttp11Processor

getInputBuffer

protected AbstractInputBuffer getInputBuffer()
Description copied from class: AbstractHttp11Processor
Exposes input buffer to super class to allow better code re-use.

Specified by:
getInputBuffer in class AbstractHttp11Processor
Returns:
The input buffer used by the processor.

getOutputBuffer

protected AbstractOutputBuffer getOutputBuffer()
Description copied from class: AbstractHttp11Processor
Exposes output buffer to super class to allow better code re-use.

Specified by:
getOutputBuffer in class AbstractHttp11Processor
Returns:
The output buffer used by the processor.

setSslSupport

public void setSslSupport(SSLSupport sslSupport)
Set the SSL information for this HTTP connection.


getExecutor

public Executor getExecutor()
Specified by:
getExecutor in interface Processor
Specified by:
getExecutor in class AbstractHttp11Processor

Apache Tomcat 7.0.4

Copyright © 2000-2010 Apache Software Foundation. All Rights Reserved.