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

public abstract Class SelectableChannelEndPoint

extends AbstractEndPoint
implements Selectable
Class Inheritance
All Implemented Interfaces
org.eclipse.jetty.io.ManagedSelector.Selectable
Known Direct Subclasses
org.eclipse.jetty.io.SocketChannelEndPoint, org.eclipse.jetty.io.DatagramChannelEndPoint
Imports
java.io.Closeable, java.net.SocketAddress, java.nio.channels.CancelledKeyException, .NetworkChannel, .SelectableChannel, .SelectionKey, .Selector, org.eclipse.jetty.util.IO, org.eclipse.jetty.util.thread.AutoLock, .Invocable, .Scheduler, org.slf4j.Logger, .LoggerFactory

A partial EndPoint implementation based on SelectableChannel.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private abstract class

Field Summary

Modifier and TypeField and Description
private final SelectableChannel
private int
private int
private SelectionKey
private final AutoLock
private final Runnable
private final Runnable
private final Runnable
private final ManagedSelector
private final ManagedSelector.SelectorUpdate
private boolean
private static final Logger

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
changeInterests(int operation)

public void
public SelectableChannel
public SocketAddress
public Object
public boolean
isOpen()

Overrides org.eclipse.jetty.io.AbstractEndPoint.isOpen.

Implements org.eclipse.jetty.io.EndPoint.isOpen.

This abstract method should be called to check if idle timeouts should still be checked.

protected void
public void
onClose(Throwable
The reason for the close, or null if a normal close.
cause
)

Overrides org.eclipse.jetty.io.AbstractEndPoint.onClose.

Implements org.eclipse.jetty.io.EndPoint.onClose.

Callback method invoked when this EndPoint is closed.

protected void
public Runnable
onSelected()

Implements org.eclipse.jetty.io.ManagedSelector.Selectable.onSelected.

Callback method invoked when a read or write events has been detected by the ManagedSelector for this endpoint.

public void
replaceKey(SelectionKey
the new SelectionKey
newKey
)

Implements org.eclipse.jetty.io.ManagedSelector.Selectable.replaceKey.

Callback method invoked when the SelectionKey is replaced because the channel has been moved to a new selector.

public String
public void
updateKey()

Implements org.eclipse.jetty.io.ManagedSelector.Selectable.updateKey.

Callback method invoked when all the keys selected by the ManagedSelector for this endpoint have been processed.

private void
Inherited from org.eclipse.jetty.io.AbstractEndPoint:
closeclosedoShutdownInputdoShutdownOutputfillInterestedgetConnectiongetCreatedTimeStampgetFillInterestgetLocalAddressgetRemoteAddressgetRemoteSocketAddressgetWriteFlusherisFillInterestedisInputShutdownisOutputShutdownonCloseonIdleExpiredonOpenresetsetConnectionshutdownInputshutdownOutputtoConnectionStringtoStringtryFillInterestedupgradewrite

Field Detail

_channelback to summary
private final SelectableChannel _channel
_currentInterestOpsback to summary
private int _currentInterestOps
_desiredInterestOpsback to summary
private int _desiredInterestOps
_keyback to summary
private SelectionKey _key
_lockback to summary
private final AutoLock _lock
_runCompleteWriteback to summary
private final Runnable _runCompleteWrite
_runCompleteWriteFillableback to summary
private final Runnable _runCompleteWriteFillable
_runFillableback to summary
private final Runnable _runFillable
_selectorback to summary
private final ManagedSelector _selector
_updateKeyActionback to summary
private final ManagedSelector.SelectorUpdate _updateKeyAction
_updatePendingback to summary
private boolean _updatePending
LOGback to summary
private static final Logger LOG

Hides org.eclipse.jetty.io.AbstractEndPoint.LOG.

Constructor Detail

SelectableChannelEndPointback to summary
public SelectableChannelEndPoint(Scheduler scheduler, SelectableChannel channel, ManagedSelector selector, SelectionKey selectionKey)

Method Detail

changeInterestsback to summary
private void changeInterests(int operation)
doCloseback to summary
public void doClose()

Overrides org.eclipse.jetty.io.AbstractEndPoint.doClose.

Annotations
@Override
getChannelback to summary
public SelectableChannel getChannel()
getLocalSocketAddressback to summary
public SocketAddress getLocalSocketAddress()

Overrides default org.eclipse.jetty.io.EndPoint.getLocalSocketAddress.

