Package org.eclipse.jetty.io
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:
- Container,- Destroyable,- Dumpable,- Dumpable.DumpableContainer,- LifeCycle
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 SummaryNested 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.AbstractLifeCycleAbstractLifeCycle.AbstractLifeCycleListener, AbstractLifeCycle.StopExceptionNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.ContainerContainer.InheritedListener, Container.ListenerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.DumpableDumpable.DumpableContainerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycleLifeCycle.Listener
- 
Field Summary
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected voiddoStart()Starts the managed lifecycle beans in the order they were added.protected voiddoStop()Stops the managed lifecycle beans in the reverse order they were added.voiddump(Appendable out, String indent) Dump this object (and children) into an Appendable using the provided indent after any new lines.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.ContainerLifeCycleaddBean, addBean, addEventListener, addManaged, contains, destroy, dump, dump, dumpObjects, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, start, stop, unmanage, updateBean, updateBean, updateBeans, updateBeansMethods inherited from class org.eclipse.jetty.util.component.AbstractLifeCyclegetEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stopMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.jetty.util.component.ContainergetCachedBeans, getEventListenersMethods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainerisDumpable
- 
Constructor Details- 
ManagedSelector
 
- 
- 
Method Details- 
getSelector
- 
doStartDescription copied from class:ContainerLifeCycleStarts the managed lifecycle beans in the order they were added.- Overrides:
- doStartin class- ContainerLifeCycle
- Throws:
- AbstractLifeCycle.StopException- If thrown, the lifecycle will immediately be stopped.
- Exception- If there was a problem starting. Will cause a transition to FAILED state
 
- 
doStopDescription copied from class:ContainerLifeCycleStops the managed lifecycle beans in the reverse order they were added.- Overrides:
- doStopin class- ContainerLifeCycle
- Throws:
- Exception- If there was a problem stopping. Will cause a transition to FAILED state
 
- 
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
- 
nioSelect- Throws:
- IOException
 
- 
select- Throws:
- IOException
 
- 
handleSelectFailure- Throws:
- IOException
 
- 
onSelectFailed
- 
sizepublic int size()
- 
submitSubmit anManagedSelector.SelectorUpdateto be acted on between calls toSelector.select()- Parameters:
- update- The selector update to apply at next wakeup
 
- 
endPointOpened
- 
endPointClosed
- 
dumpDescription copied from interface:DumpableDump this object (and children) into an Appendable using the provided indent after any new lines. The indent should not be applied to the first object dumped.- Specified by:
- dumpin interface- Dumpable
- Overrides:
- dumpin class- ContainerLifeCycle
- Parameters:
- out- The appendable to dump to
- indent- The indent to apply after any new lines.
- Throws:
- IOException- if unable to write to Appendable
 
- 
toString- Overrides:
- toStringin class- AbstractLifeCycle
 
 
-