com.hazelcast.nio.tcp
Class DefaultSocketChannelWrapper
java.lang.Object
com.hazelcast.nio.tcp.DefaultSocketChannelWrapper
- All Implemented Interfaces:
- SocketChannelWrapper, Closeable
public class DefaultSocketChannelWrapper
- extends Object
- implements SocketChannelWrapper
socketChannel
protected final SocketChannel socketChannel
DefaultSocketChannelWrapper
public DefaultSocketChannelWrapper(SocketChannel socketChannel)
isBlocking
public boolean isBlocking()
- Specified by:
isBlocking
in interface SocketChannelWrapper
socket
public Socket socket()
- Specified by:
socket
in interface SocketChannelWrapper
isConnected
public boolean isConnected()
- Specified by:
isConnected
in interface SocketChannelWrapper
connect
public boolean connect(SocketAddress socketAddress)
throws IOException
- Specified by:
connect
in interface SocketChannelWrapper
- Throws:
IOException
read
public int read(ByteBuffer byteBuffer)
throws IOException
- Specified by:
read
in interface SocketChannelWrapper
- Throws:
IOException
write
public int write(ByteBuffer byteBuffer)
throws IOException
- Specified by:
write
in interface SocketChannelWrapper
- Throws:
IOException
configureBlocking
public SelectableChannel configureBlocking(boolean b)
throws IOException
- Specified by:
configureBlocking
in interface SocketChannelWrapper
- Throws:
IOException
isOpen
public boolean isOpen()
- Specified by:
isOpen
in interface SocketChannelWrapper
closeInbound
public void closeInbound()
throws IOException
- Description copied from interface:
SocketChannelWrapper
- Closes inbound.
Not thread safe. Should be called in channel reader thread.
- Specified by:
closeInbound
in interface SocketChannelWrapper
- Throws:
IOException
closeOutbound
public void closeOutbound()
throws IOException
- Description copied from interface:
SocketChannelWrapper
- Closes outbound.
Not thread safe. Should be called in channel writer thread.
- Specified by:
closeOutbound
in interface SocketChannelWrapper
- Throws:
IOException
close
public void close()
throws IOException
- Description copied from interface:
SocketChannelWrapper
- Closes socket channel.
- Specified by:
close
in interface SocketChannelWrapper
- Specified by:
close
in interface Closeable
- Throws:
IOException
keyFor
public SelectionKey keyFor(Selector selector)
- Specified by:
keyFor
in interface SocketChannelWrapper
register
public SelectionKey register(Selector selector,
int ops,
Object attachment)
throws ClosedChannelException
- Specified by:
register
in interface SocketChannelWrapper
- Throws:
ClosedChannelException
toString
public String toString()
- Overrides:
toString
in class Object
Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.