org.eclipse.jetty.server
类 AbstractConnector

java.lang.Object
  继承者 org.eclipse.jetty.util.component.AbstractLifeCycle
      继承者 org.eclipse.jetty.util.component.AggregateLifeCycle
          继承者 org.eclipse.jetty.server.AbstractConnector
所有已实现的接口:
HttpBuffers, Connector, Destroyable, Dumpable, LifeCycle
直接已知子类:
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:


嵌套类摘要
 
从类 org.eclipse.jetty.util.component.AbstractLifeCycle 继承的嵌套类/接口
AbstractLifeCycle.AbstractLifeCycleListener
 
从接口 org.eclipse.jetty.util.component.LifeCycle 继承的嵌套类/接口
LifeCycle.Listener
 
字段摘要
protected  HttpBuffersImpl _buffers
           
protected  int _lowResourceMaxIdleTime
           
protected  int _maxIdleTime
           
protected  int _soLingerTime
           
 
从类 org.eclipse.jetty.util.component.AbstractLifeCycle 继承的字段
_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING
 
构造方法摘要
AbstractConnector()
           
 
方法摘要
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()
          已过时。  
 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)
          已过时。  
 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()
           
 
从类 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
 
从类 org.eclipse.jetty.util.component.AbstractLifeCycle 继承的方法
addLifeCycleListener, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
从接口 org.eclipse.jetty.server.Connector 继承的方法
close, getConnection, getLocalPort, open
 
从接口 org.eclipse.jetty.util.component.LifeCycle 继承的方法
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
 
从接口 org.eclipse.jetty.util.component.Dumpable 继承的方法
dump, dump
 

字段详细信息

_maxIdleTime

protected int _maxIdleTime

_lowResourceMaxIdleTime

protected int _lowResourceMaxIdleTime

_soLingerTime

protected int _soLingerTime

_buffers

protected final HttpBuffersImpl _buffers
构造方法详细信息

AbstractConnector

public AbstractConnector()
方法详细信息

getServer

public Server getServer()
指定者:
接口 Connector 中的 getServer

setServer

public void setServer(Server server)
指定者:
接口 Connector 中的 setServer

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.

参数:
pool - the threadPool to set

setHost

public void setHost(String host)
从接口 Connector 复制的描述
Set the hostname of the interface to bind to.

指定者:
接口 Connector 中的 setHost
参数:
host - The hostname representing the interface to which this connector will bind, or null for all interfaces.

getHost

public String getHost()
指定者:
接口 Connector 中的 getHost
返回:
The hostname representing the interface to which this connector will bind, or null for all interfaces.

setPort

public void setPort(int port)
指定者:
接口 Connector 中的 setPort
参数:
port - The port to listen of for connections or 0 if any available port may be used.

getPort

public int getPort()
指定者:
接口 Connector 中的 getPort
返回:
The configured port for the connector or 0 if any available port may be used.

getMaxIdleTime

public int getMaxIdleTime()
指定者:
接口 Connector 中的 getMaxIdleTime
返回:
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: 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).

指定者:
接口 Connector 中的 setMaxIdleTime
参数:
maxIdleTime - The maxIdleTime to set.

getLowResourcesMaxIdleTime

public int getLowResourcesMaxIdleTime()
返回:
Returns the maxIdleTime when resources are low.

setLowResourcesMaxIdleTime

public void setLowResourcesMaxIdleTime(int maxIdleTime)
参数:
maxIdleTime - The maxIdleTime to set when resources are low.

getLowResourceMaxIdleTime

@Deprecated
public final int getLowResourceMaxIdleTime()
已过时。 

指定者:
接口 Connector 中的 getLowResourceMaxIdleTime
返回:
Returns the maxIdleTime when resources are low.

setLowResourceMaxIdleTime

@Deprecated
public final void setLowResourceMaxIdleTime(int maxIdleTime)
已过时。 

指定者:
接口 Connector 中的 setLowResourceMaxIdleTime
参数:
maxIdleTime - The maxIdleTime to set when resources are low.

getSoLingerTime

public int getSoLingerTime()
返回:
Returns the soLingerTime.

getAcceptQueueSize

public int getAcceptQueueSize()
返回:
Returns the acceptQueueSize.

setAcceptQueueSize

public void setAcceptQueueSize(int acceptQueueSize)
参数:
acceptQueueSize - The acceptQueueSize to set.

getAcceptors

public int getAcceptors()
返回:
Returns the number of acceptor threads.

setAcceptors

