Skip navigation links
com.tangosol.net
Class WrapperSocketChannel
java.lang.Object
java.nio.channels.spi.AbstractInterruptibleChannel
java.nio.channels.SelectableChannel
java.nio.channels.spi.AbstractSelectableChannel
java.nio.channels.SocketChannel
com.tangosol.net.WrapperSocketChannel
- All Implemented Interfaces:
- WrapperSelector.WrapperSelectableChannel, Closeable, ByteChannel, Channel, GatheringByteChannel, InterruptibleChannel, ReadableByteChannel, ScatteringByteChannel, WritableByteChannel
-
public class WrapperSocketChannel
- extends SocketChannel
- implements WrapperSelector.WrapperSelectableChannel
Wrapper SocketChannel implementation that delegates all operations to a delegate SocketChannel.
- Author:
- mf 2010.05.19
m_delegate
protected SocketChannel m_delegate
- The delegate SocketChannel.
m_socket
protected Socket m_socket
- The associated WrapperSocket.
WrapperSocketChannel
public WrapperSocketChannel(SocketChannel channel,
SelectorProvider provider)
wrapSocket
protected Socket wrapSocket(Socket socket)
- Produce a wrapper around the specified socket.
-
- Parameters:
socket
- the socket to wrap
- Returns:
- the wrapper socket
open
public static SocketChannel open()
- Unsupported.
-
- Returns:
- never
- Throws:
UnsupportedOperationException
socket
public Socket socket()
-
- Specified by:
socket
in class SocketChannel
isConnected
public boolean isConnected()
-
- Specified by:
isConnected
in class SocketChannel
isConnectionPending
public boolean isConnectionPending()
-
- Specified by:
isConnectionPending
in class SocketChannel
connect
public boolean connect(SocketAddress remote)
throws IOException
-
- Specified by:
connect
in class SocketChannel
-
- Throws:
IOException
finishConnect
public boolean finishConnect()
throws IOException
-
- Specified by:
finishConnect
in class SocketChannel
-
- Throws:
IOException
read
public int read(ByteBuffer dst)
throws IOException
-
- Specified by:
read
in interface ReadableByteChannel
- Specified by:
read
in class SocketChannel
-
- Throws:
IOException
read
public long read(ByteBuffer[] dsts,
int offset,
int length)
throws IOException
-
- Specified by:
read
in interface ScatteringByteChannel
- Specified by:
read
in class SocketChannel
-
- Throws:
IOException
write
public int write(ByteBuffer src)
throws IOException
-
- Specified by:
write
in interface WritableByteChannel
- Specified by:
write
in class SocketChannel
-
- Throws:
IOException
write
public long write(ByteBuffer[] srcs,
int offset,
int length)
throws IOException
-
- Specified by:
write
in interface GatheringByteChannel
- Specified by:
write
in class SocketChannel
-
- Throws:
IOException
implCloseSelectableChannel
protected void implCloseSelectableChannel()
throws IOException
-
- Specified by:
implCloseSelectableChannel
in class AbstractSelectableChannel
-
- Throws:
IOException
implConfigureBlocking
protected void implConfigureBlocking(boolean block)
throws IOException
-
- Specified by:
implConfigureBlocking
in class AbstractSelectableChannel
-
- Throws:
IOException
registerInternal
public WrapperSelector.WrapperSelectionKey registerInternal(WrapperSelector selector,
int ops,
Object att)
throws IOException
- Register with the specified selector.
-
- Specified by:
registerInternal
in interface WrapperSelector.WrapperSelectableChannel
-
- Parameters:
selector
- the selector to register with
ops
- the operations of interest
att
- the attachment
- Returns:
- the wrapper selection key
- Throws:
IOException
- if an I/O error occurs
Skip navigation links
Copyright © 2000, 2010, Oracle and/or its affiliates. All rights reserved.