Package org.eclipse.jetty.io
Class SelectableChannelEndPoint
java.lang.Object
org.eclipse.jetty.io.IdleTimeout
org.eclipse.jetty.io.AbstractEndPoint
org.eclipse.jetty.io.SelectableChannelEndPoint
- All Implemented Interfaces:
Closeable
,AutoCloseable
,EndPoint
,ManagedSelector.Selectable
- Direct Known Subclasses:
DatagramChannelEndPoint
,SocketChannelEndPoint
public abstract class SelectableChannelEndPoint
extends AbstractEndPoint
implements ManagedSelector.Selectable
A partial EndPoint
implementation based on SelectableChannel
.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.jetty.io.EndPoint
EndPoint.Pipe, EndPoint.SslSessionData, EndPoint.Wrapper
-
Field Summary
-
Constructor Summary
ConstructorDescriptionSelectableChannelEndPoint
(Scheduler scheduler, SelectableChannel channel, ManagedSelector selector, SelectionKey selectionKey) -
Method Summary
Modifier and TypeMethodDescriptionvoid
doClose()
boolean
isOpen()
This abstract method should be called to check if idle timeouts should still be checked.protected void
void
Callback method invoked when thisEndPoint
is closed.protected void
Callback method invoked when a read or write events has been detected by theManagedSelector
for this endpoint.void
replaceKey
(SelectionKey newKey) Callback method invoked when the SelectionKey is replaced because the channel has been moved to a new selector.void
Callback method invoked when all the keys selected by theManagedSelector
for this endpoint have been processed.Methods inherited from class org.eclipse.jetty.io.AbstractEndPoint
close, close, doShutdownInput, doShutdownOutput, fillInterested, getConnection, getCreatedTimeStamp, getFillInterest, getLocalAddress, getRemoteAddress, getRemoteSocketAddress, getWriteFlusher, isFillInterested, isInputShutdown, isOutputShutdown, onClose, onIdleExpired, onOpen, reset, setConnection, shutdownInput, shutdownOutput, toConnectionString, toString, tryFillInterested, upgrade, write
Methods inherited from class org.eclipse.jetty.io.IdleTimeout
checkIdleTimeout, getIdleFor, getIdleTimeout, getScheduler, notIdle, setIdleTimeout
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.eclipse.jetty.io.EndPoint
fill, flush, getIdleTimeout, getSslSessionData, isSecure, receive, send, setIdleTimeout, write
-
Constructor Details
-
SelectableChannelEndPoint
public SelectableChannelEndPoint(Scheduler scheduler, SelectableChannel channel, ManagedSelector selector, SelectionKey selectionKey)
-
-
Method Details
-
getChannel
-
getTransport
- Specified by:
getTransport
in interfaceEndPoint
- Returns:
- The underlying transport object (socket, channel, etc.)
-
getLocalSocketAddress
- Specified by:
getLocalSocketAddress
in interfaceEndPoint
- Specified by:
getLocalSocketAddress
in classAbstractEndPoint
- Returns:
- the local SocketAddress to which this
EndPoint
is bound ornull
if thisEndPoint
is not bound to a Socket address.
-
isOpen
public boolean isOpen()Description copied from class:IdleTimeout
This abstract method should be called to check if idle timeouts should still be checked.- Specified by:
isOpen
in interfaceEndPoint
- Overrides:
isOpen
in classAbstractEndPoint
- Returns:
- True if the entity monitored should still be checked for idle timeouts
-
doClose
public void doClose()- Overrides:
doClose
in classAbstractEndPoint
-
onClose
Description copied from interface:EndPoint
Callback method invoked when this
EndPoint
is closed.- Specified by:
onClose
in interfaceEndPoint
- Overrides:
onClose
in classAbstractEndPoint
- Parameters:
cause
- The reason for the close, or null if a normal close.- See Also:
-
needsFillInterest
protected void needsFillInterest()- Specified by:
needsFillInterest
in classAbstractEndPoint
-
onIncompleteFlush
protected void onIncompleteFlush()- Specified by:
onIncompleteFlush
in classAbstractEndPoint
-
onSelected
Description copied from interface:ManagedSelector.Selectable
Callback method invoked when a read or write events has been detected by theManagedSelector
for this endpoint.- Specified by:
onSelected
in interfaceManagedSelector.Selectable
- Returns:
- a job that may block or null
-
updateKey
public void updateKey()Description copied from interface:ManagedSelector.Selectable
Callback method invoked when all the keys selected by theManagedSelector
for this endpoint have been processed.- Specified by:
updateKey
in interfaceManagedSelector.Selectable
-
replaceKey
Description copied from interface:ManagedSelector.Selectable
Callback method invoked when the SelectionKey is replaced because the channel has been moved to a new selector.- Specified by:
replaceKey
in interfaceManagedSelector.Selectable
- Parameters:
newKey
- the new SelectionKey
-
toEndPointString
- Overrides:
toEndPointString
in classAbstractEndPoint
-