AbstractConnector (Jetty :: Aggregate :: All core Jetty 7.6.8.v20121106 API)
Date: 2012-11-06

org.eclipse.jetty.server

## Class AbstractConnector

- java.lang.Object
- - org.eclipse.jetty.util.component.AbstractLifeCycle
  - - org.eclipse.jetty.util.component.AggregateLifeCycle
    - - org.eclipse.jetty.server.AbstractConnector

- All Implemented Interfaces:
    HttpBuffers, Connector, Destroyable, Dumpable, LifeCycle
  Direct Known Subclasses:
    AbstractNIOConnector, LocalConnector, NestedConnector, SocketConnector

      public abstract class AbstractConnector
      extends AggregateLifeCycle
      implements HttpBuffers, Connector, Dumpable

  Abstract Connector implementation. This abstract implementation of the Connector interface provides:
  - AbstractLifeCycle implementation
  - Implementations for connector getters and setters
  - Buffer management
  - Socket configuration
  - Base acceptor thread
  - Optional reverse proxy headers checking

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

      `AbstractLifeCycle.AbstractLifeCycleListener`

    - ### Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle

      `LifeCycle.Listener`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected HttpBuffersImpl` | `_buffers`
    `protected int` | `_lowResourceMaxIdleTime`
    `protected int` | `_maxIdleTime`
    `protected int` | `_soLingerTime`

    - ### Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

      `_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractConnector()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected abstract void` | `accept(int acceptorID)`
    `protected void` | `checkForwardedHeaders(EndPoint endpoint, Request request)`
    `protected void` | `configure(Socket socket)`
    `protected void` | `connectionClosed(Connection connection)`
    `protected void` | `connectionOpened(Connection connection)`
    `protected void` | `connectionUpgraded(Connection oldConnection, Connection newConnection)`
    `void` | `customize(EndPoint endpoint, Request request)` Customize a request for an endpoint.
    `protected void` | `doStart()` Start the managed lifecycle beans in the order they were added.
    `protected void` | `doStop()` Stop the joined lifecycle beans in the reverse order they were added.
    `int` | `getAcceptorPriorityOffset()`
    `int` | `getAcceptors()`
    `int` | `getAcceptQueueSize()`
    `int` | `getConfidentialPort()`
    `String` | `getConfidentialScheme()`
    `int` | `getConnections()`
    `long` | `getConnectionsDurationMax()`
    `double` | `getConnectionsDurationMean()`
    `double` | `getConnectionsDurationStdDev()`
    `long` | `getConnectionsDurationTotal()`
    `int` | `getConnectionsOpen()`
    `int` | `getConnectionsOpenMax()`
    `int` | `getConnectionsRequestsMax()`
    `double` | `getConnectionsRequestsMean()`
    `double` | `getConnectionsRequestsStdDev()`
    `String` | `getForwardedCipherSuiteHeader()`
    `String` | `getForwardedForHeader()`
    `String` | `getForwardedHostHeader()`
    `String` | `getForwardedProtoHeader()` Get the forwardedProtoHeader.
    `String` | `getForwardedServerHeader()`
    `String` | `getForwardedSslSessionIdHeader()`
    `String` | `getHost()`
    `String` | `getHostHeader()`
    `int` | `getIntegralPort()`
    `String` | `getIntegralScheme()`
    `protected String` | `getLeftMostFieldValue(HttpFields fields, String header)`
    `int` | `getLowResourceMaxIdleTime()` Deprecated.
    `int` | `getLowResourcesMaxIdleTime()`
    `int` | `getMaxBuffers()`
    `int` | `getMaxIdleTime()`
    `String` | `getName()`
    `int` | `getPort()`
    `Buffers` | `getRequestBuffers()`
    `int` | `getRequestBufferSize()`
    `Buffers.Type` | `getRequestBufferType()`
    `int` | `getRequestHeaderSize()`
    `Buffers.Type` | `getRequestHeaderType()`
    `int` | `getRequests()`
    `boolean` | `getResolveNames()`
    `Buffers` | `getResponseBuffers()`
    `int` | `getResponseBufferSize()`
    `Buffers.Type` | `getResponseBufferType()`
    `int` | `getResponseHeaderSize()`
    `Buffers.Type` | `getResponseHeaderType()`
    `boolean` | `getReuseAddress()`
    `Server` | `getServer()`
    `int` | `getSoLingerTime()`
    `boolean` | `getStatsOn()`
    `long` | `getStatsOnMs()`
    `ThreadPool` | `getThreadPool()`
    `boolean` | `isConfidential(Request request)`
    `boolean` | `isForwarded()` Is reverse proxy handling on?
    `boolean` | `isIntegral(Request request)`
    `boolean` | `isLowResources()` Check if low on resources.
    `void` | `join()`
    `void` | `persist(EndPoint endpoint)` Persist an endpoint.
    `void` | `setAcceptorPriorityOffset(int offset)` Set the priority offset of the acceptor threads.
    `void` | `setAcceptors(int acceptors)`
    `void` | `setAcceptQueueSize(int acceptQueueSize)`
    `void` | `setConfidentialPort(int confidentialPort)`
    `void` | `setConfidentialScheme(String confidentialScheme)`
    `void` | `setForwarded(boolean check)` Set reverse proxy handling.
    `void` | `setForwardedCipherSuiteHeader(String forwardedCipherSuite)`
    `void` | `setForwardedForHeader(String forwardedRemoteAddressHeader)`
    `void` | `setForwardedHostHeader(String forwardedHostHeader)`
    `void` | `setForwardedProtoHeader(String forwardedProtoHeader)` Set the forwardedProtoHeader.
    `void` | `setForwardedServerHeader(String forwardedServerHeader)`
    `void` | `setForwardedSslSessionIdHeader(String forwardedSslSessionId)`
    `void` | `setHost(String host)` Set the hostname of the interface to bind to.
    `void` | `setHostHeader(String hostHeader)` Set a forced valued for the host header to control what is returned by `ServletRequest.getServerName()` and `ServletRequest.getServerPort()`.
    `void` | `setIntegralPort(int integralPort)`
    `void` | `setIntegralScheme(String integralScheme)`
    `void` | `setLowResourceMaxIdleTime(int maxIdleTime)` Deprecated.
    `void` | `setLowResourcesMaxIdleTime(int maxIdleTime)`
    `void` | `setMaxBuffers(int maxBuffers)`
    `void` | `setMaxIdleTime(int maxIdleTime)` Set the maximum Idle time for a connection, which roughly translates to the `Socket.setSoTimeout(int)` call, although with NIO implementations other mechanisms may be used to implement the timeout.
    `void` | `setName(String name)`
    `void` | `setPort(int port)`
    `void` | `setRequestBuffers(Buffers requestBuffers)`
    `void` | `setRequestBufferSize(int requestBufferSize)` Set the size of the content buffer for receiving requests.
    `void` | `setRequestHeaderSize(int requestHeaderSize)` Set the size of the buffer to be used for request headers.
    `void` | `setResolveNames(boolean resolve)`
    `void` | `setResponseBuffers(Buffers responseBuffers)`
    `void` | `setResponseBufferSize(int responseBufferSize)` Set the size of the content buffer for sending responses.
    `void` | `setResponseHeaderSize(int responseHeaderSize)` Set the size of the buffer to be used for request headers.
    `void` | `setReuseAddress(boolean reuseAddress)`
    `void` | `setServer(Server server)`
    `void` | `setSoLingerTime(int soLingerTime)`
    `void` | `setStatsOn(boolean on)`
    `void` | `setThreadPool(ThreadPool pool)` Set the ThreadPool.
    `void` | `statsReset()` Reset statistics.
    `void` | `stopAccept(int acceptorID)`
    `String` | `toString()`

    - ### Methods inherited from class org.eclipse.jetty.util.component.AggregateLifeCycle

      `addBean, addBean, contains, destroy, dump, dump, dump, dump, dump, dumpObject, dumpStdErr, dumpThis, getBean, getBeans, getBeans, isManaged, manage, removeBean, removeBeans, unmanage`

    - ### Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

      `addLifeCycleListener, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface org.eclipse.jetty.server.Connector

      `close, getConnection, getLocalPort, open`

    - ### Methods inherited from interface org.eclipse.jetty.util.component.LifeCycle

      `addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop`

    - ### Methods inherited from interface org.eclipse.jetty.util.component.Dumpable

      `dump, dump`

