com.sas.iom.orb
Class SSLSocketChannel

com.sas.iom.orb.SSLSocketChannel
All Implemented Interfaces:
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 final class SSLSocketChannel

SocketChannel implementation that encloses all transmitted data in an SSL envelope. This is not a complete SSL implementation of a java.nio.channels provider. It is just a wrapper around SocketChannel. It cannot be registered with a selector. The wrapped channel should be registered instead.


Constructor Summary
protected SSLSocketChannel(java.nio.channels.spi.SelectorProvider provider)
           
 
Method Summary
 boolean connect(java.net.SocketAddress remote)
           
static SSLSocketChannel createSocketChannel(java.nio.channels.SocketChannel channel, java.lang.String host, int port, boolean close)
           
 boolean finishConnect()
           
 java.nio.channels.SocketChannel getSelectableChannel()
           
 boolean hasRemaining()
           
protected  void implCloseSelectableChannel()
           
protected  void implConfigureBlocking(boolean block)
           
 boolean isConnected()
           
 boolean isConnectionPending()
           
 int read(java.nio.ByteBuffer dst)
           
 long read(java.nio.ByteBuffer[] dsts, int offset, int length)
           
protected  void setChannel(java.nio.channels.SocketChannel channel)
          This method has protected access instead of private access only to facilitate unit testing.
 java.net.Socket socket()
           
 int write(java.nio.ByteBuffer src)
           
 long write(java.nio.ByteBuffer[] srcs, int offset, int length)
           
 

Constructor Detail

SSLSocketChannel

protected SSLSocketChannel(java.nio.channels.spi.SelectorProvider provider)
Method Detail

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

getSelectableChannel

public java.nio.channels.SocketChannel getSelectableChannel()

hasRemaining

public boolean hasRemaining()

createSocketChannel

public static SSLSocketChannel createSocketChannel(java.nio.channels.SocketChannel channel,
                                                   java.lang.String host,
                                                   int port,
                                                   boolean close)
                                            throws java.io.IOException
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

setChannel

protected void setChannel(java.nio.channels.SocketChannel channel)
This method has protected access instead of private access only to facilitate unit testing. It should not be called outside this class in production code.

Parameters:
channel - the underlying channel



Copyright © 2009 SAS Institute Inc. All Rights Reserved.