|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.jetty.util.component.AbstractLifeCycle org.eclipse.jetty.io.nio.SelectorManager
public abstract class SelectorManager
The Selector Manager manages and number of SelectSets to allow NIO scheduling to scale to large numbers of connections.
Nested Class Summary | |
---|---|
class |
SelectorManager.SelectSet
|
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 | |
---|---|
static Logger |
LOG
|
Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle |
---|
_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING |
Constructor Summary | |
---|---|
SelectorManager()
|
Method Summary | |
---|---|
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)
|
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle |
---|
addLifeCycleListener, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Logger LOG
Constructor Detail |
---|
public SelectorManager()
Method Detail |
---|
public void setMaxIdleTime(long maxIdleTime)
maxIdleTime
- The maximum period in milli seconds that a connection may be idle before it is closed.setLowResourcesMaxIdleTime(long)
public void setSelectSets(int selectSets)
selectSets
- number of select sets to createpublic long getMaxIdleTime()
public int getSelectSets()
public SelectorManager.SelectSet getSelectSet(int i)
i
-
public void register(SocketChannel channel, Object att)
channel
- att
- Attached Objectpublic void register(SocketChannel channel)
channel
- public void register(ServerSocketChannel acceptChannel)
ServerSocketChannel
acceptChannel
- public int getSelectorPriorityDelta()
public void setSelectorPriorityDelta(int delta)
delta
- The value to add to the selector thread priority.public long getLowResourcesConnections()
public void setLowResourcesConnections(long lowResourcesConnections)
lowResourcesConnections
- the number of connectionssetLowResourcesMaxIdleTime(long)
public long getLowResourcesMaxIdleTime()
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)
public abstract boolean dispatch(Runnable task)
protected void doStart() throws Exception
doStart
in class AbstractLifeCycle
Exception
protected void doStop() throws Exception
doStop
in class AbstractLifeCycle
Exception
protected abstract void endPointClosed(SelectChannelEndPoint endpoint)
endpoint
- protected abstract void endPointOpened(SelectChannelEndPoint endpoint)
endpoint
- protected abstract void endPointUpgraded(ConnectedEndPoint endpoint, Connection oldConnection)
public abstract AsyncConnection newConnection(SocketChannel channel, AsyncEndPoint endpoint, Object attachment)
protected abstract SelectChannelEndPoint newEndPoint(SocketChannel channel, SelectorManager.SelectSet selectSet, SelectionKey sKey) throws IOException
channel
- selectSet
- sKey
- the selection key
SelectChannelEndPoint
IOException
protected void connectionFailed(SocketChannel channel, Throwable ex, Object attachment)
public String dump()
dump
in interface Dumpable
public void dump(Appendable out, String indent) throws IOException
dump
in interface Dumpable
IOException
public boolean isDeferringInterestedOps0()
public void setDeferringInterestedOps0(boolean deferringInterestedOps0)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |