org.eclipse.jetty.io.nio

## Class NetworkTrafficSelectChannelEndPoint

- java.lang.Object
- - org.eclipse.jetty.io.nio.ChannelEndPoint
  - - org.eclipse.jetty.io.nio.SelectChannelEndPoint
    - - org.eclipse.jetty.io.nio.NetworkTrafficSelectChannelEndPoint

- All Implemented Interfaces:
    AsyncEndPoint, ConnectedEndPoint, EndPoint

      public class NetworkTrafficSelectChannelEndPoint
      extends SelectChannelEndPoint

- - ### Field Summary

    - ### Fields inherited from class org.eclipse.jetty.io.nio.ChannelEndPoint

      `_channel, _gather2, _local, _maxIdleTime, _remote, _socket`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `NetworkTrafficSelectChannelEndPoint(SocketChannel channel, SelectorManager.SelectSet selectSet, SelectionKey key, int maxIdleTime, List<NetworkTrafficListener> listeners)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `fill(Buffer buffer)` Fill the buffer from the current putIndex to it's capacity from whatever byte source is backing the buffer.
    `int` | `flush(Buffer buffer)` Flush the buffer from the current getIndex to it's putIndex using whatever byte sink is backing the buffer.
    `protected int` | `gatheringFlush(Buffer header, ByteBuffer bbuf0, Buffer buffer, ByteBuffer bbuf1)`
    `void` | `notifyClosed()`
    `void` | `notifyIncoming(Buffer buffer, int read)`
    `void` | `notifyOpened()`
    `void` | `notifyOutgoing(Buffer buffer, int position, int written)`

    - ### Methods inherited from class org.eclipse.jetty.io.nio.SelectChannelEndPoint

      `asyncDispatch, blockReadable, blockWritable, cancelTimeout, checkIdleTimestamp, close, dispatch, flush, getConnection, getIdleTimestamp, getSelectionKey, getSelectManager, getSelectSet, handle, hasProgressed, isCheckForIdle, isWritable, notIdle, onIdleExpired, schedule, scheduleTimeout, scheduleWrite, setCheckForIdle, setConnection, setMaxIdleTime, toString, undispatch`

    - ### Methods inherited from class org.eclipse.jetty.io.nio.ChannelEndPoint

      `flush, getChannel, getLocalAddr, getLocalHost, getLocalPort, getMaxIdleTime, getRemoteAddr, getRemoteHost, getRemotePort, getTransport, isBlocking, isInputShutdown, isOpen, isOutputShutdown, shutdownChannelInput, shutdownChannelOutput, shutdownInput, shutdownOutput`

    - ### 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

      `flush, getLocalAddr, getLocalHost, getLocalPort, getMaxIdleTime, getRemoteAddr, getRemoteHost, getRemotePort, getTransport, isBlocking, isInputShutdown, isOpen, isOutputShutdown, shutdownInput, shutdownOutput`

- - ### Constructor Detail

    - #### NetworkTrafficSelectChannelEndPoint

          public NetworkTrafficSelectChannelEndPoint(SocketChannel channel,
                                             SelectorManager.SelectSet selectSet,
                                             SelectionKey key,
                                             int maxIdleTime,
                                             List<NetworkTrafficListener> listeners)
                                              throws IOException

      Throws:
        `IOException`

  - ### Method Detail

    - #### fill

          public int fill(Buffer buffer)
                   throws IOException

      Description copied from interface: `EndPoint`
      Fill the buffer from the current putIndex to it's capacity from whatever byte source is backing the buffer. The putIndex is increased if bytes filled. The buffer may chose to do a compact before filling.
      Specified by:
        `fill` in interface `EndPoint`
      Overrides:
        `fill` in class `SelectChannelEndPoint`
      Returns:
        an `int` value indicating the number of bytes filled or -1 if EOF is reached.
      Throws:
        `EofException` - If input is shutdown or the endpoint is closed.
        `IOException`

    - #### flush

          public int flush(Buffer buffer)
                    throws IOException

      Description copied from interface: `EndPoint`
      Flush the buffer from the current getIndex to it's putIndex using whatever byte sink is backing the buffer. The getIndex is updated with the number of bytes flushed. Any mark set is cleared. If the entire contents of the buffer are flushed, then an implicit empty() is done.
      Specified by:
        `flush` in interface `EndPoint`
      Overrides:
        `flush` in class `SelectChannelEndPoint`
      Parameters:
        `buffer` - The buffer to flush. This buffers getIndex is updated.
      Returns:
        the number of bytes written
      Throws:
        `EofException` - If the endpoint is closed or output is shutdown.
        `IOException`

    - #### gatheringFlush

          protected int gatheringFlush(Buffer header,
                           ByteBuffer bbuf0,
                           Buffer buffer,
                           ByteBuffer bbuf1)
                                throws IOException

      Overrides:
        `gatheringFlush` in class `ChannelEndPoint`
      Throws:
        `IOException`

    - #### notifyOpened

          public void notifyOpened()

    - #### notifyIncoming

          public void notifyIncoming(Buffer buffer,
                            int read)

    - #### notifyOutgoing

          public void notifyOutgoing(Buffer buffer,
                            int position,
                            int written)

    - #### notifyClosed

          public void notifyClosed()

Copyright © 1995-2012 Mort Bay Consulting. All Rights Reserved.