public class ManagedSelector extends AbstractLifeCycle implements Dumpable
ManagedSelector wraps a Selector simplifying non-blocking operations on channels.
ManagedSelector runs the select loop, which waits on Selector.select() until events
happen for registered channels. When events happen, it notifies the EndPoint associated
with the channel.
| Modifier and Type | Class and Description |
|---|---|
static interface |
ManagedSelector.Selectable
A
ManagedSelector.Selectable is an EndPoint that wish to be
notified of non-blocking events by the ManagedSelector. |
AbstractLifeCycle.AbstractLifeCycleListenerLifeCycle.Listener| Constructor and Description |
|---|
ManagedSelector(SelectorManager selectorManager,
int id) |
| Modifier and Type | Method and Description |
|---|---|
void |
destroyEndPoint(EndPoint endPoint) |
protected void |
doStart() |
protected void |
doStop() |
String |
dump() |
void |
dump(Appendable out,
String indent) |
Selector |
getSelector() |
int |
size() |
void |
submit(Runnable change) |
String |
toString() |
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, setStopTimeout, start, stoppublic ManagedSelector(SelectorManager selectorManager, int id)
protected void doStart()
throws Exception
doStart in class AbstractLifeCycleExceptionpublic int size()
protected void doStop()
throws Exception
doStop in class AbstractLifeCycleExceptionpublic void submit(Runnable change)
public void destroyEndPoint(EndPoint endPoint)
public void dump(Appendable out, String indent) throws IOException
dump in interface DumpableIOExceptionpublic Selector getSelector()
Copyright © 1995–2017 Webtide. All rights reserved.