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

public Class NetworkTrafficSocketChannelEndPoint

extends SocketChannelEndPoint
Class Inheritance
Imports
java.io.IOException, java.nio.ByteBuffer, java.nio.channels.SelectionKey, .SocketChannel, org.eclipse.jetty.util.thread.Scheduler, org.slf4j.Logger, .LoggerFactory

A specialized version of SocketChannelEndPoint that supports NetworkTrafficListeners.

Field Summary

Modifier and TypeField and Description
private final NetworkTrafficListener
private static final Logger

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public int
fill(ByteBuffer
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.
buffer
)

Overrides org.eclipse.jetty.io.SocketChannelEndPoint.fill.

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

Fill the passed buffer with data from this endpoint.
public boolean
flush(ByteBuffer...
the buffers to flush
buffers
)

Overrides org.eclipse.jetty.io.SocketChannelEndPoint.flush.

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

Flush data from the passed header/buffer to this endpoint.
public void
notifyIncoming(ByteBuffer buffer, int read)

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

Overrides org.eclipse.jetty.io.SelectableChannelEndPoint.onClose.

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

Callback method invoked when this EndPoint is closed.

public void
onOpen()

Overrides org.eclipse.jetty.io.AbstractEndPoint.onOpen.

Implements org.eclipse.jetty.io.EndPoint.onOpen.

Callback method invoked when this EndPoint is opened.

Inherited from org.eclipse.jetty.io.SocketChannelEndPoint:
doShutdownOutputgetChannelgetRemoteSocketAddress

Field Detail

listenerback to summary
private final NetworkTrafficListener listener
LOGback to summary
private static final Logger LOG

Hides org.eclipse.jetty.io.SocketChannelEndPoint.LOG.

Constructor Detail

NetworkTrafficSocketChannelEndPointback to summary
public NetworkTrafficSocketChannelEndPoint(SocketChannel channel, ManagedSelector selectSet, SelectionKey key, Scheduler scheduler, long idleTimeout, NetworkTrafficListener listener)

Method Detail

fillback to summary
public int fill(ByteBuffer buffer) throws IOException

Overrides org.eclipse.jetty.io.SocketChannelEndPoint.fill.

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

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

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.

Parameters
buffer:ByteBuffer

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:int

an int value indicating the number of bytes filled or -1 if EOF is read or the input is shutdown.

Annotations
@Override
Exceptions
IOException:
if the endpoint is closed.
flushback to summary
public boolean flush(ByteBuffer... buffers) throws IOException

Overrides org.eclipse.jetty.io.SocketChannelEndPoint.flush.

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

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

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.

Parameters
buffers:ByteBuffer[]

the buffers to flush

Returns:boolean

True IFF all the buffers have been consumed and the endpoint has flushed the data to its destination (ie is not buffering any data).

Annotations
@Override
Exceptions
IOException:
If the endpoint is closed or output is shutdown.
notifyIncomingback to summary
public void notifyIncoming(ByteBuffer buffer, int read)
notifyOutgoingback to summary
public void notifyOutgoing(ByteBuffer view)
onCloseback to summary
public void onClose(Throwable failure)

Overrides org.eclipse.jetty.io.SelectableChannelEndPoint.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
failure:Throwable

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

Annotations
@Override
onOpenback to summary
public void onOpen()

Overrides org.eclipse.jetty.io.AbstractEndPoint.onOpen.

Implements org.eclipse.jetty.io.EndPoint.onOpen.

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

Callback method invoked when this EndPoint is opened.

Annotations
@Override