|
Apache Tomcat 6.0.35 | ||||||||
| 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 java.nio.ByteBuffer |
emptyBuf
|
protected NioEndpoint.Poller |
poller
|
protected java.nio.channels.SocketChannel |
sc
|
protected boolean |
sendFile
|
| Constructor Summary | |
|---|---|
NioChannel(java.nio.channels.SocketChannel channel,
SecureNioChannel.ApplicationBufferHandler bufHandler)
|
|
| Method Summary | |
|---|---|
void |
close()
Closes this channel. |
void |
close(boolean force)
|
boolean |
flush(boolean block,
java.nio.channels.Selector s,
long timeout,
MutableInteger lastWrite)
returns true if the network buffer has been flushed out and is empty |
boolean |
flushOutbound()
Return true if the buffer wrote data |
java.lang.Object |
getAttachment(boolean remove)
|
int |
getBufferSize()
|
SecureNioChannel.ApplicationBufferHandler |
getBufHandler()
getBufHandler |
java.nio.channels.SocketChannel |
getIOChannel()
getIOChannel |
int |
getOutboundRemaining()
|
NioEndpoint.Poller |
getPoller()
|
int |
handshake(boolean read,
boolean write)
|
boolean |
isClosing()
isClosing |
boolean |
isInitHandshakeComplete()
isInitHandshakeComplete |
boolean |
isOpen()
Tells whether or not this channel is open. |
boolean |
isSendFile()
|
int |
read(java.nio.ByteBuffer dst)
Reads a sequence of bytes from this channel into the given buffer. |
void |
reset()
|
void |
setIOChannel(java.nio.channels.SocketChannel IOChannel)
|
void |
setPoller(NioEndpoint.Poller poller)
|
void |
setSendFile(boolean s)
|
java.lang.String |
toString()
|
int |
write(java.nio.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 java.nio.ByteBuffer emptyBuf
protected java.nio.channels.SocketChannel sc
protected SecureNioChannel.ApplicationBufferHandler bufHandler
protected NioEndpoint.Poller poller
protected boolean sendFile
| Constructor Detail |
|---|
public NioChannel(java.nio.channels.SocketChannel channel,
SecureNioChannel.ApplicationBufferHandler bufHandler)
throws java.io.IOException
java.io.IOException| Method Detail |
|---|
public void reset()
throws java.io.IOException
java.io.IOExceptionpublic int getBufferSize()
public boolean flush(boolean block,
java.nio.channels.Selector s,
long timeout,
MutableInteger lastWrite)
throws java.io.IOException
java.io.IOException
public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.nio.channels.Channeljava.io.IOException - If an I/O error occurs
public void close(boolean force)
throws java.io.IOException
java.io.IOExceptionpublic boolean isOpen()
isOpen in interface java.nio.channels.Channel
public int write(java.nio.ByteBuffer src)
throws java.io.IOException
write in interface java.nio.channels.WritableByteChannelsrc - The buffer from which bytes are to be retrieved
java.io.IOException - If some other I/O error occurs
public int read(java.nio.ByteBuffer dst)
throws java.io.IOException
read in interface java.nio.channels.ReadableByteChanneldst - The buffer into which bytes are to be transferred
java.io.IOException - If some other I/O error occurspublic java.lang.Object getAttachment(boolean remove)
public SecureNioChannel.ApplicationBufferHandler getBufHandler()
public NioEndpoint.Poller getPoller()
public java.nio.channels.SocketChannel getIOChannel()
public boolean isClosing()
public boolean isInitHandshakeComplete()
public int handshake(boolean read,
boolean write)
throws java.io.IOException
java.io.IOExceptionpublic void setPoller(NioEndpoint.Poller poller)
public void setIOChannel(java.nio.channels.SocketChannel IOChannel)
public java.lang.String toString()
toString in class java.lang.Objectpublic int getOutboundRemaining()
public boolean flushOutbound()
throws java.io.IOException
java.io.IOExceptionpublic boolean isSendFile()
public void setSendFile(boolean s)
|
Apache Tomcat 6.0.35 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||