public void setAcceptors(int acceptors)
参数:
acceptors - The number of acceptor threads to set.

setSoLingerTime

public void setSoLingerTime(int soLingerTime)
参数:
soLingerTime - The soLingerTime to set or -1 to disable.

doStart

protected void doStart()
                throws Exception
从类 AggregateLifeCycle 复制的描述
Start the managed lifecycle beans in the order they were added.

覆盖:
AggregateLifeCycle 中的 doStart
抛出:
Exception
另请参见:
AbstractLifeCycle.doStart()

doStop

protected void doStop()
               throws Exception
从类 AggregateLifeCycle 复制的描述
Stop the joined lifecycle beans in the reverse order they were added.

覆盖:
AggregateLifeCycle 中的 doStop
抛出:
Exception
另请参见:
AbstractLifeCycle.doStart()

join

public void join()
          throws InterruptedException
抛出:
InterruptedException

configure

protected void configure(Socket socket)
                  throws IOException
抛出:
IOException

customize

public void customize(EndPoint endpoint,
                      Request request)
               throws IOException
从接口 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).

指定者:
接口 Connector 中的 customize
抛出:
IOException

checkForwardedHeaders

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

getLeftMostFieldValue

protected String getLeftMostFieldValue(HttpFields fields,
                                       String header)

persist

public void persist(EndPoint endpoint)
             throws IOException
从接口 Connector 复制的描述
Persist an endpoint. Called after every request if the connection is to remain open.

指定者:
接口 Connector 中的 persist
抛出:
IOException

getConfidentialPort

public int getConfidentialPort()
指定者:
接口 Connector 中的 getConfidentialPort
返回:
The port to use when redirecting a request if a data constraint of confidential is required. See Constraint.getDataConstraint()

getConfidentialScheme

public String getConfidentialScheme()
指定者:
接口 Connector 中的 getConfidentialScheme
返回:
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)
指定者:
接口 Connector 中的 isIntegral
参数:
request - A request
返回:
true if the request is integral. This normally means the https schema has been used.

getIntegralPort

public int getIntegralPort()
指定者:
接口 Connector 中的 getIntegralPort
返回:
The port to use when redirecting a request if a data constraint of integral is required. See Constraint.getDataConstraint()

getIntegralScheme

public String getIntegralScheme()
指定者:
接口 Connector 中的 getIntegralScheme
返回:
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)
指定者:
接口 Connector 中的 isConfidential
参数:
request - A request
返回:
true if the request is confidential. This normally means the https schema has been used.

setConfidentialPort

public void setConfidentialPort(int confidentialPort)
参数:
confidentialPort - The confidentialPort to set.

setConfidentialScheme

public void setConfidentialScheme(String confidentialScheme)
参数:
confidentialScheme - The confidentialScheme to set.

setIntegralPort

public void setIntegralPort(int integralPort)
参数:
integralPort - The integralPort to set.

setIntegralScheme

public void setIntegralScheme(String integralScheme)
参数:
integralScheme - The integralScheme to set.

accept

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

stopAccept

public void stopAccept(int acceptorID)
                throws Exception
抛出:
Exception

getResolveNames

public boolean getResolveNames()
指定者:
接口 Connector 中的 getResolveNames
返回:
true if names resolution should be done.

setResolveNames

public void setResolveNames(boolean resolve)

isForwarded

public boolean isForwarded()
Is reverse proxy handling on?

返回:
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.

参数:
check - true if this connector is checking the x-forwarded-for/host/server headers
另请参见:
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.

参数:
hostHeader - The value of the host header to force.

getForwardedHostHeader

public String getForwardedHostHeader()

setForwardedHostHeader

public void setForwardedHostHeader(String forwardedHostHeader)
参数:
forwardedHostHeader - The header name for forwarded hosts (default x-forwarded-host)
另请参见:
setForwarded(boolean)

getForwardedServerHeader

public String getForwardedServerHeader()
返回:
the header name for forwarded server.
另请参见:
setForwarded(boolean)

setForwardedServerHeader

public void setForwardedServerHeader(String forwardedServerHeader)
参数:
forwardedServerHeader - The header name for forwarded server (default x-forwarded-server)
另请参见:
setForwarded(boolean)

getForwardedForHeader

public String getForwardedForHeader()
另请参见:
setForwarded(boolean)

setForwardedForHeader

public void setForwardedForHeader(String forwardedRemoteAddressHeader)
参数:
forwardedRemoteAddressHeader - The header name for forwarded for (default x-forwarded-for)
另请参见:
setForwarded(boolean)

