Apache Tomcat 7.0.4

org.apache.coyote.ajp
Class AbstractAjpProcessor

java.lang.Object
  extended by org.apache.coyote.ajp.AbstractAjpProcessor
All Implemented Interfaces:
ActionHook, Processor
Direct Known Subclasses:
AjpAprProcessor, AjpProcessor

public abstract class AbstractAjpProcessor
extends Object
implements ActionHook, Processor

Base class for AJP Processor implementations.


Nested Class Summary
protected  class AbstractAjpProcessor.SocketInputBuffer
          This class is an input buffer which will read its data from an input stream.
 
Field Summary
protected  Adapter adapter
          Associated adapter.
protected  AsyncStateMachine asyncStateMachine
          Track changes in state for async requests.
protected  MessageBytes bodyBytes
          Body message.
protected  AjpMessage bodyMessage
          Body message.
protected  MessageBytes certificates
          Byte chunk for certs.
protected  boolean empty
          Body empty flag.
protected  boolean endOfStream
          End of stream flag.
protected  AbstractEndpoint endpoint
          Associated endpoint.
protected  boolean error
          Error flag.
protected  boolean finished
          Finished response.
protected  boolean first
          First read.
protected  char[] hostNameC
          Host name (used to avoid useless B2C conversion on the host name).
protected  int packetSize
          AJP packet size.
protected  boolean replay
          Replay read.
protected  Request request
          Request object.
protected  AjpMessage requestHeaderMessage
          Header message.
protected  String requiredSecret
          Required secret.
protected  Response response
          Response object.
protected  AjpMessage responseHeaderMessage
          Message used for response header composition.
protected static StringManager sm
          The string manager for this package.
protected  MessageBytes tmpMB
          Temp message bytes used for processing.
protected  boolean tomcatAuthentication
          Use Tomcat authentication ?
 
Constructor Summary
AbstractAjpProcessor()
           
 
Method Summary
 void action(ActionCode actionCode, Object param)
          Send an action to the connector.
protected abstract  void actionInternal(ActionCode actionCode, Object param)
           
protected  AbstractEndpoint.Handler.SocketState asyncPostProcess()
           
protected abstract  void finish()
           
protected abstract  void flush(boolean tbd)
           
 Adapter getAdapter()
          Get the associated adapter.
abstract  Executor getExecutor()
           
protected abstract  Log getLog()
           
 Request getRequest()
          Get the request associated with this processor.
 boolean getTomcatAuthentication()
           
protected  boolean isAsync()
           
protected abstract  void output(byte[] src, int offset, int length)
           
protected  void parseHost(MessageBytes valueMB)
          Parse host.
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.
protected abstract  boolean receive()
           
 void recycle()
           
protected abstract  boolean refillReadBuffer()
           
 void setAdapter(Adapter adapter)
          Set the associated adapter.
 void setRequiredSecret(String requiredSecret)
           
 void setTomcatAuthentication(boolean tomcatAuthentication)
           
 
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.


endpoint

protected AbstractEndpoint endpoint
Associated endpoint.


request

protected Request request
Request object.


response

protected Response response
Response object.


packetSize

protected int packetSize
AJP packet size.


requestHeaderMessage

protected AjpMessage requestHeaderMessage
Header message. Note that this header is merely the one used during the processing of the first message of a "request", so it might not be a request header. It will stay unchanged during the processing of the whole request.


responseHeaderMessage

protected AjpMessage responseHeaderMessage
Message used for response header composition.


bodyMessage

protected AjpMessage bodyMessage
Body message.


bodyBytes

protected MessageBytes bodyBytes
Body message.


error

protected boolean error
Error flag.


hostNameC

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


tmpMB

protected MessageBytes tmpMB
Temp message bytes used for processing.


certificates

protected MessageBytes certificates
Byte chunk for certs.


endOfStream

protected boolean endOfStream
End of stream flag.


empty

protected boolean empty
Body empty flag.


first

protected boolean first
First read.


replay

protected boolean replay
Replay read.


finished

protected boolean finished
Finished response.


asyncStateMachine

protected AsyncStateMachine asyncStateMachine
Track changes in state for async requests.


tomcatAuthentication

protected boolean tomcatAuthentication
Use Tomcat authentication ?


requiredSecret

protected String requiredSecret
Required secret.

Constructor Detail

AbstractAjpProcessor

public AbstractAjpProcessor()
Method Detail

getLog

protected abstract Log getLog()

getTomcatAuthentication

public boolean getTomcatAuthentication()

setTomcatAuthentication

public void setTomcatAuthentication(boolean tomcatAuthentication)

setRequiredSecret

public void setRequiredSecret(String requiredSecret)

getRequest

public Request getRequest()
Get the request associated with this processor.

Returns:
The request

action

public final 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

actionInternal

protected abstract void actionInternal(ActionCode actionCode,
                                       Object param)

flush

protected abstract void flush(boolean tbd)
                       throws IOException
Throws:
IOException

finish

protected abstract void finish()
                        throws IOException
Throws:
IOException

getExecutor

public abstract Executor getExecutor()
Specified by:
getExecutor in interface Processor

recycle

public void recycle()

setAdapter

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

Parameters:
adapter - the new adapter

getAdapter

public Adapter getAdapter()
Get the associated adapter.

Returns:
the associated adapter

prepareRequest

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


parseHost

protected void parseHost(MessageBytes valueMB)
Parse host.


prepareResponse

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

Throws:
IOException

output

protected abstract void output(byte[] src,
                               int offset,
                               int length)
                        throws IOException
Throws:
IOException

isAsync

protected boolean isAsync()

asyncPostProcess

protected AbstractEndpoint.Handler.SocketState asyncPostProcess()

receive

protected abstract boolean receive()
                            throws IOException
Throws:
IOException

refillReadBuffer

protected abstract boolean refillReadBuffer()
                                     throws IOException
Throws:
IOException

Apache Tomcat 7.0.4

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