org.mortbay.io.nio
public class ChannelEndPoint extends java.lang.Object implements EndPoint
| Modifier and Type | Field and Description |
|---|---|
protected java.nio.channels.ByteChannel |
_channel |
protected java.nio.ByteBuffer[] |
_gather2 |
protected java.net.InetSocketAddress |
_local |
protected java.net.InetSocketAddress |
_remote |
protected java.net.Socket |
_socket |
| Constructor and Description |
|---|
ChannelEndPoint(java.nio.channels.ByteChannel channel) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
blockReadable(long millisecs) |
boolean |
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.
|
void |
flush()
Flush any buffered output.
|
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.
|
java.nio.channels.ByteChannel |
getChannel() |
java.lang.String |
getLocalAddr() |
java.lang.String |
getLocalHost() |
int |
getLocalPort() |
java.lang.String |
getRemoteAddr() |
java.lang.String |
getRemoteHost() |
int |
getRemotePort() |
java.lang.Object |
getTransport() |
boolean |
isBlocking() |
boolean |
isBufferingInput() |
boolean |
isBufferingOutput() |
boolean |
isBufferred() |
boolean |
isOpen() |
void |
shutdownOutput()
Shutdown any backing output stream associated with the endpoint
|
protected final java.nio.channels.ByteChannel _channel
protected final java.nio.ByteBuffer[] _gather2
protected final java.net.Socket _socket
protected final java.net.InetSocketAddress _local
protected final java.net.InetSocketAddress _remote
public boolean isBlocking()
isBlocking in interface EndPointpublic boolean blockReadable(long millisecs)
throws java.io.IOException
blockReadable in interface EndPointjava.io.IOExceptionpublic boolean blockWritable(long millisecs)
throws java.io.IOException
blockWritable in interface EndPointjava.io.IOExceptionpublic void shutdownOutput()
throws java.io.IOException
EndPointshutdownOutput in interface EndPointjava.io.IOExceptionpublic void close()
throws java.io.IOException
EndPointpublic int fill(Buffer buffer) throws java.io.IOException
EndPointpublic int flush(Buffer buffer) throws java.io.IOException
EndPointpublic int flush(Buffer header, Buffer buffer, Buffer trailer) throws java.io.IOException
EndPointflush in interface EndPointheader - 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.java.io.IOExceptionpublic java.nio.channels.ByteChannel getChannel()
public java.lang.String getLocalAddr()
getLocalAddr in interface EndPointEndPoint is bound, or null
if this EndPoint does not represent a network connection.public java.lang.String getLocalHost()
getLocalHost in interface EndPointEndPoint is bound, or null
if this EndPoint does not represent a network connection.public int getLocalPort()
getLocalPort in interface EndPointEndPoint is listening, or 0
if this EndPoint does not represent a network connection.public java.lang.String getRemoteAddr()
getRemoteAddr in interface EndPointEndPoint is connected, or null
if this EndPoint does not represent a network connection.public java.lang.String getRemoteHost()
getRemoteHost in interface EndPointEndPoint is connected, or null
if this EndPoint does not represent a network connection.public int getRemotePort()
getRemotePort in interface EndPointEndPoint is connected, or 0
if this EndPoint does not represent a network connection.public java.lang.Object getTransport()
getTransport in interface EndPointpublic void flush()
throws java.io.IOException
EndPointpublic boolean isBufferingInput()
isBufferingInput in interface EndPointpublic boolean isBufferingOutput()
isBufferingOutput in interface EndPointpublic boolean isBufferred()
isBufferred in interface EndPointCopyright © 2009 Mortbay Consulting Pty. Ltd. All Rights Reserved.