getForwardedProtoHeader

public String getForwardedProtoHeader()
Get the forwardedProtoHeader.

返回:
the forwardedProtoHeader (default X-Forwarded-For)
另请参见:
setForwarded(boolean)

setForwardedProtoHeader

public void setForwardedProtoHeader(String forwardedProtoHeader)
Set the forwardedProtoHeader.

参数:
forwardedProtoHeader - the forwardedProtoHeader to set (default X-Forwarded-For)
另请参见:
setForwarded(boolean)

getForwardedCipherSuiteHeader

public String getForwardedCipherSuiteHeader()
返回:
The header name holding a forwarded cipher suite (default null)

setForwardedCipherSuiteHeader

public void setForwardedCipherSuiteHeader(String forwardedCipherSuite)
参数:
forwardedCipherSuite - The header name holding a forwarded cipher suite (default null)

getForwardedSslSessionIdHeader

public String getForwardedSslSessionIdHeader()
返回:
The header name holding a forwarded SSL Session ID (default null)

setForwardedSslSessionIdHeader

public void setForwardedSslSessionIdHeader(String forwardedSslSessionId)
参数:
forwardedSslSessionId - The header name holding a forwarded SSL Session ID (default null)

getRequestBufferSize

public int getRequestBufferSize()
指定者:
接口 HttpBuffers 中的 getRequestBufferSize
指定者:
接口 Connector 中的 getRequestBufferSize
返回:
the requestBufferSize

setRequestBufferSize

public void setRequestBufferSize(int requestBufferSize)
从接口 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.

指定者:
接口 HttpBuffers 中的 setRequestBufferSize
指定者:
接口 Connector 中的 setRequestBufferSize
参数:
requestBufferSize - the requestBufferSize to set

getRequestHeaderSize

public int getRequestHeaderSize()
指定者:
接口 HttpBuffers 中的 getRequestHeaderSize
指定者:
接口 Connector 中的 getRequestHeaderSize
返回:
the requestHeaderSize

setRequestHeaderSize

public void setRequestHeaderSize(int requestHeaderSize)
从接口 Connector 复制的描述
Set the size of the buffer to be used for request headers.

指定者:
接口 HttpBuffers 中的 setRequestHeaderSize
指定者:
接口 Connector 中的 setRequestHeaderSize
参数:
requestHeaderSize - the requestHeaderSize to set

getResponseBufferSize

public int getResponseBufferSize()
指定者:
接口 HttpBuffers 中的 getResponseBufferSize
指定者:
接口 Connector 中的 getResponseBufferSize
返回:
the responseBufferSize

setResponseBufferSize

public void setResponseBufferSize(int responseBufferSize)
从接口 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.

指定者:
接口 HttpBuffers 中的 setResponseBufferSize
指定者:
接口 Connector 中的 setResponseBufferSize
参数:
responseBufferSize - the responseBufferSize to set

getResponseHeaderSize

public int getResponseHeaderSize()
指定者:
接口 HttpBuffers 中的 getResponseHeaderSize
指定者:
接口 Connector 中的 getResponseHeaderSize
返回:
the responseHeaderSize

setResponseHeaderSize

public void setResponseHeaderSize(int responseHeaderSize)
从接口 Connector 复制的描述
Set the size of the buffer to be used for request headers.

指定者:
接口 HttpBuffers 中的 setResponseHeaderSize
指定者:
接口 Connector 中的 setResponseHeaderSize
参数:
responseHeaderSize - the responseHeaderSize to set

getRequestBufferType

public Buffers.Type getRequestBufferType()
指定者:
接口 HttpBuffers 中的 getRequestBufferType
返回:
the requestBufferType

getRequestHeaderType

public Buffers.Type getRequestHeaderType()
指定者:
接口 HttpBuffers 中的 getRequestHeaderType
返回:
the requestHeaderType

getResponseBufferType

public Buffers.Type getResponseBufferType()
指定者:
接口 HttpBuffers 中的 getResponseBufferType
返回:
the responseBufferType

getResponseHeaderType

public Buffers.Type getResponseHeaderType()
指定者:
接口 HttpBuffers 中的 getResponseHeaderType
返回:
the responseHeaderType

setRequestBuffers

public void setRequestBuffers(Buffers requestBuffers)
指定者:
接口 HttpBuffers 中的 setRequestBuffers
参数:
requestBuffers - the requestBuffers to set

setResponseBuffers

