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.AbstractLifeCycleListener
LifeCycle.Listener
FAILED, RUNNING, STARTED, STARTING, STOP_ON_FAILURE, STOPPED, STOPPING
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, stop
public ManagedSelector(SelectorManager selectorManager, int id)
protected void doStart() throws Exception
doStart
in class AbstractLifeCycle
Exception
public int size()
protected void doStop() throws Exception
doStop
in class AbstractLifeCycle
Exception
public void submit(Runnable change)
public void destroyEndPoint(EndPoint endPoint)
public void dump(Appendable out, String indent) throws IOException
dump
in interface Dumpable
IOException
public Selector getSelector()
Copyright © 1995–2017 Webtide. All rights reserved.