|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectorg.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.AggregateLifeCycle
org.eclipse.jetty.server.AbstractConnector
org.eclipse.jetty.server.nio.AbstractNIOConnector
org.eclipse.jetty.server.nio.SelectChannelConnector
public class SelectChannelConnector
Selecting NIO connector.
This connector uses efficient NIO buffers with a non blocking threading model. Direct NIO buffers are used and threads are only allocated to connections with requests. Synchronization is used to simulate blocking for the servlet API, and any unflushed content at the end of request handling is written asynchronously.
This connector is best used when there are a many connections that have idle periods.
When used with Continuation, threadless waits are supported.
If a filter or servlet returns after calling Continuation.suspend() or when a
runtime exception is thrown from a call to Continuation.undispatch(), Jetty will
will not send a response to the client. Instead the thread is released and the Continuation is
placed on the timer queue. If the Continuation timeout expires, or it's
resume method is called, then the request is again allocated a thread and the request is retried.
The limitation of this approach is that request content is not available on the retried request,
thus if possible it should be read after the continuation or saved as a request attribute or as the
associated object of the Continuation instance.
| 嵌套类摘要 |
|---|
| 从类 org.eclipse.jetty.util.component.AbstractLifeCycle 继承的嵌套类/接口 |
|---|
AbstractLifeCycle.AbstractLifeCycleListener |
| 从接口 org.eclipse.jetty.util.component.LifeCycle 继承的嵌套类/接口 |
|---|
LifeCycle.Listener |
| 字段摘要 | |
|---|---|
protected ServerSocketChannel |
_acceptChannel
|
| 从类 org.eclipse.jetty.server.AbstractConnector 继承的字段 |
|---|
_buffers, _lowResourceMaxIdleTime, _maxIdleTime, _soLingerTime |
| 从类 org.eclipse.jetty.util.component.AbstractLifeCycle 继承的字段 |
|---|
_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING |
| 构造方法摘要 | |
|---|---|
SelectChannelConnector()
Constructor. |
|
| 方法摘要 | |
|---|---|
void |
accept(int acceptorID)
|
void |
close()
|
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 |
endPointClosed(SelectChannelEndPoint endpoint)
|
Object |
getConnection()
|
int |
getLocalPort()
|
int |
getLowResourcesConnections()
|
int |
getLowResourcesMaxIdleTime()
|
SelectorManager |
getSelectorManager()
|
protected AsyncConnection |
newConnection(SocketChannel channel,
AsyncEndPoint endpoint)
|
protected SelectChannelEndPoint |
newEndPoint(SocketChannel channel,
SelectorManager.SelectSet selectSet,
SelectionKey key)
|
void |
open()
Opens the connector |
void |
persist(EndPoint endpoint)
Persist an endpoint. |
void |
setLowResourcesConnections(int lowResourcesConnections)
Set the number of connections, which if exceeded places this manager in low resources state. |
void |
setLowResourcesMaxIdleTime(int lowResourcesMaxIdleTime)
Set the period in ms that a connection is allowed to be idle when this there are more than getLowResourcesConnections() connections. |
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 |
setThreadPool(ThreadPool pool)
Set the ThreadPool. |
| 从类 org.eclipse.jetty.server.nio.AbstractNIOConnector 继承的方法 |
|---|
getUseDirectBuffers, setUseDirectBuffers |
| 从类 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.util.component.LifeCycle 继承的方法 |
|---|
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop |
| 从接口 org.eclipse.jetty.util.component.Dumpable 继承的方法 |
|---|
dump, dump |
| 字段详细信息 |
|---|
protected ServerSocketChannel _acceptChannel
| 构造方法详细信息 |
|---|
public SelectChannelConnector()
| 方法详细信息 |
|---|
public void setThreadPool(ThreadPool pool)
AbstractConnector 复制的描述AggregateLifeCycle.addBean(Object) so that
it's lifecycle may be managed as a AggregateLifeCycle.
AbstractConnector 中的 setThreadPoolpool - the threadPool to set
public void accept(int acceptorID)
throws IOException
AbstractConnector 中的 acceptIOException
public void close()
throws IOException
IOException
public void customize(EndPoint endpoint,
Request request)
throws IOException
Connector 复制的描述
Connector 中的 customizeAbstractConnector 中的 customizeIOException
public void persist(EndPoint endpoint)
throws IOException
Connector 复制的描述
Connector 中的 persistAbstractConnector 中的 persistIOExceptionpublic SelectorManager getSelectorManager()
public Object getConnection()
public int getLocalPort()
public void open()
throws IOException
Connector 复制的描述
IOExceptionpublic void setMaxIdleTime(int maxIdleTime)
AbstractConnector 复制的描述Socket.setSoTimeout(int) call, although with NIO implementations
other mechanisms may be used to implement the timeout. The max idle time is applied:
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 中的 setMaxIdleTimeAbstractConnector 中的 setMaxIdleTimemaxIdleTime - The maxIdleTime to set.public int getLowResourcesConnections()
public void setLowResourcesConnections(int lowResourcesConnections)
lowResourcesConnections - the number of connectionssetLowResourcesMaxIdleTime(int)public int getLowResourcesMaxIdleTime()
AbstractConnector 中的 getLowResourcesMaxIdleTimepublic void setLowResourcesMaxIdleTime(int lowResourcesMaxIdleTime)
getLowResourcesConnections() connections. This allows the server to rapidly close idle connections
in order to gracefully handle high load situations.
AbstractConnector 中的 setLowResourcesMaxIdleTimelowResourcesMaxIdleTime - the period in ms that a connection is allowed to be idle when resources are low.setMaxIdleTime(int)
protected void doStart()
throws Exception
AggregateLifeCycle 复制的描述
AbstractConnector 中的 doStartExceptionAbstractLifeCycle.doStart()
protected SelectChannelEndPoint newEndPoint(SocketChannel channel,
SelectorManager.SelectSet selectSet,
SelectionKey key)
throws IOException
IOExceptionprotected void endPointClosed(SelectChannelEndPoint endpoint)
protected AsyncConnection newConnection(SocketChannel channel,
AsyncEndPoint endpoint)
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||