Package org.apache.tomcat.util.net
Class Nio2Channel.ClosedNio2Channel
- java.lang.Object
-
- org.apache.tomcat.util.net.Nio2Channel
-
- org.apache.tomcat.util.net.Nio2Channel.ClosedNio2Channel
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,java.nio.channels.AsynchronousByteChannel,java.nio.channels.AsynchronousChannel,java.nio.channels.Channel
- Enclosing class:
- Nio2Channel
public static class Nio2Channel.ClosedNio2Channel extends Nio2Channel
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.tomcat.util.net.Nio2Channel
Nio2Channel.ClosedNio2Channel
-
-
Field Summary
-
Fields inherited from class org.apache.tomcat.util.net.Nio2Channel
bufHandler, emptyBuf, sc, socket
-
-
Constructor Summary
Constructors Constructor Description ClosedNio2Channel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes this channel.voidfree()Free the channel memorybooleanisOpen()Tells whether or not this channel is open.java.util.concurrent.Future<java.lang.Integer>read(java.nio.ByteBuffer dst)<A> voidread(java.nio.ByteBuffer[] dsts, int offset, int length, long timeout, java.util.concurrent.TimeUnit unit, A attachment, java.nio.channels.CompletionHandler<java.lang.Long,? super A> handler)<A> voidread(java.nio.ByteBuffer dst, long timeout, java.util.concurrent.TimeUnit unit, A attachment, java.nio.channels.CompletionHandler<java.lang.Integer,? super A> handler)voidreset(java.nio.channels.AsynchronousSocketChannel channel, SocketWrapperBase<Nio2Channel> socket)Reset the channel.voidsetAppReadBufHandler(ApplicationBufferHandler handler)java.lang.StringtoString()java.util.concurrent.Future<java.lang.Integer>write(java.nio.ByteBuffer src)<A> voidwrite(java.nio.ByteBuffer[] srcs, int offset, int length, long timeout, java.util.concurrent.TimeUnit unit, A attachment, java.nio.channels.CompletionHandler<java.lang.Long,? super A> handler)<A> voidwrite(java.nio.ByteBuffer src, long timeout, java.util.concurrent.TimeUnit unit, A attachment, java.nio.channels.CompletionHandler<java.lang.Integer,? super A> handler)-
Methods inherited from class org.apache.tomcat.util.net.Nio2Channel
close, flush, getAppReadBufHandler, getBufHandler, getIOChannel, getSocket, handshake, isClosing, isHandshakeComplete, read, write
-
-
-
-
Method Detail
-
close
public void close() throws java.io.IOExceptionDescription copied from class:Nio2ChannelCloses this channel.- Specified by:
closein interfacejava.nio.channels.AsynchronousChannel- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.nio.channels.Channel- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classNio2Channel- Throws:
java.io.IOException- If an I/O error occurs
-
isOpen
public boolean isOpen()
Description copied from class:Nio2ChannelTells whether or not this channel is open.- Specified by:
isOpenin interfacejava.nio.channels.Channel- Overrides:
isOpenin classNio2Channel- Returns:
- true if, and only if, this channel is open
-
reset
public void reset(java.nio.channels.AsynchronousSocketChannel channel, SocketWrapperBase<Nio2Channel> socket) throws java.io.IOExceptionDescription copied from class:Nio2ChannelReset the channel.- Overrides:
resetin classNio2Channel- Parameters:
channel- The new async channel to associate with this NIO2 channelsocket- The new socket to associate with this NIO2 channel- Throws:
java.io.IOException- If a problem was encountered resetting the channel
-
free
public void free()
Description copied from class:Nio2ChannelFree the channel memory- Overrides:
freein classNio2Channel
-
setAppReadBufHandler
public void setAppReadBufHandler(ApplicationBufferHandler handler)
- Overrides:
setAppReadBufHandlerin classNio2Channel
-
read
public java.util.concurrent.Future<java.lang.Integer> read(java.nio.ByteBuffer dst)
- Specified by:
readin interfacejava.nio.channels.AsynchronousByteChannel- Overrides:
readin classNio2Channel
-
read
public <A> void read(java.nio.ByteBuffer dst, long timeout, java.util.concurrent.TimeUnit unit, A attachment, java.nio.channels.CompletionHandler<java.lang.Integer,? super A> handler)- Overrides:
readin classNio2Channel
-
read
public <A> void read(java.nio.ByteBuffer[] dsts, int offset, int length, long timeout, java.util.concurrent.TimeUnit unit, A attachment, java.nio.channels.CompletionHandler<java.lang.Long,? super A> handler)- Overrides:
readin classNio2Channel
-
write
public java.util.concurrent.Future<java.lang.Integer> write(java.nio.ByteBuffer src)
- Specified by:
writein interfacejava.nio.channels.AsynchronousByteChannel- Overrides:
writein classNio2Channel
-
write
public <A> void write(java.nio.ByteBuffer src, long timeout, java.util.concurrent.TimeUnit unit, A attachment, java.nio.channels.CompletionHandler<java.lang.Integer,? super A> handler)- Overrides:
writein classNio2Channel
-
write
public <A> void write(java.nio.ByteBuffer[] srcs, int offset, int length, long timeout, java.util.concurrent.TimeUnit unit, A attachment, java.nio.channels.CompletionHandler<java.lang.Long,? super A> handler)- Overrides:
writein classNio2Channel
-
toString
public java.lang.String toString()
- Overrides:
toStringin classNio2Channel
-
-