XNIO API 3.0.4.GA

org.xnio.ssl
Class JsseXnioSsl

java.lang.Object
  extended by org.xnio.ssl.XnioSsl
      extended by org.xnio.ssl.JsseXnioSsl

public final class JsseXnioSsl
extends XnioSsl

An XNIO SSL provider based on JSSE. Works with any XNIO provider.

Author:
David M. Lloyd

Field Summary
 
Fields inherited from class org.xnio.ssl.XnioSsl
xnio
 
Constructor Summary
JsseXnioSsl(Xnio xnio, OptionMap optionMap)
          Construct a new instance.
JsseXnioSsl(Xnio xnio, OptionMap optionMap, SSLContext sslContext)
          Construct a new instance.
 
Method Summary
 IoFuture<ConnectedSslStreamChannel> connectSsl(XnioWorker worker, InetSocketAddress destination, ChannelListener<? super ConnectedSslStreamChannel> openListener, ChannelListener<? super BoundChannel> bindListener, OptionMap optionMap)
          Create an SSL connection to a remote host.
 IoFuture<ConnectedSslStreamChannel> connectSsl(XnioWorker worker, InetSocketAddress destination, ChannelListener<? super ConnectedSslStreamChannel> openListener, OptionMap optionMap)
          Create an SSL connection to a remote host.
 IoFuture<ConnectedSslStreamChannel> connectSsl(XnioWorker worker, InetSocketAddress bindAddress, InetSocketAddress destination, ChannelListener<? super ConnectedSslStreamChannel> openListener, ChannelListener<? super BoundChannel> bindListener, OptionMap optionMap)
          Create an SSL connection to a remote host.
 IoFuture<ConnectedSslStreamChannel> connectSsl(XnioWorker worker, InetSocketAddress bindAddress, InetSocketAddress destination, ChannelListener<? super ConnectedSslStreamChannel> openListener, OptionMap optionMap)
          Create an SSL connection to a remote host.
 AcceptingChannel<ConnectedSslStreamChannel> createSslTcpServer(XnioWorker worker, InetSocketAddress bindAddress, ChannelListener<? super AcceptingChannel<ConnectedSslStreamChannel>> acceptListener, OptionMap optionMap)
          Create a bound TCP SSL server.
 SSLContext getSslContext()
          Get the JSSE SSL context for this provider instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JsseXnioSsl

public JsseXnioSsl(Xnio xnio,
                   OptionMap optionMap)
            throws NoSuchProviderException,
                   NoSuchAlgorithmException,
                   KeyManagementException
Construct a new instance.

Parameters:
xnio - the XNIO instance to associate with
optionMap - the options for this provider
Throws:
NoSuchProviderException - if the given SSL provider is not found
NoSuchAlgorithmException - if the given SSL algorithm is not supported
KeyManagementException - if the SSL context could not be initialized

JsseXnioSsl

public JsseXnioSsl(Xnio xnio,
                   OptionMap optionMap,
                   SSLContext sslContext)
Construct a new instance.

Parameters:
xnio - the XNIO instance to associate with
optionMap - the options for this provider
sslContext - the SSL context to use for this instance
Method Detail

getSslContext

public SSLContext getSslContext()
Get the JSSE SSL context for this provider instance.

Returns:
the SSL context

connectSsl

public IoFuture<ConnectedSslStreamChannel> connectSsl(XnioWorker worker,
                                                      InetSocketAddress destination,
                                                      ChannelListener<? super ConnectedSslStreamChannel> openListener,
                                                      OptionMap optionMap)
Description copied from class: XnioSsl
Create an SSL connection to a remote host.

Specified by:
connectSsl in class XnioSsl
Parameters:
worker - the worker to use
destination - the destination connection address
openListener - the initial open-connection listener
optionMap - the option map
Returns:
the SSL connection

connectSsl

public IoFuture<ConnectedSslStreamChannel> connectSsl(XnioWorker worker,
                                                      InetSocketAddress destination,
                                                      ChannelListener<? super ConnectedSslStreamChannel> openListener,
                                                      ChannelListener<? super BoundChannel> bindListener,
                                                      OptionMap optionMap)
Description copied from class: XnioSsl
Create an SSL connection to a remote host.

Specified by:
connectSsl in class XnioSsl
Parameters:
worker - the worker to use
destination - the destination connection address
openListener - the initial open-connection listener
bindListener - the bind listener
optionMap - the option map
Returns:
the SSL connection

connectSsl

public IoFuture<ConnectedSslStreamChannel> connectSsl(XnioWorker worker,
                                                      InetSocketAddress bindAddress,
                                                      InetSocketAddress destination,
                                                      ChannelListener<? super ConnectedSslStreamChannel> openListener,
                                                      OptionMap optionMap)
Description copied from class: XnioSsl
Create an SSL connection to a remote host.

Specified by:
connectSsl in class XnioSsl
Parameters:
worker - the worker to use
bindAddress - the local bind address
destination - the destination connection address
openListener - the initial open-connection listener
optionMap - the option map
Returns:
the SSL connection

connectSsl

public IoFuture<ConnectedSslStreamChannel> connectSsl(XnioWorker worker,
                                                      InetSocketAddress bindAddress,
                                                      InetSocketAddress destination,
                                                      ChannelListener<? super ConnectedSslStreamChannel> openListener,
                                                      ChannelListener<? super BoundChannel> bindListener,
                                                      OptionMap optionMap)
Description copied from class: XnioSsl
Create an SSL connection to a remote host.

Specified by:
connectSsl in class XnioSsl
Parameters:
worker - the worker to use
bindAddress - the local bind address
destination - the destination connection address
openListener - the initial open-connection listener
bindListener - the bind listener
optionMap - the option map
Returns:
the SSL connection

createSslTcpServer

public AcceptingChannel<ConnectedSslStreamChannel> createSslTcpServer(XnioWorker worker,
                                                                      InetSocketAddress bindAddress,
                                                                      ChannelListener<? super AcceptingChannel<ConnectedSslStreamChannel>> acceptListener,
                                                                      OptionMap optionMap)
                                                               throws IOException
Description copied from class: XnioSsl
Create a bound TCP SSL server. The given executor will be used to execute SSL tasks.

Specified by:
createSslTcpServer in class XnioSsl
Parameters:
worker - the worker to use
bindAddress - the address to bind to
acceptListener - the initial accept listener
optionMap - the initial configuration for the server
Returns:
the unbound TCP SSL server
Throws:
IOException - if the server could not be created

XNIO API 3.0.4.GA

Copyright © 2010 JBoss, a division of Red Hat, Inc.