org.mortbay.io
Interface EndPoint

All Known Implementing Classes:
BlockingChannelConnector.Connection, ByteArrayEndPoint, ChannelEndPoint, SelectBlockingChannelConnector.HttpEndPoint, SelectChannelConnector.HttpEndPoint, SocketConnector.Connection, SocketEndPoint, StreamEndPoint, StringEndPoint

public interface EndPoint

Author:
gregw To change the template for this generated type comment go to Window - Preferences - Java - Code Generation - Code and Comments

Method Summary
 void blockReadable(long millisecs)
           
 void blockWritable(long millisecs)
           
 void close()
          Close any backing stream associated with the buffer
 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.
 int flush(Buffer header, Buffer buffer, Buffer trailer)
          Flush the buffer from the current getIndex to it's putIndex using whatever byte sink is backing the buffer.
 Object getConnection()
           
 String getLocalAddr()
           
 String getLocalHost()
           
 int getLocalPort()
           
 String getRemoteAddr()
           
 String getRemoteHost()
           
 int getRemotePort()
           
 boolean isBlocking()
           
 boolean isOpen()
           
 

Method Detail

close

void close()
           throws IOException
Close any backing stream associated with the buffer

Throws:
IOException

fill

int fill(Buffer buffer)
         throws IOException
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.

Returns:
an int value indicating the number of bytes filled or -1 if EOF is reached.
Throws:
IOException

flush

int flush(Buffer buffer)
          throws IOException
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.

Parameters:
buffer - The buffer to flush. This buffers getIndex is updated.
Returns:
the number of bytes written
Throws:
IOException

flush

int flush(Buffer header,
          Buffer buffer,
          Buffer trailer)
          throws IOException
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. The passed header/trailer buffers are written before/after the contents of this buffer. This may be done either as gather writes, as a poke into this buffer or as several writes. The implementation is free to select the optimal mechanism.

Parameters:
header - A buffer to write before flushing this buffer. This buffers getIndex is updated.
buffer - The buffer to flush. This buffers getIndex is updated.
trailer - A buffer to write after flushing this buffer. This buffers getIndex is updated.
Returns:
the total number of bytes written.
Throws:
IOException

getLocalAddr

String getLocalAddr()
Returns:

getLocalHost

String getLocalHost()
Returns:

getLocalPort

int getLocalPort()
Returns:

getRemoteAddr

String getRemoteAddr()

getRemoteHost

String getRemoteHost()
Returns:

getRemotePort

int getRemotePort()
Returns:

isBlocking

boolean isBlocking()

blockReadable

void blockReadable(long millisecs)

blockWritable

void blockWritable(long millisecs)

isOpen

boolean isOpen()

getConnection

Object getConnection()