org.eclipse.jetty.io.nio
类 SelectorManager

java.lang.Object
  继承者 org.eclipse.jetty.util.component.AbstractLifeCycle
      继承者 org.eclipse.jetty.io.nio.SelectorManager
所有已实现的接口:
Dumpable, LifeCycle

public abstract class SelectorManager
extends AbstractLifeCycle
implements Dumpable

The Selector Manager manages and number of SelectSets to allow NIO scheduling to scale to large numbers of connections.


嵌套类摘要
 class SelectorManager.SelectSet
           
 
从类 org.eclipse.jetty.util.component.AbstractLifeCycle 继承的嵌套类/接口
AbstractLifeCycle.AbstractLifeCycleListener
 
从接口 org.eclipse.jetty.util.component.LifeCycle 继承的嵌套类/接口
LifeCycle.Listener
 
字段摘要
static Logger LOG
           
 
从类 org.eclipse.jetty.util.component.AbstractLifeCycle 继承的字段
_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING
 
构造方法摘要
SelectorManager()
           
 
方法摘要
protected  void connectionFailed(SocketChannel channel, Throwable ex, Object attachment)
           
abstract  boolean dispatch(Runnable task)
           
protected  void doStart()
           
protected  void doStop()
           
 String dump()
           
 void dump(Appendable out, String indent)
           
protected abstract  void endPointClosed(SelectChannelEndPoint endpoint)
           
protected abstract  void endPointOpened(SelectChannelEndPoint endpoint)
           
protected abstract  void endPointUpgraded(ConnectedEndPoint endpoint, Connection oldConnection)
           
 long getLowResourcesConnections()
           
 long getLowResourcesMaxIdleTime()
           
 long getMaxIdleTime()
           
 int getSelectorPriorityDelta()
           
 SelectorManager.SelectSet getSelectSet(int i)
           
 int getSelectSets()
           
 boolean isDeferringInterestedOps0()
           
abstract  AsyncConnection newConnection(SocketChannel channel, AsyncEndPoint endpoint, Object attachment)
           
protected abstract  SelectChannelEndPoint newEndPoint(SocketChannel channel, SelectorManager.SelectSet selectSet, SelectionKey sKey)
          Create a new end point
 void register(ServerSocketChannel acceptChannel)
          Register a ServerSocketChannel
 void register(SocketChannel channel)
          Register a channel
 void register(SocketChannel channel, Object att)
          Register a channel
 void setDeferringInterestedOps0(boolean deferringInterestedOps0)
           
 void setLowResourcesConnections(long lowResourcesConnections)
          Set the number of connections, which if exceeded places this manager in low resources state.
 void setLowResourcesMaxIdleTime(long lowResourcesMaxIdleTime)
           
 void setMaxIdleTime(long maxIdleTime)
           
 void setSelectorPriorityDelta(int delta)
          Set the selector thread priorty delta.
 void setSelectSets(int selectSets)
           
 
从类 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, toString, wait, wait, wait
 

字段详细信息

LOG

public static final Logger LOG
构造方法详细信息

SelectorManager

public SelectorManager()
方法详细信息

setMaxIdleTime

public void setMaxIdleTime(long maxIdleTime)
参数:
maxIdleTime - The maximum period in milli seconds that a connection may be idle before it is closed.
另请参见:
setLowResourcesMaxIdleTime(long)

setSelectSets

public void setSelectSets(int selectSets)
参数:
selectSets - number of select sets to create

getMaxIdleTime

public long getMaxIdleTime()
返回:
the max idle time

getSelectSets

public int getSelectSets()
返回:
the number of select sets in use

getSelectSet

public SelectorManager.SelectSet getSelectSet(int i)
参数:
i -
返回:
The select set

register

public void register(SocketChannel channel,
                     Object att)
Register a channel

参数:
channel -
att - Attached Object

register

public void register(SocketChannel channel)
Register a channel

参数:
channel -

register

public void register(ServerSocketChannel acceptChannel)
Register a ServerSocketChannel

参数:
acceptChannel -

getSelectorPriorityDelta

public int getSelectorPriorityDelta()
返回:
delta The value to add to the selector thread priority.

setSelectorPriorityDelta

public void setSelectorPriorityDelta(int delta)
Set the selector thread priorty delta.

参数:
delta - The value to add to the selector thread priority.

getLowResourcesConnections

public long getLowResourcesConnections()
返回:
the lowResourcesConnections

setLowResourcesConnections

public void setLowResourcesConnections(long lowResourcesConnections)
Set the number of connections, which if exceeded places this manager in low resources state. This is not an exact measure as the connection count is averaged over the select sets.

参数:
lowResourcesConnections - the number of connections
另请参见:
setLowResourcesMaxIdleTime(long)

getLowResourcesMaxIdleTime

public long getLowResourcesMaxIdleTime()
返回:
the lowResourcesMaxIdleTime

setLowResourcesMaxIdleTime

public void setLowResourcesMaxIdleTime(long lowResourcesMaxIdleTime)
参数:
lowResourcesMaxIdleTime - the period in ms that a connection is allowed to be idle when this SelectSet has more connections than getLowResourcesConnections()
另请参见:
setMaxIdleTime(long)

dispatch

public abstract boolean dispatch(Runnable task)

doStart

protected void doStart()
                throws Exception
覆盖:
AbstractLifeCycle 中的 doStart
抛出:
Exception

doStop

protected void doStop()
               throws Exception
覆盖:
AbstractLifeCycle 中的 doStop
抛出:
Exception

endPointClosed

protected abstract void endPointClosed(SelectChannelEndPoint endpoint)
参数:
endpoint -

endPointOpened

protected abstract void endPointOpened(SelectChannelEndPoint endpoint)
参数:
endpoint -

endPointUpgraded

protected abstract void endPointUpgraded(ConnectedEndPoint endpoint,
                                         Connection oldConnection)

newConnection

public abstract AsyncConnection newConnection(SocketChannel channel,
                                              AsyncEndPoint endpoint,
                                              Object attachment)

newEndPoint

protected abstract SelectChannelEndPoint newEndPoint(SocketChannel channel,
                                                     SelectorManager.SelectSet selectSet,
                                                     SelectionKey sKey)
                                              throws IOException
Create a new end point

参数:
channel -
selectSet -
sKey - the selection key
返回:
the new endpoint SelectChannelEndPoint
抛出:
IOException

connectionFailed

protected void connectionFailed(SocketChannel channel,
                                Throwable ex,
                                Object attachment)

dump

public String dump()
指定者:
接口 Dumpable 中的 dump

dump

public void dump(Appendable out,
                 String indent)
          throws IOException
指定者:
接口 Dumpable 中的 dump
抛出:
IOException

isDeferringInterestedOps0

public boolean isDeferringInterestedOps0()

setDeferringInterestedOps0

public void setDeferringInterestedOps0(boolean deferringInterestedOps0)


Copyright © 2013. All Rights Reserved.