- java.lang.Object
-
- org.eclipse.jetty.io.IdleTimeout
-
- org.eclipse.jetty.io.AbstractEndPoint
-
- org.eclipse.jetty.io.ChannelEndPoint
-
- org.eclipse.jetty.io.SocketChannelEndPoint
-
- org.eclipse.jetty.io.NetworkTrafficSelectChannelEndPoint
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,EndPoint,ManagedSelector.Selectable
public class NetworkTrafficSelectChannelEndPoint extends SocketChannelEndPoint
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.io.EndPoint
EndPoint.Wrapper
-
-
Field Summary
-
Fields inherited from class org.eclipse.jetty.io.ChannelEndPoint
_currentInterestOps, _desiredInterestOps, _key, _selector
-
-
Constructor Summary
Constructors Constructor Description NetworkTrafficSelectChannelEndPoint(java.nio.channels.SocketChannel channel, ManagedSelector selectSet, java.nio.channels.SelectionKey key, Scheduler scheduler, long idleTimeout, java.util.List<NetworkTrafficListener> listeners)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intfill(java.nio.ByteBuffer buffer)Fill the passed buffer with data from this endpoint.booleanflush(java.nio.ByteBuffer... buffers)Flush data from the passed header/buffer to this endpoint.voidnotifyIncoming(java.nio.ByteBuffer buffer, int read)voidnotifyOutgoing(java.nio.ByteBuffer view)voidonClose(java.lang.Throwable cause)Callback method invoked when thisEndPointis close.voidonOpen()Callback method invoked when thisEndPointis opened.-
Methods inherited from class org.eclipse.jetty.io.SocketChannelEndPoint
doShutdownOutput, getLocalAddress, getRemoteAddress, getSocket
-
Methods inherited from class org.eclipse.jetty.io.ChannelEndPoint
doClose, getChannel, getTransport, isOpen, needsFillInterest, onIncompleteFlush, onSelected, toEndPointString, updateKey
-
Methods inherited from class org.eclipse.jetty.io.AbstractEndPoint
checkFill, checkFlush, close, close, doShutdownInput, fillInterested, getConnection, getCreatedTimeStamp, getFillInterest, getWriteFlusher, isFillInterested, isInputShutdown, isOutputShutdown, onClose, onIdleExpired, 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
getIdleTimeout, setIdleTimeout
-
-
-
-
Constructor Detail
-
NetworkTrafficSelectChannelEndPoint
public NetworkTrafficSelectChannelEndPoint(java.nio.channels.SocketChannel channel, ManagedSelector selectSet, java.nio.channels.SelectionKey key, Scheduler scheduler, long idleTimeout, java.util.List<NetworkTrafficListener> listeners) throws java.io.IOException- Throws:
java.io.IOException
-
-
Method Detail
-
fill
public int fill(java.nio.ByteBuffer buffer) throws java.io.IOExceptionDescription copied from interface:EndPointFill 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:
fillin interfaceEndPoint- Overrides:
fillin classChannelEndPoint- 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
intvalue 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.IOExceptionDescription copied from interface:EndPointFlush 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:
flushin interfaceEndPoint- Overrides:
flushin classChannelEndPoint- 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.
-
onOpen
public void onOpen()
Description copied from interface:EndPointCallback method invoked when this
EndPointis opened.- Specified by:
onOpenin interfaceEndPoint- Overrides:
onOpenin classAbstractEndPoint- See Also:
EndPoint.onClose(Throwable)
-
onClose
public void onClose(java.lang.Throwable cause)
Description copied from interface:EndPointCallback method invoked when this
EndPointis close.- Specified by:
onClosein interfaceEndPoint- Overrides:
onClosein classChannelEndPoint- Parameters:
cause- The reason for the close, or null if a normal close.- See Also:
EndPoint.onOpen()
-
notifyIncoming
public void notifyIncoming(java.nio.ByteBuffer buffer, int read)
-
notifyOutgoing
public void notifyOutgoing(java.nio.ByteBuffer view)
-
-