public class ManagedSelector extends AbstractLifeCycle implements Runnable, 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.SelectableEndPoint
A
ManagedSelector.SelectableEndPoint 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) |
ManagedSelector(SelectorManager selectorManager,
int id,
ExecutionStrategy.Factory executionFactory) |
| Modifier and Type | Method and Description |
|---|---|
void |
destroyEndPoint(EndPoint endPoint) |
protected void |
doStart() |
protected void |
doStop() |
String |
dump() |
void |
dump(Appendable out,
String indent) |
ExecutionStrategy |
getExecutionStrategy() |
protected Selector |
newSelector() |
void |
run() |
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)
public ManagedSelector(SelectorManager selectorManager, int id, ExecutionStrategy.Factory executionFactory)
public ExecutionStrategy getExecutionStrategy()
protected void doStart()
throws Exception
doStart in class AbstractLifeCycleExceptionprotected Selector newSelector() throws IOException
IOExceptionpublic 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 DumpableIOExceptionCopyright © 1995-2016 Webtide. All Rights Reserved.