Top Description Inners Fields Constructors Methods
org.eclipse.jetty.io

public Class ManagedSelector

extends ContainerLifeCycle
implements Dumpable
Class Inheritance
All Implemented Interfaces
org.eclipse.jetty.util.component.Dumpable
Imports
java.io.Closeable, .IOException, java.net.ConnectException, .SocketTimeoutException, java.nio.channels.CancelledKeyException, .ClosedSelectorException, .SelectableChannel, .SelectionKey, .Selector, java.time.ZonedDateTime, java.time.format.DateTimeFormatter, java.util.ArrayDeque, .ArrayList, .Collections, .Deque, .Iterator, .List, .Locale, .Objects, .Set, java.util.concurrent.CountDownLatch, .Executor, .RejectedExecutionException, .TimeUnit, java.util.concurrent.atomic.AtomicBoolean, org.eclipse.jetty.util.IO, org.eclipse.jetty.util.annotation.ManagedAttribute, .ManagedOperation, org.eclipse.jetty.util.component.ContainerLifeCycle, .Dumpable, .DumpableCollection, org.eclipse.jetty.util.statistic.SampleStatistic, org.eclipse.jetty.util.thread.AutoLock, .ExecutionStrategy, .Scheduler, org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy, org.slf4j.Logger, .LoggerFactory

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.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv class
pack-priv class
private class
pack-priv class
private class
private class
private static class
public static interface
ManagedSelector.Selectable

A Selectable is an EndPoint that wish to be notified of non-blocking events by the ManagedSelector.

private class
public static interface
ManagedSelector.SelectorUpdate

A selector update to be done when the selector has been woken.

private class
private class

Field Summary

Modifier and TypeField and Description
private final int
private final SampleStatistic
private final AutoLock
private boolean
private Selector
private final SelectorManager
private final AtomicBoolean
private final ExecutionStrategy
private Deque<ManagedSelector.SelectorUpdate>
private Deque<ManagedSelector.SelectorUpdate>
private static final boolean
private static final Logger

Constructor Summary

AccessConstructor and Description
public
ManagedSelector(SelectorManager selectorManager, int id)

Method Summary

Modifier and TypeMethod and Description
pack-priv void
pack-priv void
protected void
doStart()

Overrides org.eclipse.jetty.util.component.ContainerLifeCycle.doStart.

Starts the managed lifecycle beans in the order they were added.
protected void
doStop()

Overrides org.eclipse.jetty.util.component.ContainerLifeCycle.doStop.

Stops the managed lifecycle beans in the reverse order they were added.
public void
dump(Appendable
The appendable to dump to
out
,
String
The indent to apply after any new lines.
indent
)

Overrides org.eclipse.jetty.util.component.ContainerLifeCycle.dump.

Implements org.eclipse.jetty.util.component.Dumpable.dump.

Dump this object (and children) into an Appendable using the provided indent after any new lines.
protected void
protected void
private void
private int
public double
public long
public long
public Selector
public int
protected void
protected int
nioSelect(Selector selector, boolean now)

protected void
private void
public void
pack-priv static int
pack-priv static int
safeReadyOps(SelectionKey selectionKey)

protected int
select(Selector selector)

public int
size()

public void
submit(ManagedSelector.SelectorUpdate
The selector update to apply at next wakeup
update
)

Submit an SelectorUpdate to be acted on between calls to Selector#select()

private void
submit(ManagedSelector.SelectorUpdate update, boolean lazy)

public String
toString()

Overrides org.eclipse.jetty.util.component.AbstractLifeCycle.toString.

Returns a string representation of the object.
private void
Inherited from org.eclipse.jetty.util.component.ContainerLifeCycle:
addBeanaddBeanaddEventListeneraddManagedcontainsdestroydumpdumpdumpObjectsdumpStdErrgetBeangetBeansgetBeansgetContainedBeansgetContainedBeansisAutoisManagedisUnmanagedmanageremoveBeanremoveBeansremoveEventListenersetBeansstartstopunmanageupdateBeanupdateBeanupdateBeansupdateBeans