public void setResponseBuffers(Buffers responseBuffers)
指定者:
接口 HttpBuffers 中的 setResponseBuffers
参数:
responseBuffers - the responseBuffers to set

getRequestBuffers

public Buffers getRequestBuffers()
指定者:
接口 HttpBuffers 中的 getRequestBuffers
指定者:
接口 Connector 中的 getRequestBuffers
返回:
factory for request buffers

getResponseBuffers

public Buffers getResponseBuffers()
指定者:
接口 HttpBuffers 中的 getResponseBuffers
指定者:
接口 Connector 中的 getResponseBuffers
返回:
factory for response buffers

setMaxBuffers

public void setMaxBuffers(int maxBuffers)
指定者:
接口 HttpBuffers 中的 setMaxBuffers

getMaxBuffers

public int getMaxBuffers()
指定者:
接口 HttpBuffers 中的 getMaxBuffers

toString

public String toString()
覆盖:
Object 中的 toString

getName

public String getName()
指定者:
接口 Connector 中的 getName
返回:
the name of the connector. Defaults to the HostName:port

setName

public void setName(String name)

getRequests

public int getRequests()
指定者:
接口 Connector 中的 getRequests
返回:
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()
指定者:
接口 Connector 中的 getConnectionsDurationTotal
返回:
Returns the connectionsDurationTotal.

getConnections

public int getConnections()
指定者:
接口 Connector 中的 getConnections
返回:
Number of connections accepted by the server since statsReset() called. Undefined if setStatsOn(false).

getConnectionsOpen

public int getConnectionsOpen()
指定者:
接口 Connector 中的 getConnectionsOpen
返回:
Number of connections currently open that were opened since statsReset() called. Undefined if setStatsOn(false).

getConnectionsOpenMax

public int getConnectionsOpenMax()
指定者:
接口 Connector 中的 getConnectionsOpenMax
返回:
Maximum number of connections opened simultaneously since statsReset() called. Undefined if setStatsOn(false).

getConnectionsDurationMean

public double getConnectionsDurationMean()
指定者:
接口 Connector 中的 getConnectionsDurationMean
返回:
Mean duration in milliseconds of open connections since statsReset() called. Undefined if setStatsOn(false).

getConnectionsDurationMax

public long getConnectionsDurationMax()
指定者:
接口 Connector 中的 getConnectionsDurationMax
返回:
Maximum duration in milliseconds of an open connection since statsReset() called. Undefined if setStatsOn(false).

getConnectionsDurationStdDev

public double getConnectionsDurationStdDev()
指定者:
接口 Connector 中的 getConnectionsDurationStdDev
返回:
Standard deviation of duration in milliseconds of open connections since statsReset() called. Undefined if setStatsOn(false).

getConnectionsRequestsMean

public double getConnectionsRequestsMean()
指定者:
接口 Connector 中的 getConnectionsRequestsMean
返回:
Mean number of requests per connection since statsReset() called. Undefined if setStatsOn(false).

getConnectionsRequestsMax

public int getConnectionsRequestsMax()
指定者:
接口 Connector 中的 getConnectionsRequestsMax
返回:
Maximum number of requests per connection since statsReset() called. Undefined if setStatsOn(false).

getConnectionsRequestsStdDev

public double getConnectionsRequestsStdDev()
指定者:
接口 Connector 中的 getConnectionsRequestsStdDev
返回:
Standard deviation of number of requests per connection since statsReset() called. Undefined if setStatsOn(false).

statsReset

public void statsReset()
Reset statistics.

指定者:
接口 Connector 中的 statsReset

setStatsOn

public void setStatsOn(boolean on)
指定者:
接口 Connector 中的 setStatsOn

getStatsOn

public boolean getStatsOn()
指定者:
接口 Connector 中的 getStatsOn
返回:
True if statistics collection is turned on.

getStatsOnMs

public long getStatsOnMs()
指定者:
接口 Connector 中的 getStatsOnMs
返回:
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()
返回:
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.

参数:
offset - the amount to alter the priority of the acceptor threads.

getReuseAddress

public boolean getReuseAddress()
返回:
True if the the server socket will be opened in SO_REUSEADDR mode.

setReuseAddress

public void setReuseAddress(boolean reuseAddress)
参数:
reuseAddress - True if the the server socket will be opened in SO_REUSEADDR mode.

isLowResources

public boolean isLowResources()
从接口 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.

指定者:
接口 Connector 中的 isLowResources
返回:
true if this connector is low on resources.


Copyright © 2013. All Rights Reserved.