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, socketWrapper
-
-
Constructor Summary
Constructors Constructor Description ClosedNio2Channel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes this channel.void
free()
Free the channel memoryboolean
isOpen()
Tells whether or not this channel is open.java.util.concurrent.Future<java.lang.Integer>
read(java.nio.ByteBuffer dst)
<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)
<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)
void
reset(java.nio.channels.AsynchronousSocketChannel channel, SocketWrapperBase<Nio2Channel> socket)
Reset the channel.void
setAppReadBufHandler(ApplicationBufferHandler handler)
java.lang.String
toString()
java.util.concurrent.Future<java.lang.Integer>
write(java.nio.ByteBuffer src)
<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)
<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)
-
Methods inherited from class org.apache.tomcat.util.net.Nio2Channel
close, flush, getAppReadBufHandler, getBufHandler, getIOChannel, handshake, isClosing, isHandshakeComplete, read, write
-
-
-
-
Method Detail
-
close
public void close() throws java.io.IOException
Description copied from class:Nio2Channel
Closes this channel.- Specified by:
close
in interfacejava.nio.channels.AsynchronousChannel
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.nio.channels.Channel
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in classNio2Channel
- Throws:
java.io.IOException
- If an I/O error occurs
-
isOpen
public boolean isOpen()
Description copied from class:Nio2Channel
Tells whether or not this channel is open.- Specified by:
isOpen
in interfacejava.nio.channels.Channel
- Overrides:
isOpen
in 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.IOException
Description copied from class:Nio2Channel
Reset the channel.- Overrides:
reset
in 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:Nio2Channel
Free the channel memory- Overrides:
free
in classNio2Channel
-
setAppReadBufHandler
public void setAppReadBufHandler(ApplicationBufferHandler handler)
- Overrides:
setAppReadBufHandler
in classNio2Channel
-
read
public java.util.concurrent.Future<java.lang.Integer> read(java.nio.ByteBuffer dst)
- Specified by:
read
in interfacejava.nio.channels.AsynchronousByteChannel
- Overrides:
read
in 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:
read
in 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:
read
in classNio2Channel
-
write
public java.util.concurrent.Future<java.lang.Integer> write(java.nio.ByteBuffer src)
- Specified by:
write
in interfacejava.nio.channels.AsynchronousByteChannel
- Overrides:
write
in 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:
write
in 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:
write
in classNio2Channel
-
toString
public java.lang.String toString()
- Overrides:
toString
in classNio2Channel
-
-