public class ManagedSelector extends ContainerLifeCycle 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 . |
static interface |
ManagedSelector.SelectorUpdate
A selector update to be done when the selector has been woken.
|
AbstractLifeCycle.AbstractLifeCycleListener
Container.InheritedListener, Container.Listener
LifeCycle.Listener
Constructor and Description |
---|
ManagedSelector(SelectorManager selectorManager,
int id) |
Modifier and Type | Method and Description |
---|---|
void |
destroyEndPoint(EndPoint endPoint) |
void |
dump(Appendable out,
String indent)
Dump this object (and children) into an Appendable using the provided indent after any new lines.
|
Selector |
getSelector() |
int |
size() |
void |
submit(ManagedSelector.SelectorUpdate update)
Submit an
ManagedSelector.SelectorUpdate to be acted on between calls to Selector.select() |
String |
toString() |
addBean, addBean, addEventListener, addManaged, contains, destroy, dump, dump, dump, dump, dumpObject, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, unmanage, updateBean, updateBean, updateBeans
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
dump, dump, dumpContainer, dumpIterable, dumpMapEntries, dumpObject, dumpObjects, dumpSelf, named
public ManagedSelector(SelectorManager selectorManager, int id)
public Selector getSelector()
public int size()
public void submit(ManagedSelector.SelectorUpdate update)
ManagedSelector.SelectorUpdate
to be acted on between calls to Selector.select()
update
- The selector update to apply at next wakeuppublic void destroyEndPoint(EndPoint endPoint)
public void dump(Appendable out, String indent) throws IOException
Dumpable
dump
in interface Dumpable
dump
in class ContainerLifeCycle
out
- The appendable to dump toindent
- The indent to apply after any new lines.IOException
- if unable to write to Appendablepublic String toString()
toString
in class AbstractLifeCycle
Copyright © 2010 - 2020 Adobe. All Rights Reserved