|
Apache Tomcat 7.0.28 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.tomcat.util.net.NioChannel
public class NioChannel
Base class for a SocketChannel wrapper used by the endpoint. This way, logic for a SSL socket channel remains the same as for a non SSL, making sure we don't need to code for any exception cases.
| Field Summary | |
|---|---|
protected SecureNioChannel.ApplicationBufferHandler |
bufHandler
|
protected static ByteBuffer |
emptyBuf
|
protected NioEndpoint.Poller |
poller
|
protected SocketChannel |
sc
|
protected boolean |
sendFile
|
| Constructor Summary | |
|---|---|
NioChannel(SocketChannel channel,
SecureNioChannel.ApplicationBufferHandler bufHandler)
|
|
| Method Summary | |
|---|---|
void |
close()
Closes this channel. |
void |
close(boolean force)
|
boolean |
flush(boolean block,
Selector s,
long timeout)
Returns true if the network buffer has been flushed out and is empty. |
boolean |
flushOutbound()
Return true if the buffer wrote data |
Object |
getAttachment(boolean remove)
|
int |
getBufferSize()
|
SecureNioChannel.ApplicationBufferHandler |
getBufHandler()
getBufHandler |
SocketChannel |
getIOChannel()
getIOChannel |
int |
getOutboundRemaining()
|
NioEndpoint.Poller |
getPoller()
|
int |
handshake(boolean read,
boolean write)
|
boolean |
isClosing()
isClosing |
boolean |
isHandshakeComplete()
isInitHandshakeComplete |
boolean |
isOpen()
Tells whether or not this channel is open. |
boolean |
isSendFile()
|
int |
read(ByteBuffer dst)
Reads a sequence of bytes from this channel into the given buffer. |
void |
reset()
|
void |
setIOChannel(SocketChannel IOChannel)
|
void |
setPoller(NioEndpoint.Poller poller)
|
void |
setSendFile(boolean s)
|
String |
toString()
|
int |
write(ByteBuffer src)
Writes a sequence of bytes to this channel from the given buffer. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static ByteBuffer emptyBuf
protected SocketChannel sc
protected SecureNioChannel.ApplicationBufferHandler bufHandler
protected NioEndpoint.Poller poller
protected boolean sendFile
| Constructor Detail |
|---|
public NioChannel(SocketChannel channel,
SecureNioChannel.ApplicationBufferHandler bufHandler)
throws IOException
IOException| Method Detail |
|---|
public void reset()
throws IOException
IOExceptionpublic int getBufferSize()
public boolean flush(boolean block,
Selector s,
long timeout)
throws IOException
block - Unused. May be used when overriddens - Unused. May be used when overriddentimeout - Unused. May be used when overridden
true since there is no network buffer
in the regular channel
IOException
public void close()
throws IOException
close in interface Closeableclose in interface ChannelIOException - If an I/O error occurs
TODO Implement this java.nio.channels.Channel method
public void close(boolean force)
throws IOException
IOExceptionpublic boolean isOpen()
isOpen in interface Channel
public int write(ByteBuffer src)
throws IOException
write in interface WritableByteChannelsrc - The buffer from which bytes are to be retrieved
IOException - If some other I/O error occurs
TODO Implement this java.nio.channels.WritableByteChannel method
public int read(ByteBuffer dst)
throws IOException
read in interface ReadableByteChanneldst - The buffer into which bytes are to be transferred
IOException - If some other I/O error occurs
TODO Implement this java.nio.channels.ReadableByteChannel methodpublic Object getAttachment(boolean remove)
public SecureNioChannel.ApplicationBufferHandler getBufHandler()
public NioEndpoint.Poller getPoller()
public SocketChannel getIOChannel()
public boolean isClosing()
public boolean isHandshakeComplete()
public int handshake(boolean read,
boolean write)
throws IOException
IOExceptionpublic void setPoller(NioEndpoint.Poller poller)
public void setIOChannel(SocketChannel IOChannel)
public String toString()
toString in class Objectpublic int getOutboundRemaining()
public boolean flushOutbound()
throws IOException
IOExceptionpublic boolean isSendFile()
public void setSendFile(boolean s)
|
Apache Tomcat 7.0.28 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||