Skip navigation links

Oracle® Coherence Java API Reference
Release 3.7.1.0

E22843-01


com.tangosol.net
Class WrapperSocketChannel

java.lang.Object
  extended by java.nio.channels.spi.AbstractInterruptibleChannel
      extended by java.nio.channels.SelectableChannel
          extended by java.nio.channels.spi.AbstractSelectableChannel
              extended by java.nio.channels.SocketChannel
                  extended by com.tangosol.net.WrapperSocketChannel

All Implemented Interfaces:
WrapperSelector.WrapperSelectableChannel, java.io.Closeable, java.nio.channels.ByteChannel, java.nio.channels.Channel, java.nio.channels.GatheringByteChannel, java.nio.channels.InterruptibleChannel, java.nio.channels.ReadableByteChannel, java.nio.channels.ScatteringByteChannel, java.nio.channels.WritableByteChannel

public class WrapperSocketChannel
extends java.nio.channels.SocketChannel
implements WrapperSelector.WrapperSelectableChannel

Wrapper SocketChannel implementation that delegates all operations to a delegate SocketChannel.

Author:
mf 2010.05.19

Field Summary
protected  java.nio.channels.SocketChannel m_delegate
          The delegate SocketChannel.
protected  java.net.Socket m_socket
          The associated WrapperSocket.

 

Constructor Summary
WrapperSocketChannel(java.nio.channels.SocketChannel channel, java.nio.channels.spi.SelectorProvider provider)
           

 

Method Summary
 boolean connect(java.net.SocketAddress remote)
          
 boolean finishConnect()
          
protected  void implCloseSelectableChannel()
          
protected  void implConfigureBlocking(boolean block)
          
 boolean isConnected()
          
 boolean isConnectionPending()
          
static java.nio.channels.SocketChannel open()
          Unsupported.
 int read(java.nio.ByteBuffer dst)
          
 long read(java.nio.ByteBuffer[] dsts, int offset, int length)
          
 WrapperSelector.WrapperSelectionKey registerInternal(WrapperSelector selector, int ops, java.lang.Object att)
          Register with the specified selector.
 java.net.Socket socket()
          
protected  java.net.Socket wrapSocket(java.net.Socket socket)
          Produce a wrapper around the specified socket.
 int write(java.nio.ByteBuffer src)
          
 long write(java.nio.ByteBuffer[] srcs, int offset, int length)
          

 

Methods inherited from class java.nio.channels.SocketChannel
open, read, validOps, write

 

Methods inherited from class java.nio.channels.spi.AbstractSelectableChannel
blockingLock, configureBlocking, implCloseChannel, isBlocking, isRegistered, keyFor, provider, register

 

Methods inherited from class java.nio.channels.SelectableChannel
register

 

Methods inherited from class java.nio.channels.spi.AbstractInterruptibleChannel
begin, close, end, isOpen

 

Methods inherited from interface java.nio.channels.Channel
close, isOpen

 

Field Detail

m_delegate

protected java.nio.channels.SocketChannel m_delegate
The delegate SocketChannel.

m_socket

protected java.net.Socket m_socket
The associated WrapperSocket.

Constructor Detail

WrapperSocketChannel

public WrapperSocketChannel(java.nio.channels.SocketChannel channel,
                            java.nio.channels.spi.SelectorProvider provider)

Method Detail

wrapSocket

protected java.net.Socket wrapSocket(java.net.Socket socket)
Produce a wrapper around the specified socket.
Parameters:
socket - the socket to wrap
Returns:
the wrapper socket

open

public static java.nio.channels.SocketChannel open()
Unsupported.
Returns:
never
Throws:
java.lang.UnsupportedOperationException

socket

public java.net.Socket socket()
Specified by:
socket in class java.nio.channels.SocketChannel

isConnected

public boolean isConnected()
Specified by:
isConnected in class java.nio.channels.SocketChannel

isConnectionPending

public boolean isConnectionPending()
Specified by:
isConnectionPending in class java.nio.channels.SocketChannel

connect

public boolean connect(java.net.SocketAddress remote)
                throws java.io.IOException
Specified by:
connect in class java.nio.channels.SocketChannel
Throws:
java.io.IOException

finishConnect

public boolean finishConnect()
                      throws java.io.IOException
Specified by:
finishConnect in class java.nio.channels.SocketChannel
Throws:
java.io.IOException

read

public int read(java.nio.ByteBuffer dst)
         throws java.io.IOException
Specified by:
read in interface java.nio.channels.ReadableByteChannel
Specified by:
read in class java.nio.channels.SocketChannel
Throws:
java.io.IOException

read

public long read(java.nio.ByteBuffer[] dsts,
                 int offset,
                 int length)
          throws java.io.IOException
Specified by:
read in interface java.nio.channels.ScatteringByteChannel
Specified by:
read in class java.nio.channels.SocketChannel
Throws:
java.io.IOException

write

public int write(java.nio.ByteBuffer src)
          throws java.io.IOException
Specified by:
write in interface java.nio.channels.WritableByteChannel
Specified by:
write in class java.nio.channels.SocketChannel
Throws:
java.io.IOException

write

public long write(java.nio.ByteBuffer[] srcs,
                  int offset,
                  int length)
           throws java.io.IOException
Specified by:
write in interface java.nio.channels.GatheringByteChannel
Specified by:
write in class java.nio.channels.SocketChannel
Throws:
java.io.IOException

implCloseSelectableChannel

protected void implCloseSelectableChannel()
                                   throws java.io.IOException
Specified by:
implCloseSelectableChannel in class java.nio.channels.spi.AbstractSelectableChannel
Throws:
java.io.IOException

implConfigureBlocking

protected void implConfigureBlocking(boolean block)
                              throws java.io.IOException
Specified by:
implConfigureBlocking in class java.nio.channels.spi.AbstractSelectableChannel
Throws:
java.io.IOException

registerInternal

public WrapperSelector.WrapperSelectionKey registerInternal(WrapperSelector selector,
                                                            int ops,
                                                            java.lang.Object att)
                                                     throws java.io.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:
java.io.IOException - if an I/O error occurs

Skip navigation links

Oracle® Coherence Java API Reference
Release 3.7.1.0

E22843-01


Copyright © 2000, 2011, Oracle and/or its affiliates. All rights reserved.