Implements abstract org.eclipse.jetty.io.AbstractEndPoint.getLocalSocketAddress.

Returns:SocketAddress

Doc from org.eclipse.jetty.io.EndPoint.getLocalSocketAddress.

the local SocketAddress to which this EndPoint is bound or null if this EndPoint is not bound to a Socket address.

Annotations
@Override
getTransportback to summary
public Object getTransport()

Implements org.eclipse.jetty.io.EndPoint.getTransport.

Returns:Object

Doc from org.eclipse.jetty.io.EndPoint.getTransport.

The underlying transport object (socket, channel, etc.)

Annotations
@Override
isOpenback to summary
public boolean isOpen()

Overrides org.eclipse.jetty.io.AbstractEndPoint.isOpen.

Implements org.eclipse.jetty.io.EndPoint.isOpen.

Doc from org.eclipse.jetty.io.IdleTimeout.isOpen.

This abstract method should be called to check if idle timeouts should still be checked.

Returns:boolean

Doc from org.eclipse.jetty.io.EndPoint.isOpen.

whether this EndPoint is open

Annotations
@Override
needsFillInterestback to summary
protected void needsFillInterest()

Implements abstract org.eclipse.jetty.io.AbstractEndPoint.needsFillInterest.

Annotations
@Override
onCloseback to summary
public void onClose(Throwable cause)

Overrides org.eclipse.jetty.io.AbstractEndPoint.onClose.

Implements org.eclipse.jetty.io.EndPoint.onClose.

Doc from org.eclipse.jetty.io.EndPoint.onClose.

Callback method invoked when this EndPoint is closed.

Parameters
cause:Throwable

The reason for the close, or null if a normal close.

Annotations
@Override
onIncompleteFlushback to summary
protected void onIncompleteFlush()

Implements abstract org.eclipse.jetty.io.AbstractEndPoint.onIncompleteFlush.

Annotations
@Override
onSelectedback to summary
public Runnable onSelected()

Implements org.eclipse.jetty.io.ManagedSelector.Selectable.onSelected.

Doc from org.eclipse.jetty.io.ManagedSelector.Selectable.onSelected.

Callback method invoked when a read or write events has been detected by the ManagedSelector for this endpoint.

Returns:Runnable

a job that may block or null

Annotations
@Override
replaceKeyback to summary
public void replaceKey(SelectionKey newKey)

Implements org.eclipse.jetty.io.ManagedSelector.Selectable.replaceKey.

Doc from org.eclipse.jetty.io.ManagedSelector.Selectable.replaceKey.

Callback method invoked when the SelectionKey is replaced because the channel has been moved to a new selector.

Parameters
newKey:SelectionKey

the new SelectionKey

Annotations
@Override
toEndPointStringback to summary
public String toEndPointString()

Overrides org.eclipse.jetty.io.AbstractEndPoint.toEndPointString.

Annotations
@Override
updateKeyback to summary
public void updateKey()

Implements org.eclipse.jetty.io.ManagedSelector.Selectable.updateKey.

Doc from org.eclipse.jetty.io.ManagedSelector.Selectable.updateKey.

Callback method invoked when all the keys selected by the ManagedSelector for this endpoint have been processed.

Annotations
@Override
updateKeyActionback to summary
private void updateKeyAction(Selector selector)
org.eclipse.jetty.io back to summary

private abstract Class SelectableChannelEndPoint.RunnableCloseable

extends Object
implements Task, Closeable
Class Inheritance
  • java.lang.Object
  • org.eclipse.jetty.io.SelectableChannelEndPoint.RunnableCloseable
All Implemented Interfaces
java.io.Closeable, java.lang.AutoCloseable, org.eclipse.jetty.util.thread.Invocable.Task, java.lang.Runnable, org.eclipse.jetty.util.thread.Invocable

Field Summary

Modifier and TypeField and Description
pack-priv final String

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements java.io.Closeable.close.

Closes this stream and releases any system resources associated with it.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

_operationback to summary
pack-priv final String _operation

Constructor Detail

RunnableCloseableback to summary
private RunnableCloseable(String operation)

Method Detail

closeback to summary
public void close()

Implements java.io.Closeable.close.

Doc from java.io.Closeable.close.

Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect.

As noted in AutoCloseable#close(), cases where the close may fail require careful attention. It is strongly advised to relinquish the underlying resources and to internally mark the Closeable as closed, prior to throwing the IOException.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override