org.apache.tomcat.modules.server
Class Ajp13Interceptor

java.lang.Object
  extended byorg.apache.tomcat.core.BaseInterceptor
      extended byorg.apache.tomcat.modules.server.PoolTcpConnector
          extended byorg.apache.tomcat.modules.server.Ajp13Interceptor
All Implemented Interfaces:
TcpConnectionHandler

public class Ajp13Interceptor
extends PoolTcpConnector
implements TcpConnectionHandler


Field Summary
 
Fields inherited from class org.apache.tomcat.modules.server.PoolTcpConnector
attributes, ep, secure, socketFactory, socketFactoryName, sslImplementation, sslImplementationName
 
Fields inherited from class org.apache.tomcat.core.BaseInterceptor
cm, ct, ctx, debug, DECLINED, loghelper, OK
 
Constructor Summary
Ajp13Interceptor()
           
 
Method Summary
protected  boolean doShutdown(Ajp13 con, java.net.InetAddress serverAddr, java.net.InetAddress clientAddr)
           
 void engineInit(ContextManager cm)
          Called when the ContextManger is started
 void engineState(ContextManager cm, int state)
          Notifies the module that the server changed it's state.
 java.lang.Object[] init()
          Called before the call to processConnection.
 boolean isTomcatAuthentication()
           
protected  void localInit()
           
 void processConnection(TcpConnection connection, java.lang.Object[] thData)
          Assert: connection!=null Assert: connection.getSocket() != null Assert: thData != null and is the result of calling init() Assert: thData is preserved per Thread.
 void setAjpidFile(java.lang.String path)
          Specify ajpid file used when shutting down tomcat
 void setAuthenticateConnection(boolean b)
          Specify if Ajp13 requests must be authenticated
 void setDecodedUri(boolean b)
           
 void setSecret(java.lang.String s)
          Set the 'secret'.
 void setServer(java.lang.Object contextM)
          Add informations about the a "controler" object specific to the server.
 void setShutdownEnable(boolean b)
          Enable shutdown command.
 void setShutDownEnable(boolean b)
          Legacy version
 void setTomcatAuthentication(boolean newTomcatAuthentication)
           
 void setUseSecret(boolean b)
          Enable the use of a secret.
 
Methods inherited from class org.apache.tomcat.modules.server.PoolTcpConnector
engineShutdown, engineStart, getAddress, getEndpoint, getPort, isAttributeSet, isClientauthSet, isKeypassSet, isKeystoreSet, isSameAddress, isSecure, setAddress, setAttribute, setBacklog, setClientauth, setHostName, setKeypass, setKeystore, setMaxSpareThreads, setMaxThreads, setMinSpareThreads, setPools, setPort, setSecure, setServerSoTimeout, setSocketFactory, setSoLinger, setSoTimeout, setSSLImplementation, setTcpNoDelay
 
Methods inherited from class org.apache.tomcat.core.BaseInterceptor
addContainer, addContext, addHandler, addInterceptor, addSecurityConstraint, afterBody, authenticate, authorize, beforeBody, beforeCommit, contextInit, contextMap, contextShutdown, contextState, copyContext, engineStop, findSession, getContext, getContextManager, getDebug, getInfo, getLog, getNote, getNote, handleError, log, log, log, log, postInitCheck, postReadRequest, postRequest, postService, postServletDestroy, postServletInit, preInitCheck, preService, preServletDestroy, preServletInit, registerHooks, reload, removeContainer, removeContext, removeHandler, removeInterceptor, requestMap, sessionState, setContext, setContextManager, setDebug, setInfo, setNote, setNote
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.tomcat.util.net.TcpConnectionHandler
setAttribute
 

Constructor Detail

Ajp13Interceptor

public Ajp13Interceptor()
Method Detail

setShutdownEnable

public void setShutdownEnable(boolean b)
Enable shutdown command. By default it is disabled, since ajp12 has an improved version with password checking. In future we'll enable shutdown in ajp13/14 and deprecate ajp12, and merge various improvements from ajp12. Note that this you can use ajp13 for communication with the server and ajp12 only for shutdown - that would allow some extra flexibility, especially if you use firewall rules.


setShutDownEnable

public void setShutDownEnable(boolean b)
Legacy version


setUseSecret

public void setUseSecret(boolean b)
Enable the use of a secret. The secret will be randomly generated. mod_jk must read the secret to communicate with tomcat. Note that we don't use the secret only for shutdown, but for normal request processing. A 'bad' request may forge auth, etc.


setSecret

public void setSecret(java.lang.String s)
Set the 'secret'. If this is set, all sensitive operations will be disabled unless the request includes a password. This requires a recent version of mod_jk and the worker.NAME.secret property in workers.properties.


setAjpidFile

public void setAjpidFile(java.lang.String path)
Specify ajpid file used when shutting down tomcat


setAuthenticateConnection

public void setAuthenticateConnection(boolean b)
Specify if Ajp13 requests must be authenticated


setDecodedUri

public void setDecodedUri(boolean b)

localInit

protected void localInit()
                  throws java.lang.Exception
Specified by:
localInit in class PoolTcpConnector
Throws:
java.lang.Exception

engineInit

public void engineInit(ContextManager cm)
                throws TomcatException
Description copied from class: PoolTcpConnector
Called when the ContextManger is started

Overrides:
engineInit in class PoolTcpConnector
Throws:
TomcatException

engineState

public void engineState(ContextManager cm,
                        int state)
                 throws TomcatException
Description copied from class: BaseInterceptor
Notifies the module that the server changed it's state. XXX this seems more flexible than init/start/stop/shutdown.

Overrides:
engineState in class BaseInterceptor
Throws:
TomcatException

init

public java.lang.Object[] init()
Description copied from interface: TcpConnectionHandler
Called before the call to processConnection. If the thread is reused, init() should be called once per thread. It may look strange, but it's a _very_ good way to avoid synchronized methods and keep per thread data. Assert: the object returned from init() will be passed to all processConnection() methods happening in the same thread.

Specified by:
init in interface TcpConnectionHandler

processConnection

public void processConnection(TcpConnection connection,
                              java.lang.Object[] thData)
Description copied from interface: TcpConnectionHandler
Assert: connection!=null Assert: connection.getSocket() != null Assert: thData != null and is the result of calling init() Assert: thData is preserved per Thread.

Specified by:
processConnection in interface TcpConnectionHandler

setServer

public void setServer(java.lang.Object contextM)
Description copied from interface: TcpConnectionHandler
Add informations about the a "controler" object specific to the server. In tomcat it will be a ContextManager.

Specified by:
setServer in interface TcpConnectionHandler

doShutdown

protected boolean doShutdown(Ajp13 con,
                             java.net.InetAddress serverAddr,
                             java.net.InetAddress clientAddr)

isTomcatAuthentication

public boolean isTomcatAuthentication()

setTomcatAuthentication

public void setTomcatAuthentication(boolean newTomcatAuthentication)


Copyright ? 2001 Apache Software Foundation. All Rights Reserved.