org.apache.coyote.ajp
Class AjpProtocol

java.lang.Object
  extended by org.apache.coyote.ajp.AjpProtocol
All Implemented Interfaces:
javax.management.MBeanRegistration, ProtocolHandler

public class AjpProtocol
extends java.lang.Object
implements ProtocolHandler, javax.management.MBeanRegistration

Abstract the protocol implementation, including threading, etc. Processor is single threaded and specific to stream-based protocols, will not fit Jk protocols like JNI.

Author:
Remy Maucherat, Costin Manolache

Nested Class Summary
protected static class AjpProtocol.AjpConnectionHandler
           
 
Field Summary
protected  java.util.Hashtable attributes
          Configuration attributes.
protected  java.lang.String domain
           
protected  JIoEndpoint ep
          Associated java.io endpoint.
protected  int keepAliveTimeout
          The number of seconds Tomcat will wait for a subsequent request before closing the connection.
protected static Log log
           
protected  javax.management.MBeanServer mserver
           
protected  javax.management.ObjectName oname
           
protected  int packetSize
          AJP packet size.
protected  java.lang.String requiredSecret
          Required secret.
protected  javax.management.ObjectName rgOname
           
protected static StringManager sm
          The string manager for this package.
protected  boolean tomcatAuthentication
          Should authentication be done in the native webserver layer, or in the Servlet container ?
protected  javax.management.ObjectName tpOname
           
 
Constructor Summary
AjpProtocol()
           
 
Method Summary
 void destroy()
           
 Adapter getAdapter()
           
 java.net.InetAddress getAddress()
           
 java.lang.Object getAttribute(java.lang.String key)
           
 java.util.Iterator getAttributeNames()
           
 int getBacklog()
           
 java.lang.String getDomain()
           
 java.util.concurrent.Executor getExecutor()
           
 int getKeepAliveTimeout()
           
 int getMaxThreads()
           
 java.lang.String getName()
           
 javax.management.ObjectName getObjectName()
           
 int getPacketSize()
           
 int getPort()
           
 java.lang.String getProperty(java.lang.String name)
          Get a property
 int getSoLinger()
           
 int getSoTimeout()
           
 boolean getTcpNoDelay()
           
 int getThreadPriority()
           
 boolean getTomcatAuthentication()
           
 void init()
          Start the protocol
 void pause()
          Pause the protocol (optional).
 void postDeregister()
           
 void postRegister(java.lang.Boolean registrationDone)
           
 void preDeregister()
           
 javax.management.ObjectName preRegister(javax.management.MBeanServer server, javax.management.ObjectName name)
           
 void resume()
          Resume the protocol (optional).
 void setAdapter(Adapter adapter)
          The adapter, used to call the connector
 void setAddress(java.net.InetAddress ia)
           
 void setAttribute(java.lang.String name, java.lang.Object value)
          Pass config info
 void setBacklog(int i)
           
 void setExecutor(java.util.concurrent.Executor executor)
           
 void setKeepAliveTimeout(int timeout)
           
 void setMaxThreads(int maxThreads)
           
 void setPacketSize(int i)
           
 void setPort(int port)
           
 void setProperty(java.lang.String name, java.lang.String value)
          Set a property.
 void setRequiredSecret(java.lang.String requiredSecret)
           
 void setSoLinger(int i)
           
 void setSoTimeout(int i)
           
 void setTcpNoDelay(boolean b)
           
 void setThreadPriority(int threadPriority)
           
 void setTomcatAuthentication(boolean tomcatAuthentication)
           
 void start()
          Start the protocol.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static Log log

sm

protected static StringManager sm
The string manager for this package.


tpOname

protected javax.management.ObjectName tpOname

rgOname

protected javax.management.ObjectName rgOname

ep

protected JIoEndpoint ep
Associated java.io endpoint.


attributes

protected java.util.Hashtable attributes
Configuration attributes.


tomcatAuthentication

protected boolean tomcatAuthentication
Should authentication be done in the native webserver layer, or in the Servlet container ?


requiredSecret

protected java.lang.String requiredSecret
Required secret.


packetSize

protected int packetSize
AJP packet size.


keepAliveTimeout

protected int keepAliveTimeout
The number of seconds Tomcat will wait for a subsequent request before closing the connection. The default is the same as for Apache HTTP Server (15 000 milliseconds).


