## org.eclipse.jetty.server.nio
Class BlockingChannelConnector

    java.lang.Object
      org.eclipse.jetty.util.component.AbstractLifeCycle
          org.eclipse.jetty.http.HttpBuffers
              org.eclipse.jetty.server.AbstractConnector
                  org.eclipse.jetty.server.nio.AbstractNIOConnector
                      org.eclipse.jetty.server.nio.BlockingChannelConnector

All Implemented Interfaces:
  Connector, NIOConnector, LifeCycle

    public class BlockingChannelConnector

extends AbstractNIOConnector

Blocking NIO connector. This connector uses efficient NIO buffers with a traditional blocking thread model. Direct NIO buffers are used and a thread is allocated per connections. This connector is best used when there are a few very active connections.

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 inherited from class org.eclipse.jetty.server.AbstractConnector
`_lowResourceMaxIdleTime, _maxIdleTime, _soLingerTime`

Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
`_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING`

Constructor Summary
`BlockingChannelConnector()` Constructor.

Method Summary
`void` `accept(int acceptorID)`
`void` `close()`
`void` `customize(EndPoint endpoint, Request request)` Customize a request for an endpoint.
`protected void` `doStart()`
`Object` `getConnection()`
`int` `getLocalPort()`
`void` `open()` Opens the connector

Methods inherited from class org.eclipse.jetty.server.nio.AbstractNIOConnector
`getUseDirectBuffers, isRequestHeader, isResponseHeader, newRequestBuffer, newRequestHeader, newResponseBuffer, newResponseHeader, setUseDirectBuffers`

Methods inherited from class org.eclipse.jetty.server.AbstractConnector

`checkForwardedHeaders, configure, connectionClosed, connectionOpened, connectionUpgraded, doStop, getAcceptorPriorityOffset, getAcceptors, getAcceptQueueSize, getConfidentialPort, getConfidentialScheme, getConnections, getConnectionsDurationMax, getConnectionsDurationMean, getConnectionsDurationStdDev, getConnectionsDurationTotal, getConnectionsOpen, getConnectionsOpenMax, getConnectionsRequestsMax, getConnectionsRequestsMean, getConnectionsRequestsStdDev, getForwardedForHeader, getForwardedHostHeader, getForwardedProtoHeader, getForwardedServerHeader, getHost, getHostHeader, getIntegralPort, getIntegralScheme, getLeftMostValue, getLowResourceMaxIdleTime, getLowResourcesMaxIdleTime, getMaxIdleTime, getName, getPort, getRequests, getResolveNames, getReuseAddress, getServer, getSoLingerTime, getStatsOn, getStatsOnMs, getThreadPool, isConfidential, isForwarded, isIntegral, isLowResources, join, newBuffer, persist, setAcceptorPriorityOffset, setAcceptors, setAcceptQueueSize, setConfidentialPort, setConfidentialScheme, setForwarded, setForwardedForHeader, setForwardedHostHeader, setForwardedProtoHeader, setForwardedServerHeader, setHost, setHostHeader, setIntegralPort, setIntegralScheme, setLowResourceMaxIdleTime, setLowResourcesMaxIdleTime, setMaxIdleTime, setName, setPort, setResolveNames, setReuseAddress, setServer, setSoLingerTime, setStatsOn, setThreadPool, statsReset, stopAccept, toString`

Methods inherited from class org.eclipse.jetty.http.HttpBuffers
`getHeaderBufferSize, getRequestBuffers, getRequestBufferSize, getRequestHeaderSize, getResponseBuffers, getResponseBufferSize, getResponseHeaderSize, setHeaderBufferSize, setRequestBufferSize, setRequestHeaderSize, setResponseBufferSize, setResponseHeaderSize`

Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
`addLifeCycleListener, 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
`getRequestBuffers, getRequestBufferSize, getRequestHeaderSize, getResponseBuffers, getResponseBufferSize, getResponseHeaderSize, setRequestBufferSize, setRequestHeaderSize, setResponseBufferSize, setResponseHeaderSize`

Methods inherited from interface org.eclipse.jetty.util.component.LifeCycle
`addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop`

Constructor Detail

### BlockingChannelConnector

    public BlockingChannelConnector()

  Constructor.

Method Detail

### getConnection

    public Object getConnection()

  Returns:
    the underlying socket, channel, buffer etc. for the connector.

### doStart

    protected void doStart()
                    throws Exception

  Overrides:
    `doStart` in class `AbstractConnector`
  Throws:
    `Exception`
  See Also:
    `AbstractConnector.doStart()`

### open

    public void open()
              throws IOException

  Description copied from interface: `Connector`
  Opens the connector

  Throws:
    `IOException`

### close

    public void close()
               throws IOException

  Throws:
    `IOException`

### accept

    public void accept(int acceptorID)
                throws IOException,
                       InterruptedException

  Specified by:
    `accept` in class `AbstractConnector`
  Throws:
    `IOException`
    `InterruptedException`

### 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`
  Overrides:
    `customize` in class `AbstractConnector`
  Throws:
    `IOException`

### getLocalPort

    public int getLocalPort()

  Returns:
    The actual port the connector is listening on or -1 if it has not been opened, or -2 if it has been closed.

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