AbstractProtocol (Apache Tomcat 7.0.96 API Documentation)

org.apache.coyote

## Class AbstractProtocol<S>

- java.lang.Object
- - org.apache.coyote.AbstractProtocol<S>

- All Implemented Interfaces:
    javax.management.MBeanRegistration, ProtocolHandler
  Direct Known Subclasses:
    AbstractAjpProtocol, AbstractHttp11Protocol

      public abstract class AbstractProtocol<S>
      extends java.lang.Object
      implements ProtocolHandler, javax.management.MBeanRegistration

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `protected static class` | `AbstractProtocol.AbstractConnectionHandler<S,P extends Processor<S>>`
    `protected static class` | `AbstractProtocol.RecycledProcessors<P extends Processor<S>,S>`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Adapter` | `adapter` The adapter provides the link between the ProtocolHandler and the connector.
    `protected java.lang.String` | `clientCertProvider` When client certificate information is presented in a form other than instances of `X509Certificate` it needs to be converted before it can be used and this property controls which JSSE provider is used to perform the conversion.
    `protected java.lang.String` | `domain`
    `protected AbstractEndpoint<S>` | `endpoint` Endpoint that provides low-level network I/O - must be matched to the ProtocolHandler implementation (ProtocolHandler using BIO, requires BIO Endpoint etc.).
    `protected javax.management.MBeanServer` | `mserver`
    `protected javax.management.ObjectName` | `oname`
    `protected int` | `processorCache` The maximum number of idle processors that will be retained in the cache and re-used with a subsequent request.
    `protected javax.management.ObjectName` | `rgOname` Name of MBean for the Global Request Processor.
    `protected static StringManager` | `sm` The string manager for this package.
    `protected javax.management.ObjectName` | `tpOname` Name of MBean for the ThreadPool.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractProtocol()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `destroy()` Destroy the protocol (optional).
    `Adapter` | `getAdapter()`
    `java.net.InetAddress` | `getAddress()`
    `int` | `getBacklog()`
    `java.lang.String` | `getClientCertProvider()`
    `long` | `getConnectionCount()`
    `int` | `getConnectionTimeout()`
    `java.lang.String` | `getDomain()`
    `java.util.concurrent.Executor` | `getExecutor()` The executor, provide access to the underlying thread pool.
    `protected abstract AbstractEndpoint.Handler` | `getHandler()` Obtain the handler associated with the underlying Endpoint
    `int` | `getKeepAliveTimeout()`
    `int` | `getLocalPort()`
    `protected abstract Log` | `getLog()` Concrete implementations need to provide access to their logger to be used by the abstract classes.
    `int` | `getMaxConnections()`
    `int` | `getMaxCookieCount()`
    `int` | `getMaxHeaderCount()`
    `int` | `getMaxThreads()`
    `int` | `getMinSpareThreads()`
    `java.lang.String` | `getName()` The name will be prefix-address-port if address is non-null and prefix-port if the address is null.
    `int` | `getNameIndex()`
    `protected abstract java.lang.String` | `getNamePrefix()` Obtain the prefix to be used when construction a name for this protocol handler.
    `javax.management.ObjectName` | `getObjectName()`
    `int` | `getPort()`
    `int` | `getProcessorCache()`
    `java.lang.String` | `getProperty(java.lang.String name)` Generic property getter used by the digester.
    `protected abstract java.lang.String` | `getProtocolName()` Obtain the name of the protocol, (Http, Ajp, etc.).
    `int` | `getSoLinger()`
    `int` | `getSoTimeout()`
    `boolean` | `getTcpNoDelay()`
    `int` | `getThreadPriority()`
    `void` | `init()` Initialise the protocol.
    `boolean` | `isAprRequired()` Requires APR/native library
    `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` | `setBacklog(int backlog)`
    `void` | `setClientCertProvider(java.lang.String s)`
    `void` | `setConnectionTimeout(int timeout)`
    `void` | `setExecutor(java.util.concurrent.Executor executor)`
    `void` | `setKeepAliveTimeout(int keepAliveTimeout)`
    `void` | `setMaxConnections(int maxConnections)`
    `void` | `setMaxCookieCount(int maxCookieCount)`
    `void` | `setMaxHeaderCount(int maxHeaderCount)`
    `void` | `setMaxThreads(int maxThreads)`
    `void` | `setMinSpareThreads(int minSpareThreads)`
    `void` | `setPort(int port)`
    `void` | `setProcessorCache(int processorCache)`
    `boolean` | `setProperty(java.lang.String name, java.lang.String value)` Generic property setter used by the digester.
    `void` | `setSoLinger(int soLinger)`
    `void` | `setSoTimeout(int timeout)`
    `void` | `setTcpNoDelay(boolean tcpNoDelay)`
    `void` | `setThreadPriority(int threadPriority)`
    `void` | `start()` Start the protocol.
    `void` | `stop()` Stop the protocol.

    - ### 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.

    - #### rgOname

          protected javax.management.ObjectName rgOname

      Name of MBean for the Global Request Processor.

    - #### tpOname

          protected javax.management.ObjectName tpOname

      Name of MBean for the ThreadPool.

    - #### endpoint

          protected AbstractEndpoint<S> endpoint

      Endpoint that provides low-level network I/O - must be matched to the ProtocolHandler implementation (ProtocolHandler using BIO, requires BIO Endpoint etc.).

    - #### adapter

          protected Adapter adapter

      The adapter provides the link between the ProtocolHandler and the connector.

    - #### processorCache

          protected int processorCache

      The maximum number of idle processors that will be retained in the cache and re-used with a subsequent request. The default is 200. A value of -1 means unlimited. In the unlimited case, the theoretical maximum number of cached Processor objects is `getMaxConnections()` although it will usually be closer to `getMaxThreads()`.

    - #### clientCertProvider

          protected java.lang.String clientCertProvider

      When client certificate information is presented in a form other than instances of `X509Certificate` it needs to be converted before it can be used and this property controls which JSSE provider is used to perform the conversion. For example it is used with the AJP connectors, the HTTP APR connector and with the `SSLValve`. If not specified, the default provider will be used.

    - #### domain

          protected java.lang.String domain

    - #### oname

          protected javax.management.ObjectName oname

    - #### mserver

          protected javax.management.MBeanServer mserver

  - ### Constructor Detail

    - #### AbstractProtocol

          public AbstractProtocol()

  - ### Method Detail

    - #### setProperty

          public boolean setProperty(java.lang.String name,
                            java.lang.String value)

      Generic property setter used by the digester. Other code should not need to use this. The digester will only use this method if it can't find a more specific setter. That means the property belongs to the Endpoint, the ServerSocketFactory or some other lower level component. This method ensures that it is visible to both.

    - #### getProperty

          public java.lang.String getProperty(java.lang.String name)

      Generic property getter used by the digester. Other code should not need to use this.

    - #### setAdapter

          public void setAdapter(Adapter adapter)

      Description copied from interface: `ProtocolHandler`
      The adapter, used to call the connector.
      Specified by:
        `setAdapter` in interface `ProtocolHandler`

    - #### getAdapter

          public Adapter getAdapter()

      Specified by:
        `getAdapter` in interface `ProtocolHandler`

    - #### getProcessorCache

          public int getProcessorCache()

    - #### setProcessorCache

          public void setProcessorCache(int processorCache)

    - #### getClientCertProvider

          public java.lang.String getClientCertProvider()

    - #### setClientCertProvider

          public void setClientCertProvider(java.lang.String s)

    - #### isAprRequired

          public boolean isAprRequired()

      Description copied from interface: `ProtocolHandler`
      Requires APR/native library
      Specified by:
        `isAprRequired` in interface `ProtocolHandler`

    - #### getMaxCookieCount

          public int getMaxCookieCount()

    - #### setMaxCookieCount

          public void setMaxCookieCount(int maxCookieCount)

    - #### getExecutor

          public java.util.concurrent.Executor getExecutor()

      Description copied from interface: `ProtocolHandler`
      The executor, provide access to the underlying thread pool.
      Specified by:
        `getExecutor` in interface `ProtocolHandler`

    - #### setExecutor

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

    - #### getMaxThreads

          public int getMaxThreads()

    - #### setMaxThreads

          public void setMaxThreads(int maxThreads)

    - #### getMaxConnections

          public int getMaxConnections()

    - #### setMaxConnections

          public void setMaxConnections(int maxConnections)

    - #### getMinSpareThreads

          public int getMinSpareThreads()

    - #### setMinSpareThreads

          public void setMinSpareThreads(int minSpareThreads)

    - #### getThreadPriority

          public int getThreadPriority()

    - #### setThreadPriority

          public void setThreadPriority(int threadPriority)

    - #### getBacklog

          public int getBacklog()

    - #### setBacklog

          public void setBacklog(int backlog)

    - #### getTcpNoDelay

          public boolean getTcpNoDelay()

    - #### setTcpNoDelay

          public void setTcpNoDelay(boolean tcpNoDelay)

    - #### getSoLinger

          public int getSoLinger()

    - #### setSoLinger

          public void setSoLinger(int soLinger)

    - #### getKeepAliveTimeout

          public int getKeepAliveTimeout()

    - #### setKeepAliveTimeout

          public void setKeepAliveTimeout(int keepAliveTimeout)

    - #### getAddress

          public java.net.InetAddress getAddress()

    - #### setAddress

          public void setAddress(java.net.InetAddress ia)

    - #### getPort

          public int getPort()

    - #### setPort

          public void setPort(int port)

    - #### getLocalPort

          public int getLocalPort()

    - #### getConnectionTimeout

          public int getConnectionTimeout()

    - #### setConnectionTimeout

          public void setConnectionTimeout(int timeout)

    - #### getSoTimeout

          public int getSoTimeout()

    - #### setSoTimeout

          public void setSoTimeout(int timeout)

    - #### getMaxHeaderCount

          public int getMaxHeaderCount()

    - #### setMaxHeaderCount

          public void setMaxHeaderCount(int maxHeaderCount)

    - #### getConnectionCount

          public long getConnectionCount()

    - #### getNameIndex

          public int getNameIndex()

    - #### getName

          public java.lang.String getName()

      The name will be prefix-address-port if address is non-null and prefix-port if the address is null. The name will be appropriately quoted so it can be used directly in an ObjectName.

    - #### getLog

          protected abstract Log getLog()

      Concrete implementations need to provide access to their logger to be used by the abstract classes.

    - #### getNamePrefix

          protected abstract java.lang.String getNamePrefix()

      Obtain the prefix to be used when construction a name for this protocol handler. The name will be prefix-address-port.

    - #### getProtocolName

          protected abstract java.lang.String getProtocolName()

      Obtain the name of the protocol, (Http, Ajp, etc.). Used with JMX.

    - #### getHandler

          protected abstract AbstractEndpoint.Handler getHandler()

      Obtain the handler associated with the underlying Endpoint

    - #### 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`

    - #### init

          public void init()
                    throws java.lang.Exception

      Description copied from interface: `ProtocolHandler`
      Initialise 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`

    - #### stop

          public void stop()
                    throws java.lang.Exception

      Description copied from interface: `ProtocolHandler`
      Stop the protocol.
      Specified by:
        `stop` in interface `ProtocolHandler`
      Throws:
        `java.lang.Exception`

    - #### destroy

          public void destroy()

      Description copied from interface: `ProtocolHandler`
      Destroy the protocol (optional).
      Specified by:
        `destroy` in interface `ProtocolHandler`

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