- - ### Field Detail

    - #### _maxIdleTime

          protected int _maxIdleTime

    - #### _lowResourceMaxIdleTime

          protected int _lowResourceMaxIdleTime

    - #### _soLingerTime

          protected int _soLingerTime

    - #### _buffers

          protected final HttpBuffersImpl _buffers

  - ### Constructor Detail

    - #### AbstractConnector

          public AbstractConnector()

  - ### Method Detail

    - #### getServer

          public Server getServer()

      Specified by:
        `getServer` in interface `Connector`

    - #### setServer

          public void setServer(Server server)

      Specified by:
        `setServer` in interface `Connector`

    - #### getThreadPool

          public ThreadPool getThreadPool()

    - #### setThreadPool

          public void setThreadPool(ThreadPool pool)

      Set the ThreadPool. The threadpool passed is added via `AggregateLifeCycle.addBean(Object)` so that it's lifecycle may be managed as a `AggregateLifeCycle`.
      Parameters:
        `pool` - the threadPool to set

    - #### setHost

          public void setHost(String host)

      Description copied from interface: `Connector`
      Set the hostname of the interface to bind to.
      Specified by:
        `setHost` in interface `Connector`
      Parameters:
        `host` - The hostname representing the interface to which this connector will bind, or null for all interfaces.

    - #### getHost

          public String getHost()

      Specified by:
        `getHost` in interface `Connector`
      Returns:
        The hostname representing the interface to which this connector will bind, or null for all interfaces.

    - #### setPort

          public void setPort(int port)

      Specified by:
        `setPort` in interface `Connector`
      Parameters:
        `port` - The port fto listen of for connections or 0 if any available port may be used.

    - #### getPort

          public int getPort()

      Specified by:
        `getPort` in interface `Connector`
      Returns:
        The configured port for the connector or 0 if any available port may be used.

    - #### getMaxIdleTime

          public int getMaxIdleTime()

      Specified by:
        `getMaxIdleTime` in interface `Connector`
      Returns:
        Returns the maxIdleTime.

    - #### setMaxIdleTime

          public void setMaxIdleTime(int maxIdleTime)

      Set the maximum Idle time for a connection, which roughly translates to the `Socket.setSoTimeout(int)` call, although with NIO implementations other mechanisms may be used to implement the timeout. The max idle time is applied:
      - When waiting for a new request to be received on a connection
      - When reading the headers and content of a request
      - When writing the headers and content of a response
      Jetty interprets this value as the maximum time between some progress being made on the connection. So if a single byte is read or written, then the timeout (if implemented by jetty) is reset. However, in many instances, the reading/writing is delegated to the JVM, and the semantic is more strictly enforced as the maximum time a single read/write operation can take. Note, that as Jetty supports writes of memory mapped file buffers, then a write may take many 10s of seconds for large content written to a slow device.

      Previously, Jetty supported separate idle timeouts and IO operation timeouts, however the expense of changing the value of soTimeout was significant, so these timeouts were merged. With the advent of NIO, it may be possible to again differentiate these values (if there is demand).

      Specified by:
        `setMaxIdleTime` in interface `Connector`
      Parameters:
        `maxIdleTime` - The maxIdleTime to set.

    - #### getLowResourcesMaxIdleTime

          public int getLowResourcesMaxIdleTime()

      Returns:
        Returns the maxIdleTime when resources are low.

    - #### setLowResourcesMaxIdleTime

          public void setLowResourcesMaxIdleTime(int maxIdleTime)

      Parameters:
        `maxIdleTime` - The maxIdleTime to set when resources are low.

    - #### getLowResourceMaxIdleTime

          @Deprecated
          public final int getLowResourceMaxIdleTime()

      Deprecated.
      Specified by:
        `getLowResourceMaxIdleTime` in interface `Connector`
      Returns:
        Returns the maxIdleTime when resources are low.

    - #### setLowResourceMaxIdleTime

          @Deprecated
          public final void setLowResourceMaxIdleTime(int maxIdleTime)

      Deprecated.
      Specified by:
        `setLowResourceMaxIdleTime` in interface `Connector`
      Parameters:
        `maxIdleTime` - The maxIdleTime to set when resources are low.

    - #### getSoLingerTime

          public int getSoLingerTime()

      Returns:
        Returns the soLingerTime.

    - #### getAcceptQueueSize

          public int getAcceptQueueSize()

      Returns:
        Returns the acceptQueueSize.

    - #### setAcceptQueueSize

          public void setAcceptQueueSize(int acceptQueueSize)

      Parameters:
        `acceptQueueSize` - The acceptQueueSize to set.

    - #### getAcceptors

          public int getAcceptors()

      Returns:
        Returns the number of acceptor threads.

    - #### setAcceptors

          public void setAcceptors(int acceptors)

      Parameters:
        `acceptors` - The number of acceptor threads to set.

    - #### setSoLingerTime

          public void setSoLingerTime(int soLingerTime)

      Parameters:
        `soLingerTime` - The soLingerTime to set or -1 to disable.

    - #### doStart

          protected void doStart()
                          throws Exception

      Description copied from class: `AggregateLifeCycle`
      Start the managed lifecycle beans in the order they were added.
      Overrides:
        `doStart` in class `AggregateLifeCycle`
      Throws:
        `Exception`
      See Also:
        `AbstractLifeCycle.doStart()`

    - #### doStop

          protected void doStop()
                         throws Exception

      Description copied from class: `AggregateLifeCycle`
      Stop the joined lifecycle beans in the reverse order they were added.
      Overrides:
        `doStop` in class `AggregateLifeCycle`
      Throws:
        `Exception`
      See Also:
        `AbstractLifeCycle.doStart()`

    - #### join

          public void join()
                    throws InterruptedException

      Throws:
        `InterruptedException`

    - #### configure

          protected void configure(Socket socket)
                            throws IOException

      Throws:
        `IOException`

    - #### customize

          public void customize(EndPoint endpoint,
                       Request request)
                         throws IOException

      Description copied from interface: `Connector`
      Customize a request for an endpoint. Called on every request to allow customization of the request for the particular endpoint (eg security properties from a SSL connection).
      Specified by:
        `customize` in interface `Connector`
      Throws:
        `IOException`

    - #### checkForwardedHeaders

          protected void checkForwardedHeaders(EndPoint endpoint,
                                   Request request)
                                        throws IOException

      Throws:
        `IOException`

    - #### getLeftMostFieldValue

          protected String getLeftMostFieldValue(HttpFields fields,
                                     String header)

    - #### persist

          public void persist(EndPoint endpoint)
                       throws IOException

      Description copied from interface: `Connector`
      Persist an endpoint. Called after every request if the connection is to remain open.
      Specified by:
        `persist` in interface `Connector`
      Throws:
        `IOException`

    - #### getConfidentialPort

          public int getConfidentialPort()

      Specified by:
        `getConfidentialPort` in interface `Connector`
      Returns:
        The port to use when redirecting a request if a data constraint of confidential is required. See `Constraint.getDataConstraint()`

    - #### getConfidentialScheme

          public String getConfidentialScheme()

      Specified by:
        `getConfidentialScheme` in interface `Connector`
      Returns:
        The schema to use when redirecting a request if a data constraint of confidential is required. See `Constraint.getDataConstraint()`

    - #### isIntegral

          public boolean isIntegral(Request request)

      Specified by:
        `isIntegral` in interface `Connector`
      Parameters:
        `request` - A request
      Returns:
        true if the request is integral. This normally means the https schema has been used.

    - #### getIntegralPort

          public int getIntegralPort()

      Specified by:
        `getIntegralPort` in interface `Connector`
      Returns:
        The port to use when redirecting a request if a data constraint of integral is required. See `Constraint.getDataConstraint()`

    - #### getIntegralScheme

          public String getIntegralScheme()

      Specified by:
        `getIntegralScheme` in interface `Connector`
      Returns:
        The schema to use when redirecting a request if a data constraint of integral is required. See `Constraint.getDataConstraint()`

    - #### isConfidential

          public boolean isConfidential(Request request)

      Specified by:
        `isConfidential` in interface `Connector`
      Parameters:
        `request` - A request
      Returns:
        true if the request is confidential. This normally means the https schema has been used.

    - #### setConfidentialPort

          public void setConfidentialPort(int confidentialPort)

      Parameters:
        `confidentialPort` - The confidentialPort to set.

    - #### setConfidentialScheme

          public void setConfidentialScheme(String confidentialScheme)

      Parameters:
        `confidentialScheme` - The confidentialScheme to set.

    - #### setIntegralPort

          public void setIntegralPort(int integralPort)

      Parameters:
        `integralPort` - The integralPort to set.

    - #### setIntegralScheme

          public void setIntegralScheme(String integralScheme)

      Parameters:
        `integralScheme` - The integralScheme to set.

    - #### accept

          protected abstract void accept(int acceptorID)
                                  throws IOException,
                                         InterruptedException

      Throws:
        `IOException`
        `InterruptedException`

    - #### stopAccept

          public void stopAccept(int acceptorID)
                          throws Exception

      Throws:
        `Exception`

    - #### getResolveNames

          public boolean getResolveNames()

      Specified by:
        `getResolveNames` in interface `Connector`
      Returns:
        true if names resolution should be done.

    - #### setResolveNames

          public void setResolveNames(boolean resolve)

    - #### isForwarded

          public boolean isForwarded()

      Is reverse proxy handling on?
      Returns:
        true if this connector is checking the x-forwarded-for/host/server headers

    - #### setForwarded

          public void setForwarded(boolean check)

      Set reverse proxy handling. If set to true, then the X-Forwarded headers (or the headers set in their place) are looked for to set the request protocol, host, server and client ip.
      Parameters:
        `check` - true if this connector is checking the x-forwarded-for/host/server headers
      See Also:
        `setForwardedForHeader(String)`, `setForwardedHostHeader(String)`, `setForwardedProtoHeader(String)`, `setForwardedServerHeader(String)`

    - #### getHostHeader

          public String getHostHeader()

    - #### setHostHeader

          public void setHostHeader(String hostHeader)

      Set a forced valued for the host header to control what is returned by `ServletRequest.getServerName()` and `ServletRequest.getServerPort()`. This value is only used if `isForwarded()` is true.
      Parameters:
        `hostHeader` - The value of the host header to force.

    - #### getForwardedHostHeader

          public String getForwardedHostHeader()

    - #### setForwardedHostHeader

          public void setForwardedHostHeader(String forwardedHostHeader)

      Parameters:
        `forwardedHostHeader` - The header name for forwarded hosts (default x-forwarded-host)
      See Also:
        `setForwarded(boolean)`

    - #### getForwardedServerHeader

          public String getForwardedServerHeader()

      Returns:
        the header name for forwarded server.
      See Also:
        `setForwarded(boolean)`

    - #### setForwardedServerHeader

          public void setForwardedServerHeader(String forwardedServerHeader)

      Parameters:
        `forwardedServerHeader` - The header name for forwarded server (default x-forwarded-server)
      See Also:
        `setForwarded(boolean)`

    - #### getForwardedForHeader

          public String getForwardedForHeader()

      See Also:
        `setForwarded(boolean)`

    - #### setForwardedForHeader

          public void setForwardedForHeader(String forwardedRemoteAddressHeader)

      Parameters:
        `forwardedRemoteAddressHeader` - The header name for forwarded for (default x-forwarded-for)
      See Also:
        `setForwarded(boolean)`

    - #### getForwardedProtoHeader

          public String getForwardedProtoHeader()

      Get the forwardedProtoHeader.
      Returns:
        the forwardedProtoHeader (default X-Forwarded-For)
      See Also:
        `setForwarded(boolean)`

    - #### setForwardedProtoHeader

          public void setForwardedProtoHeader(String forwardedProtoHeader)

      Set the forwardedProtoHeader.
      Parameters:
        `forwardedProtoHeader` - the forwardedProtoHeader to set (default X-Forwarded-For)
      See Also:
        `setForwarded(boolean)`

    - #### getForwardedCipherSuiteHeader

          public String getForwardedCipherSuiteHeader()

      Returns:
        The header name holding a forwarded cipher suite (default null)

    - #### setForwardedCipherSuiteHeader

          public void setForwardedCipherSuiteHeader(String forwardedCipherSuite)

      Parameters:
        `forwardedCipherSuite` - The header name holding a forwarded cipher suite (default null)

    - #### getForwardedSslSessionIdHeader

          public String getForwardedSslSessionIdHeader()

      Returns:
        The header name holding a forwarded SSL Session ID (default null)

    - #### setForwardedSslSessionIdHeader

          public void setForwardedSslSessionIdHeader(String forwardedSslSessionId)

      Parameters:
        `forwardedSslSessionId` - The header name holding a forwarded SSL Session ID (default null)

    - #### getRequestBufferSize

          public int getRequestBufferSize()

      Specified by:
        `getRequestBufferSize` in interface `HttpBuffers`
      Specified by:
        `getRequestBufferSize` in interface `Connector`
      Returns:
        the requestBufferSize

    - #### setRequestBufferSize

          public void setRequestBufferSize(int requestBufferSize)

      Description copied from interface: `Connector`
      Set the size of the content buffer for receiving requests. These buffers are only used for active connections that have requests with bodies that will not fit within the header buffer.
      Specified by:
        `setRequestBufferSize` in interface `HttpBuffers`
      Specified by:
        `setRequestBufferSize` in interface `Connector`
      Parameters:
        `requestBufferSize` - the requestBufferSize to set

    - #### getRequestHeaderSize

          public int getRequestHeaderSize()

      Specified by:
        `getRequestHeaderSize` in interface `HttpBuffers`
      Specified by:
        `getRequestHeaderSize` in interface `Connector`
      Returns:
        the requestHeaderSize

    - #### setRequestHeaderSize

          public void setRequestHeaderSize(int requestHeaderSize)

      Description copied from interface: `Connector`
      Set the size of the buffer to be used for request headers.
      Specified by:
        `setRequestHeaderSize` in interface `HttpBuffers`
      Specified by:
        `setRequestHeaderSize` in interface `Connector`
      Parameters:
        `requestHeaderSize` - the requestHeaderSize to set

    - #### getResponseBufferSize

          public int getResponseBufferSize()

      Specified by:
        `getResponseBufferSize` in interface `HttpBuffers`
      Specified by:
        `getResponseBufferSize` in interface `Connector`
      Returns:
        the responseBufferSize

    - #### setResponseBufferSize

          public void setResponseBufferSize(int responseBufferSize)

      Description copied from interface: `Connector`
      Set the size of the content buffer for sending responses. These buffers are only used for active connections that are sending responses with bodies that will not fit within the header buffer.
      Specified by:
        `setResponseBufferSize` in interface `HttpBuffers`
      Specified by:
        `setResponseBufferSize` in interface `Connector`
      Parameters:
        `responseBufferSize` - the responseBufferSize to set

    - #### getResponseHeaderSize

          public int getResponseHeaderSize()

      Specified by:
        `getResponseHeaderSize` in interface `HttpBuffers`
      Specified by:
        `getResponseHeaderSize` in interface `Connector`
      Returns:
        the responseHeaderSize

    - #### setResponseHeaderSize

          public void setResponseHeaderSize(int responseHeaderSize)

      Description copied from interface: `Connector`
      Set the size of the buffer to be used for request headers.
      Specified by:
        `setResponseHeaderSize` in interface `HttpBuffers`
      Specified by:
        `setResponseHeaderSize` in interface `Connector`
      Parameters:
        `responseHeaderSize` - the responseHeaderSize to set

    - #### getRequestBufferType

          public Buffers.Type getRequestBufferType()

      Specified by:
        `getRequestBufferType` in interface `HttpBuffers`
      Returns:
        the requestBufferType

    - #### getRequestHeaderType

          public Buffers.Type getRequestHeaderType()

      Specified by:
        `getRequestHeaderType` in interface `HttpBuffers`
      Returns:
        the requestHeaderType

    - #### getResponseBufferType

          public Buffers.Type getResponseBufferType()

      Specified by:
        `getResponseBufferType` in interface `HttpBuffers`
      Returns:
        the responseBufferType

    - #### getResponseHeaderType

          public Buffers.Type getResponseHeaderType()

      Specified by:
        `getResponseHeaderType` in interface `HttpBuffers`
      Returns:
        the responseHeaderType

    - #### setRequestBuffers

          public void setRequestBuffers(Buffers requestBuffers)

      Specified by:
        `setRequestBuffers` in interface `HttpBuffers`
      Parameters:
        `requestBuffers` - the requestBuffers to set

    - #### setResponseBuffers

          public void setResponseBuffers(Buffers responseBuffers)

      Specified by:
        `setResponseBuffers` in interface `HttpBuffers`
      Parameters:
        `responseBuffers` - the responseBuffers to set

    - #### getRequestBuffers

          public Buffers getRequestBuffers()

      Specified by:
        `getRequestBuffers` in interface `HttpBuffers`
      Specified by:
        `getRequestBuffers` in interface `Connector`
      Returns:
        factory for request buffers

    - #### getResponseBuffers

          public Buffers getResponseBuffers()

      Specified by:
        `getResponseBuffers` in interface `HttpBuffers`
      Specified by:
        `getResponseBuffers` in interface `Connector`
      Returns:
        factory for response buffers

    - #### setMaxBuffers

          public void setMaxBuffers(int maxBuffers)

      Specified by:
        `setMaxBuffers` in interface `HttpBuffers`

    - #### getMaxBuffers

          public int getMaxBuffers()

      Specified by:
        `getMaxBuffers` in interface `HttpBuffers`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### getName

          public String getName()

      Specified by:
        `getName` in interface `Connector`
      Returns:
        the name of the connector. Defaults to the HostName:port

    - #### setName

          public void setName(String name)

    - #### getRequests

          public int getRequests()

      Specified by:
        `getRequests` in interface `Connector`
      Returns:
        Get the number of requests handled by this connector since last call of statsReset(). If setStatsOn(false) then this is undefined.

    - #### getConnectionsDurationTotal

          public long getConnectionsDurationTotal()

      Specified by:
        `getConnectionsDurationTotal` in interface `Connector`
      Returns:
        Returns the connectionsDurationTotal.

    - #### getConnections

          public int getConnections()

      Specified by:
        `getConnections` in interface `Connector`
      Returns:
        Number of connections accepted by the server since statsReset() called. Undefined if setStatsOn(false).

    - #### getConnectionsOpen

          public int getConnectionsOpen()

      Specified by:
        `getConnectionsOpen` in interface `Connector`
      Returns:
        Number of connections currently open that were opened since statsReset() called. Undefined if setStatsOn(false).

    - #### getConnectionsOpenMax

          public int getConnectionsOpenMax()

      Specified by:
        `getConnectionsOpenMax` in interface `Connector`
      Returns:
        Maximum number of connections opened simultaneously since statsReset() called. Undefined if setStatsOn(false).

    - #### getConnectionsDurationMean

          public double getConnectionsDurationMean()

      Specified by:
        `getConnectionsDurationMean` in interface `Connector`
      Returns:
        Mean duration in milliseconds of open connections since statsReset() called. Undefined if setStatsOn(false).

    - #### getConnectionsDurationMax

          public long getConnectionsDurationMax()

      Specified by:
        `getConnectionsDurationMax` in interface `Connector`
      Returns:
        Maximum duration in milliseconds of an open connection since statsReset() called. Undefined if setStatsOn(false).

    - #### getConnectionsDurationStdDev

          public double getConnectionsDurationStdDev()

      Specified by:
        `getConnectionsDurationStdDev` in interface `Connector`
      Returns:
        Standard deviation of duration in milliseconds of open connections since statsReset() called. Undefined if setStatsOn(false).

    - #### getConnectionsRequestsMean

          public double getConnectionsRequestsMean()

      Specified by:
        `getConnectionsRequestsMean` in interface `Connector`
      Returns:
        Mean number of requests per connection since statsReset() called. Undefined if setStatsOn(false).

    - #### getConnectionsRequestsMax

          public int getConnectionsRequestsMax()

      Specified by:
        `getConnectionsRequestsMax` in interface `Connector`
      Returns:
        Maximum number of requests per connection since statsReset() called. Undefined if setStatsOn(false).

    - #### getConnectionsRequestsStdDev

          public double getConnectionsRequestsStdDev()

      Specified by:
        `getConnectionsRequestsStdDev` in interface `Connector`
      Returns:
        Standard deviation of number of requests per connection since statsReset() called. Undefined if setStatsOn(false).

    - #### statsReset

          public void statsReset()

      Reset statistics.
      Specified by:
        `statsReset` in interface `Connector`

    - #### setStatsOn

          public void setStatsOn(boolean on)

      Specified by:
        `setStatsOn` in interface `Connector`

    - #### getStatsOn

          public boolean getStatsOn()

      Specified by:
        `getStatsOn` in interface `Connector`
      Returns:
        True if statistics collection is turned on.

    - #### getStatsOnMs

          public long getStatsOnMs()

      Specified by:
        `getStatsOnMs` in interface `Connector`
      Returns:
        Timestamp stats were started at.

    - #### connectionOpened

          protected void connectionOpened(Connection connection)

    - #### connectionUpgraded

          protected void connectionUpgraded(Connection oldConnection,
                                Connection newConnection)

    - #### connectionClosed

          protected void connectionClosed(Connection connection)

    - #### getAcceptorPriorityOffset

          public int getAcceptorPriorityOffset()

      Returns:
        the acceptorPriority

    - #### setAcceptorPriorityOffset

          public void setAcceptorPriorityOffset(int offset)

      Set the priority offset of the acceptor threads. The priority is adjusted by this amount (default 0) to either favour the acceptance of new threads and newly active connections or to favour the handling of already dispatched connections.
      Parameters:
        `offset` - the amount to alter the priority of the acceptor threads.

    - #### getReuseAddress

          public boolean getReuseAddress()

      Returns:
        True if the the server socket will be opened in SO_REUSEADDR mode.

    - #### setReuseAddress

          public void setReuseAddress(boolean reuseAddress)

      Parameters:
        `reuseAddress` - True if the the server socket will be opened in SO_REUSEADDR mode.

    - #### isLowResources

          public boolean isLowResources()

      Description copied from interface: `Connector`
      Check if low on resources. For most connectors, low resources is measured by calling `ThreadPool.isLowOnThreads()` on the connector threadpool or the server threadpool if there is no connector threadpool.

      For blocking connectors, low resources is used to trigger usage of `Connector.getLowResourceMaxIdleTime()` for the timeout of an idle connection.

      for non-blocking connectors, the number of connections is used instead of this method, to select the timeout of an idle connection.

      For all connectors, low resources is used to trigger the usage of `Connector.getLowResourceMaxIdleTime()` for read and write operations.

      Specified by:
        `isLowResources` in interface `Connector`
      Returns:
        true if this connector is low on resources.

Copyright © 1995-2012 Mort Bay Consulting. All Rights Reserved.