public interface SocketChannelWrapper extends Closeable
SocketChannel
.
The reason this class exists is because for enterprise encryption. Ideally the SocketChannel should have been decorated
with this encryption functionality, but unfortunately that isn't possible with this class.
That is why a new 'wrapper' interface is introduced which acts like a SocketChannel and the implementations wrap a
SocketChannel.
In the future we should get rid of this class and rely on ReadHandler
/WriteHandler
chaining to add encryption.
This will remove more artifacts from the architecture that can't carry their weight.Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
closeInbound()
Closes inbound.
|
void |
closeOutbound()
Closes outbound.
|
SelectableChannel |
configureBlocking(boolean block) |
boolean |
connect(SocketAddress socketAddress) |
boolean |
isBlocking() |
boolean |
isConnected() |
boolean |
isOpen() |
SelectionKey |
keyFor(Selector selector) |
int |
read(ByteBuffer dst) |
SelectionKey |
register(Selector selector,
int ops,
Object attachment) |
Socket |
socket() |
int |
write(ByteBuffer src) |
boolean isBlocking()
Socket socket()
SocketChannel.socket()
boolean isConnected()
()
boolean connect(SocketAddress socketAddress) throws IOException
IOException
SocketChannel.connect(java.net.SocketAddress)
SelectionKey keyFor(Selector selector)
SelectionKey register(Selector selector, int ops, Object attachment) throws ClosedChannelException
int read(ByteBuffer dst) throws IOException
IOException
SocketChannel.read(ByteBuffer)
int write(ByteBuffer src) throws IOException
IOException
SocketChannel.write(ByteBuffer)
SelectableChannel configureBlocking(boolean block) throws IOException
IOException
AbstractSelectableChannel.configureBlocking(boolean)
boolean isOpen()
void closeInbound() throws IOException
Not thread safe. Should be called in channel reader thread.
IOException
void closeOutbound() throws IOException
Not thread safe. Should be called in channel writer thread.
IOException
void close() throws IOException
close
in interface AutoCloseable
close
in interface Closeable
IOException
AbstractInterruptibleChannel.close()
Copyright © 2016 Hazelcast, Inc.. All Rights Reserved.