Class ManagedSelector
java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.ContainerLifeCycle
org.eclipse.jetty.io.ManagedSelector
- All Implemented Interfaces:
org.eclipse.jetty.util.component.Container, org.eclipse.jetty.util.component.Destroyable, org.eclipse.jetty.util.component.Dumpable, org.eclipse.jetty.util.component.Dumpable.DumpableContainer, org.eclipse.jetty.util.component.LifeCycle
public class ManagedSelector
extends org.eclipse.jetty.util.component.ContainerLifeCycle
implements org.eclipse.jetty.util.component.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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceAManagedSelector.Selectableis anEndPointthat wish to be notified of non-blocking events by theManagedSelector.static interfaceA selector update to be done when the selector has been woken.Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener, org.eclipse.jetty.util.component.AbstractLifeCycle.StopExceptionNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
org.eclipse.jetty.util.component.Container.InheritedListener, org.eclipse.jetty.util.component.Container.ListenerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
org.eclipse.jetty.util.component.Dumpable.DumpableContainer, org.eclipse.jetty.util.component.Dumpable.DumpAppendableNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
org.eclipse.jetty.util.component.LifeCycle.Listener -
Field Summary
Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
FAILED, STARTED, STARTING, STOPPED, STOPPINGFields inherited from interface org.eclipse.jetty.util.component.Dumpable
LEGEND -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoStart()protected voiddoStop()voiddump(Appendable out, String indent) protected voidendPointClosed(EndPoint endPoint) protected voidendPointOpened(EndPoint endPoint) doublelonglongintprotected voidhandleSelectFailure(Selector selector, Throwable failure) protected intprotected voidonSelectFailed(Throwable cause) voidprotected intintsize()voidsubmit(ManagedSelector.SelectorUpdate update) Submit anManagedSelector.SelectorUpdateto be acted on between calls toSelector.select()toString()Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, destroy, dump, dump, dumpObjects, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, installBean, installBean, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, start, stop, unmanage, updateBean, updateBean, updateBeans, updateBeansMethods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stopMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.jetty.util.component.Container
getCachedBeans, getEventListenersMethods inherited from interface org.eclipse.jetty.util.component.Dumpable
dump, dumpSelfMethods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpable
-
Constructor Details
-
ManagedSelector
-
-
Method Details
-
getSelector
-
doStart
-
doStop
-
getTotalKeys
@ManagedAttribute(value="Total number of keys", readonly=true) public int getTotalKeys() -
getAverageSelectedKeys
@ManagedAttribute(value="Average number of selected keys", readonly=true) public double getAverageSelectedKeys() -
getMaxSelectedKeys
@ManagedAttribute(value="Maximum number of selected keys", readonly=true) public long getMaxSelectedKeys() -
getSelectCount
@ManagedAttribute(value="Total number of select() calls", readonly=true) public long getSelectCount() -
resetStats
@ManagedOperation(value="Resets the statistics", impact="ACTION") public void resetStats() -
nioSelect
- Throws:
IOException
-
select
- Throws:
IOException
-
handleSelectFailure
- Throws:
IOException
-
onSelectFailed
-
size
public int size() -
submit
Submit anManagedSelector.SelectorUpdateto be acted on between calls toSelector.select()- Parameters:
update- The selector update to apply at next wakeup
-
endPointOpened
-
endPointClosed
-
dump
- Specified by:
dumpin interfaceorg.eclipse.jetty.util.component.Dumpable- Overrides:
dumpin classorg.eclipse.jetty.util.component.ContainerLifeCycle- Throws:
IOException
-
toString
- Overrides:
toStringin classorg.eclipse.jetty.util.component.AbstractLifeCycle
-