public class Nio2Channel
extends java.lang.Object
implements java.nio.channels.AsynchronousByteChannel
| Modifier and Type | Field and Description |
|---|---|
protected SecureNio2Channel.ApplicationBufferHandler |
bufHandler |
protected static java.nio.ByteBuffer |
emptyBuf |
protected java.nio.channels.AsynchronousSocketChannel |
sc |
protected SocketWrapper<Nio2Channel> |
socket |
| Constructor and Description |
|---|
Nio2Channel(SecureNio2Channel.ApplicationBufferHandler bufHandler) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this channel.
|
void |
close(boolean force) |
java.util.concurrent.Future<java.lang.Boolean> |
flush() |
int |
getBufferSize() |
SecureNio2Channel.ApplicationBufferHandler |
getBufHandler() |
java.nio.channels.AsynchronousSocketChannel |
getIOChannel() |
SocketWrapper<Nio2Channel> |
getSocket() |
int |
handshake()
Performs SSL handshake hence is a no-op for the non-secure
implementation.
|
boolean |
isClosing() |
boolean |
isHandshakeComplete() |
boolean |
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 dst,
A attachment,
java.nio.channels.CompletionHandler<java.lang.Integer,? 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,
SocketWrapper<Nio2Channel> socket)
Reset the channel
|
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,
A attachment,
java.nio.channels.CompletionHandler<java.lang.Integer,? 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) |
protected static java.nio.ByteBuffer emptyBuf
protected java.nio.channels.AsynchronousSocketChannel sc
protected SocketWrapper<Nio2Channel> socket
protected SecureNio2Channel.ApplicationBufferHandler bufHandler
public Nio2Channel(SecureNio2Channel.ApplicationBufferHandler bufHandler)
public void reset(java.nio.channels.AsynchronousSocketChannel channel,
SocketWrapper<Nio2Channel> socket)
throws java.io.IOException
java.io.IOException - If a problem was encountered resetting the channelpublic SocketWrapper<Nio2Channel> getSocket()
public int getBufferSize()
public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in interface java.nio.channels.AsynchronousChannelclose in interface java.nio.channels.Channeljava.io.IOException - If an I/O error occurspublic void close(boolean force)
throws java.io.IOException
java.io.IOExceptionpublic boolean isOpen()
isOpen in interface java.nio.channels.Channelpublic SecureNio2Channel.ApplicationBufferHandler getBufHandler()
public java.nio.channels.AsynchronousSocketChannel getIOChannel()
public boolean isClosing()
public boolean isHandshakeComplete()
public int handshake()
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.util.concurrent.Future<java.lang.Integer> read(java.nio.ByteBuffer dst)
read in interface java.nio.channels.AsynchronousByteChannelpublic <A> void read(java.nio.ByteBuffer dst,
A attachment,
java.nio.channels.CompletionHandler<java.lang.Integer,? super A> handler)
read in interface java.nio.channels.AsynchronousByteChannelpublic <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)
public java.util.concurrent.Future<java.lang.Integer> write(java.nio.ByteBuffer src)
write in interface java.nio.channels.AsynchronousByteChannelpublic <A> void write(java.nio.ByteBuffer src,
A attachment,
java.nio.channels.CompletionHandler<java.lang.Integer,? super A> handler)
write in interface java.nio.channels.AsynchronousByteChannelpublic <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)
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)
public java.util.concurrent.Future<java.lang.Boolean> flush()
Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.