Top Methods
org.mortbay.io

public Interface EndPoint

Known Direct Subinterfaces
org.mortbay.io.AsyncEndPoint
Known Direct Implementers
org.mortbay.io.bio.StreamEndPoint, org.mortbay.io.nio.ChannelEndPoint, org.mortbay.io.ByteArrayEndPoint
Imports
java.io.IOException

Author
gregw A transport EndPoint

Method Summary

Modifier and TypeMethod and Description
public boolean
blockReadable(long millisecs)

public boolean
blockWritable(long millisecs)

public void
close()

Close any backing stream associated with the buffer

public int

Returns:

an int value indicating the number of bytes filled or -1 if EOF is reached.
fill
(Buffer buffer)

Fill the buffer from the current putIndex to it's capacity from whatever byte source is backing the buffer.

public int

Returns:

the number of bytes written
flush
(Buffer
The buffer to flush. This buffers getIndex is updated.
buffer
)

Flush the buffer from the current getIndex to it's putIndex using whatever byte sink is backing the buffer.

public int

Returns:

the total number of bytes written.
flush
(Buffer
A buffer to write before flushing this buffer. This buffers getIndex is updated.
header
,
Buffer
The buffer to flush. This buffers getIndex is updated.
buffer
,
Buffer
A buffer to write after flushing this buffer. This buffers getIndex is updated.
trailer
)

Flush the buffer from the current getIndex to it's putIndex using whatever byte sink is backing the buffer.

public void
flush()

Flush any buffered output.

public String

Returns:

The local IP address to which this EndPoint is bound, or null if this EndPoint does not represent a network connection.
getLocalAddr
()

public String

Returns:

The local host name to which this EndPoint is bound, or null if this EndPoint does not represent a network connection.
getLocalHost
()

public int

Returns:

The local port number on which this EndPoint is listening, or 0 if this EndPoint does not represent a network connection.
getLocalPort
()

public String

Returns:

The remote IP address to which this EndPoint is connected, or null if this EndPoint does not represent a network connection.
getRemoteAddr
()

public String

Returns:

The host name of the remote machine to which this EndPoint is connected, or null if this EndPoint does not represent a network connection.
getRemoteHost
()

public int

Returns:

The remote port number to which this EndPoint is connected, or 0 if this EndPoint does not represent a network connection.
getRemotePort
()

public Object

Returns:

The underlying transport object (socket, channel, etc.)
getTransport
()

public boolean
public boolean

Returns:

True if the endpoint has some buffered input data
isBufferingInput
()

public boolean

Returns:

True if the endpoint has some buffered output data
isBufferingOutput
()

public boolean
public boolean

Method Detail

blockReadableback to summary
public boolean blockReadable(long millisecs) throws IOException
blockWritableback to summary
public boolean blockWritable(long millisecs) throws IOException
closeback to summary
public void close() throws IOException

Close any backing stream associated with the buffer

fillback to summary
public 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:int

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

flushback to summary
public 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:Buffer

The buffer to flush. This buffers getIndex is updated.

Returns:int

the number of bytes written

flushback to summary
public 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:Buffer

A buffer to write before flushing this buffer. This buffers getIndex is updated.

buffer:Buffer

The buffer to flush. This buffers getIndex is updated.

trailer:Buffer

A buffer to write after flushing this buffer. This buffers getIndex is updated.

Returns:int

the total number of bytes written.

flushback to summary
public void flush() throws IOException

Flush any buffered output. May fail to write all data if endpoint is non-blocking

getLocalAddrback to summary
public String getLocalAddr()
Returns:String

The local IP address to which this EndPoint is bound, or null if this EndPoint does not represent a network connection.

getLocalHostback to summary
public String getLocalHost()
Returns:String

The local host name to which this EndPoint is bound, or null if this EndPoint does not represent a network connection.

getLocalPortback to summary
public int getLocalPort()
Returns:int

The local port number on which this EndPoint is listening, or 0 if this EndPoint does not represent a network connection.

getRemoteAddrback to summary
public String getRemoteAddr()
Returns:String

The remote IP address to which this EndPoint is connected, or null if this EndPoint does not represent a network connection.

getRemoteHostback to summary
public String getRemoteHost()
Returns:String

The host name of the remote machine to which this EndPoint is connected, or null if this EndPoint does not represent a network connection.

getRemotePortback to summary
public int getRemotePort()
Returns:int

The remote port number to which this EndPoint is connected, or 0 if this EndPoint does not represent a network connection.

getTransportback to summary
public Object getTransport()
Returns:Object

The underlying transport object (socket, channel, etc.)

isBlockingback to summary
public boolean isBlocking()
isBufferingInputback to summary
public boolean isBufferingInput()
Returns:boolean

True if the endpoint has some buffered input data

isBufferingOutputback to summary
public boolean isBufferingOutput()
Returns:boolean

True if the endpoint has some buffered output data

isBufferredback to summary
public boolean isBufferred()
isOpenback to summary
public boolean isOpen()