org.eclipse.jetty.io.nio
Class NetworkTrafficSelectChannelEndPoint

java.lang.Object
  extended by org.eclipse.jetty.io.nio.ChannelEndPoint
      extended by org.eclipse.jetty.io.nio.SelectChannelEndPoint
          extended by 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
NetworkTrafficSelectChannelEndPoint(SocketChannel channel, SelectorManager.SelectSet selectSet, SelectionKey key, int maxIdleTime, List<NetworkTrafficListener> listeners)
           
 
Method Summary
 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
blockReadable, blockWritable, cancelIdle, checkIdleTimestamp, close, dispatch, flush, getConnection, getSelectionKey, getSelectManager, getSelectSet, handle, idleExpired, isReadyForDispatch, schedule, scheduleIdle, scheduleWrite, 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, isBufferingInput, isBufferingOutput, isBufferred, isInputShutdown, isOpen, isOutputShutdown, 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, isBufferingInput, isBufferingOutput, isBufferred, 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 ChannelEndPoint
Returns:
an int value indicating the number of bytes filled or -1 if EOF is reached.
Throws:
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:
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-2011 Mort Bay Consulting. All Rights Reserved.