domain

protected java.lang.String domain

oname

protected javax.management.ObjectName oname

mserver

protected javax.management.MBeanServer mserver
Constructor Detail

AjpProtocol

public AjpProtocol()
Method Detail

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.Object value)
Pass config info

Specified by:
setAttribute in interface ProtocolHandler

getAttribute

public java.lang.Object getAttribute(java.lang.String key)
Specified by:
getAttribute in interface ProtocolHandler

getAttributeNames

public java.util.Iterator getAttributeNames()
Specified by:
getAttributeNames in interface ProtocolHandler

setProperty

public void setProperty(java.lang.String name,
                        java.lang.String value)
Set a property.


getProperty

public java.lang.String getProperty(java.lang.String name)
Get a property


setAdapter

public void setAdapter(Adapter adapter)
The adapter, used to call the connector

Specified by:
setAdapter in interface ProtocolHandler

getAdapter

public Adapter getAdapter()
Specified by:
getAdapter in interface ProtocolHandler

init

public void init()
          throws java.lang.Exception
Start the protocol

Specified by:
init in interface ProtocolHandler
Throws:
java.lang.Exception

start

public void start()
           throws java.lang.Exception
Description copied from interface: ProtocolHandler
Start the protocol.

Specified by:
start in interface ProtocolHandler
Throws:
java.lang.Exception

pause

public void pause()
           throws java.lang.Exception
Description copied from interface: ProtocolHandler
Pause the protocol (optional).

Specified by:
pause in interface ProtocolHandler
Throws:
java.lang.Exception

resume

public void resume()
            throws java.lang.Exception
Description copied from interface: ProtocolHandler
Resume the protocol (optional).

Specified by:
resume in interface ProtocolHandler
Throws:
java.lang.Exception

destroy

public void destroy()
             throws java.lang.Exception
Specified by:
destroy in interface ProtocolHandler
Throws:
java.lang.Exception

getExecutor

public java.util.concurrent.Executor getExecutor()

setExecutor

public void setExecutor(java.util.concurrent.Executor executor)

getMaxThreads

public int getMaxThreads()

setMaxThreads

public void setMaxThreads(int maxThreads)

setThreadPriority

public void setThreadPriority(int threadPriority)

getThreadPriority

public int getThreadPriority()

getBacklog

public int getBacklog()

setBacklog

public void setBacklog(int i)

getPort

public int getPort()

setPort

public void setPort(int port)

getAddress

public java.net.InetAddress getAddress()

setAddress

public void setAddress(java.net.InetAddress ia)

getName

public java.lang.String getName()

getTcpNoDelay

public boolean getTcpNoDelay()

setTcpNoDelay

public void setTcpNoDelay(boolean b)

getTomcatAuthentication

public boolean getTomcatAuthentication()

setTomcatAuthentication

public void setTomcatAuthentication(boolean tomcatAuthentication)

getSoLinger

public int getSoLinger()

setSoLinger

public void setSoLinger(int i)

getSoTimeout

public int getSoTimeout()

setSoTimeout

public void setSoTimeout(int i)

setRequiredSecret

public void setRequiredSecret(java.lang.String requiredSecret)

getPacketSize

public int getPacketSize()

setPacketSize

public void setPacketSize(int i)

getKeepAliveTimeout

public int getKeepAliveTimeout()

setKeepAliveTimeout

public void setKeepAliveTimeout(int timeout)

getObjectName

public javax.management.ObjectName getObjectName()

getDomain

public java.lang.String getDomain()

preRegister

public javax.management.ObjectName preRegister(javax.management.MBeanServer server,
                                               javax.management.ObjectName name)
                                        throws java.lang.Exception
Specified by:
preRegister in interface javax.management.MBeanRegistration
Throws:
java.lang.Exception

postRegister

public void postRegister(java.lang.Boolean registrationDone)
Specified by:
postRegister in interface javax.management.MBeanRegistration

preDeregister

public void preDeregister()
                   throws java.lang.Exception
Specified by:
preDeregister in interface javax.management.MBeanRegistration
Throws:
java.lang.Exception

postDeregister

public void postDeregister()
Specified by:
postDeregister in interface javax.management.MBeanRegistration


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