Package org.eclipse.jetty.io
Class ChannelEndPoint
- java.lang.Object
-
- org.eclipse.jetty.io.IdleTimeout
-
- org.eclipse.jetty.io.AbstractEndPoint
-
- org.eclipse.jetty.io.ChannelEndPoint
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,EndPoint
,ManagedSelector.Selectable
- Direct Known Subclasses:
SocketChannelEndPoint
@Deprecated(since="2021-05-27") public abstract class ChannelEndPoint extends AbstractEndPoint implements ManagedSelector.Selectable
Deprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.Channel End Point.Holds the channel and socket for an NIO endpoint.
-
-
Constructor Summary
Constructors Constructor Description ChannelEndPoint(java.nio.channels.SocketChannel channel, ManagedSelector selector, java.nio.channels.SelectionKey key, Scheduler scheduler)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
doClose()
Deprecated.int
fill(java.nio.ByteBuffer buffer)
Deprecated.Fill the passed buffer with data from this endpoint.boolean
flush(java.nio.ByteBuffer... buffers)
Deprecated.Flush data from the passed header/buffer to this endpoint.java.nio.channels.SocketChannel
getChannel()
Deprecated.java.net.InetSocketAddress
getLocalAddress()
Deprecated.java.net.InetSocketAddress
getRemoteAddress()
Deprecated.java.lang.Object
getTransport()
Deprecated.boolean
isOpen()
Deprecated.This abstract method should be called to check if idle timeouts should still be checked.boolean
isOptimizedForDirectBuffers()
Deprecated.Is the endpoint optimized for DirectBuffer usagevoid
onClose()
Deprecated.Callback method invoked when this EndPoint is close.java.lang.Runnable
onSelected()
Deprecated.Callback method invoked when a read or write events has been detected by theManagedSelector
for this endpoint.void
replaceKey(java.nio.channels.SelectionKey newKey)
Deprecated.Callback method invoked when the SelectionKey is replaced because the channel has been moved to a new selector.java.lang.String
toEndPointString()
Deprecated.void
updateKey()
Deprecated.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
checkFill, checkFlush, close, fillInterested, getConnection, getCreatedTimeStamp, getFillInterest, getWriteFlusher, isFillInterested, isInputShutdown, isOutputShutdown, onOpen, setConnection, shutdownOutput, toConnectionString, toString, tryFillInterested, upgrade, write
-
Methods inherited from class org.eclipse.jetty.io.IdleTimeout
getIdleFor, getIdleTimeout, getScheduler, notIdle, setIdleTimeout
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.jetty.io.EndPoint
getIdleTimeout, setIdleTimeout
-
-
-
-
Constructor Detail
-
ChannelEndPoint
public ChannelEndPoint(java.nio.channels.SocketChannel channel, ManagedSelector selector, java.nio.channels.SelectionKey key, Scheduler scheduler)
Deprecated.
-
-
Method Detail
-
getLocalAddress
public java.net.InetSocketAddress getLocalAddress()
Deprecated.- Specified by:
getLocalAddress
in interfaceEndPoint
- Returns:
- The local Inet address to which this
EndPoint
is bound, ornull
if thisEndPoint
does not represent a network connection.
-
getRemoteAddress
public java.net.InetSocketAddress getRemoteAddress()
Deprecated.- Specified by:
getRemoteAddress
in interfaceEndPoint
- Returns:
- The remote Inet address to which this
EndPoint
is bound, ornull
if thisEndPoint
does not represent a network connection.
-
isOptimizedForDirectBuffers
public boolean isOptimizedForDirectBuffers()
Deprecated.Description copied from interface:EndPoint
Is the endpoint optimized for DirectBuffer usage- Specified by:
isOptimizedForDirectBuffers
in interfaceEndPoint
- Overrides:
isOptimizedForDirectBuffers
in classAbstractEndPoint
- Returns:
- True if direct buffers can be used optimally.
-
isOpen
public boolean isOpen()
Deprecated.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()
Deprecated.
-
onClose
public void onClose()
Deprecated.Description copied from interface:EndPoint
Callback method invoked when this EndPoint is close.
- Specified by:
onClose
in interfaceEndPoint
- Overrides:
onClose
in classAbstractEndPoint
- See Also:
EndPoint.onOpen()
-
fill
public int fill(java.nio.ByteBuffer buffer) throws java.io.IOException
Deprecated.Description copied from interface:EndPoint
Fill the passed buffer with data from this endpoint. The bytes are appended to any data already in the buffer by writing from the buffers limit up to it's capacity. The limit is updated to include the filled bytes.- Specified by:
fill
in interfaceEndPoint
- Parameters:
buffer
- The buffer to fill. The position and limit are modified during the fill. After the operation, the position is unchanged and the limit is increased to reflect the new data filled.- Returns:
- an
int
value indicating the number of bytes filled or -1 if EOF is read or the input is shutdown. - Throws:
java.io.IOException
- if the endpoint is closed.
-
flush
public boolean flush(java.nio.ByteBuffer... buffers) throws java.io.IOException
Deprecated.Description copied from interface:EndPoint
Flush data from the passed header/buffer to this endpoint. As many bytes as can be consumed are taken from the header/buffer position up until the buffer limit. The header/buffers position is updated to indicate how many bytes have been consumed.- Specified by:
flush
in interfaceEndPoint
- Parameters:
buffers
- the buffers to flush- Returns:
- True IFF all the buffers have been consumed and the endpoint has flushed the data to its destination (ie is not buffering any data).
- Throws:
java.io.IOException
- If the endpoint is closed or output is shutdown.
-
getChannel
public java.nio.channels.SocketChannel getChannel()
Deprecated.
-
getTransport
public java.lang.Object getTransport()
Deprecated.- Specified by:
getTransport
in interfaceEndPoint
- Returns:
- The underlying transport object (socket, channel, etc.)
-
onSelected
public java.lang.Runnable onSelected()
Deprecated.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()
Deprecated.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
public void replaceKey(java.nio.channels.SelectionKey newKey)
Deprecated.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
public java.lang.String toEndPointString()
Deprecated.- Overrides:
toEndPointString
in classAbstractEndPoint
-
-