Top Description Fields Constructors Methods
org.xnio.ssl

public final Class JsseXnioSsl

extends XnioSsl
Class Inheritance
Static Imports
java.security.AccessController.doPrivileged, org.xnio.IoUtils.safeClose, org.xnio._private.Messages.msg

An XNIO SSL provider based on JSSE. Works with any XNIO provider.
Authors
David M. Lloyd, Flavia Rainone

Field Summary

Modifier and TypeField and Description
pack-priv static final Pool<ByteBuffer>
bufferPool

References Deprecated Pool is deprecated or references (maybe indirectly) at least one deprecated element.
public static final boolean
private final SSLContext
Inherited from org.xnio.ssl.XnioSsl:
xnio

Constructor Summary

AccessConstructor and Description
public
JsseXnioSsl(final Xnio
the XNIO instance to associate with
xnio
,
final OptionMap
the options for this provider
optionMap
)

Construct a new instance.

public
JsseXnioSsl(final Xnio
the XNIO instance to associate with
xnio
,
final OptionMap
the options for this provider
optionMap
,
final SSLContext
the SSL context to use for this instance
sslContext
)

Construct a new instance.

Method Summary

Modifier and TypeMethod and Description
public IoFuture<ConnectedSslStreamChannel>
connectSsl(final XnioWorker
the worker to use
worker
,
final InetSocketAddress
the local bind address
bindAddress
,
final InetSocketAddress
the destination connection address
destination
,
final ChannelListener<? super ConnectedSslStreamChannel>
the initial open-connection listener
openListener
,
final ChannelListener<? super BoundChannel>
the bind listener
bindListener
,
final OptionMap
the option map
optionMap
)

Implements abstract org.xnio.ssl.XnioSsl.connectSsl.

Create an SSL connection to a remote host.

public AcceptingChannel<SslConnection>
createSslConnectionServer(final XnioWorker
the worker to use
worker
,
final InetSocketAddress
the address to bind to
bindAddress
,
final ChannelListener<? super AcceptingChannel<SslConnection>>
the initial accept listener
acceptListener
,
final OptionMap
the initial configuration for the server
optionMap
)

Implements abstract org.xnio.ssl.XnioSsl.createSslConnectionServer.

Create a bound TCP SSL server.

public AcceptingChannel<ConnectedSslStreamChannel>
createSslTcpServer(final XnioWorker
the worker to use
worker
,
final InetSocketAddress
the address to bind to
bindAddress
,
final ChannelListener<? super AcceptingChannel<ConnectedSslStreamChannel>>
the initial accept listener
acceptListener
,
final OptionMap
the initial configuration for the server
optionMap
)

Implements abstract org.xnio.ssl.XnioSsl.createSslTcpServer.

Create a bound TCP SSL server.

public SSLContext

Returns:

the SSL context
getSslContext
()

Get the JSSE SSL context for this provider instance.

public static SSLEngine

Returns:

the SSL engine
getSslEngine
(SslConnection connection)

Get the SSL engine for a given connection.

public IoFuture<SslConnection>
openSslConnection(final XnioWorker
the worker to use
worker
,
final InetSocketAddress
the local bind address
bindAddress
,
final InetSocketAddress
the destination connection address
destination
,
final ChannelListener<? super SslConnection>
the initial open-connection listener
openListener
,
final ChannelListener<? super BoundChannel>
the bind listener
bindListener
,
final OptionMap
the option map
optionMap
)

Implements abstract org.xnio.ssl.XnioSsl.openSslConnection.

Create an SSL connection to a remote host.

public IoFuture<SslConnection>
openSslConnection(final XnioIoThread
the IO Thread to use
ioThread
,
final InetSocketAddress
the local bind address
bindAddress
,
final InetSocketAddress
the destination connection address
destination
,
final ChannelListener<? super SslConnection>
the initial open-connection listener
openListener
,
final ChannelListener<? super BoundChannel>
the bind listener
bindListener
,
final OptionMap
the option map
optionMap
)

Implements abstract org.xnio.ssl.XnioSsl.openSslConnection.

Create an SSL connection to a remote host.

Inherited from org.xnio.ssl.XnioSsl:
connectSslconnectSslconnectSslopenSslConnectionopenSslConnectionopenSslConnectionopenSslConnectionopenSslConnectionopenSslConnection

Field Detail

bufferPoolback to summary
pack-priv static final Pool<ByteBuffer> bufferPool

References Deprecated

Pool is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

NEW_IMPLback to summary
public static final boolean NEW_IMPL
sslContextback to summary
private final SSLContext sslContext

Hides org.xnio.ssl.XnioSsl.sslContext.

Constructor Detail

JsseXnioSslback to summary
public JsseXnioSsl(final Xnio xnio, final OptionMap optionMap) throws NoSuchProviderException, NoSuchAlgorithmException, KeyManagementException

Construct a new instance.

Parameters
xnio:Xnio

the XNIO instance to associate with

optionMap:OptionMap

the options for this provider

Exceptions
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
JsseXnioSslback to summary
public JsseXnioSsl(final Xnio xnio, final OptionMap optionMap, final SSLContext sslContext)

Construct a new instance.

Parameters
xnio:Xnio

the XNIO instance to associate with

optionMap:OptionMap

the options for this provider

sslContext:SSLContext

the SSL context to use for this instance

Method Detail

connectSslback to summary
public IoFuture<ConnectedSslStreamChannel> connectSsl(final XnioWorker worker, final InetSocketAddress bindAddress, final InetSocketAddress destination, final ChannelListener<? super ConnectedSslStreamChannel> openListener, final ChannelListener<? super BoundChannel> bindListener, final OptionMap optionMap)

Implements abstract org.xnio.ssl.XnioSsl.connectSsl.

Doc from org.xnio.ssl.XnioSsl.connectSsl.

Create an SSL connection to a remote host.

Parameters
worker:XnioWorker

the worker to use

bindAddress:InetSocketAddress

the local bind address

destination:InetSocketAddress

the destination connection address

openListener:ChannelListener<? super ConnectedSslStreamChannel>

the initial open-connection listener

bindListener:ChannelListener<? super BoundChannel>

the bind listener

optionMap:OptionMap

the option map

Returns:IoFuture<ConnectedSslStreamChannel>

the SSL connection

Annotations
@SuppressWarnings:deprecation
createSslConnectionServerback to summary
public AcceptingChannel<SslConnection> createSslConnectionServer(final XnioWorker worker, final InetSocketAddress bindAddress, final ChannelListener<? super AcceptingChannel<SslConnection>> acceptListener, final OptionMap optionMap) throws IOException

Implements abstract org.xnio.ssl.XnioSsl.createSslConnectionServer.

Doc from org.xnio.ssl.XnioSsl.createSslConnectionServer.

Create a bound TCP SSL server.

Parameters
worker:XnioWorker

the worker to use

bindAddress:InetSocketAddress

the address to bind to

acceptListener:ChannelListener<? super AcceptingChannel<SslConnection>>

the initial accept listener

optionMap:OptionMap

the initial configuration for the server

Returns:AcceptingChannel<SslConnection>

the unbound TCP SSL server

Exceptions
IOException:
if the server could not be created
createSslTcpServerback to summary
public AcceptingChannel<ConnectedSslStreamChannel> createSslTcpServer(final XnioWorker worker, final InetSocketAddress bindAddress, final ChannelListener<? super AcceptingChannel<ConnectedSslStreamChannel>> acceptListener, final OptionMap optionMap) throws IOException

Implements abstract org.xnio.ssl.XnioSsl.createSslTcpServer.

Doc from org.xnio.ssl.XnioSsl.createSslTcpServer.

Create a bound TCP SSL server.

Parameters
worker:XnioWorker

the worker to use

bindAddress:InetSocketAddress

the address to bind to

acceptListener:ChannelListener<? super AcceptingChannel<ConnectedSslStreamChannel>>

the initial accept listener

optionMap:OptionMap

the initial configuration for the server

Returns:AcceptingChannel<ConnectedSslStreamChannel>

the unbound TCP SSL server

Annotations
@SuppressWarnings:deprecation
Exceptions
IOException:
if the server could not be created
getSslContextback to summary
public SSLContext getSslContext()

Get the JSSE SSL context for this provider instance.

Returns:SSLContext

the SSL context

Annotations
@SuppressWarnings:unused
getSslEngineback to summary
public static SSLEngine getSslEngine(SslConnection connection)

Get the SSL engine for a given connection.

Returns:SSLEngine

the SSL engine

openSslConnectionback to summary
public IoFuture<SslConnection> openSslConnection(final XnioWorker worker, final InetSocketAddress bindAddress, final InetSocketAddress destination, final ChannelListener<? super SslConnection> openListener, final ChannelListener<? super BoundChannel> bindListener, final OptionMap optionMap)

Implements abstract org.xnio.ssl.XnioSsl.openSslConnection.

Doc from org.xnio.ssl.XnioSsl.openSslConnection.

Create an SSL connection to a remote host.

Parameters
worker:XnioWorker

the worker to use

bindAddress:InetSocketAddress

the local bind address

destination:InetSocketAddress

the destination connection address

openListener:ChannelListener<? super SslConnection>

the initial open-connection listener

bindListener:ChannelListener<? super BoundChannel>

the bind listener

optionMap:OptionMap

the option map

Returns:IoFuture<SslConnection>

the SSL connection

openSslConnectionback to summary
public IoFuture<SslConnection> openSslConnection(final XnioIoThread ioThread, final InetSocketAddress bindAddress, final InetSocketAddress destination, final ChannelListener<? super SslConnection> openListener, final ChannelListener<? super BoundChannel> bindListener, final OptionMap optionMap)

Implements abstract org.xnio.ssl.XnioSsl.openSslConnection.

Doc from org.xnio.ssl.XnioSsl.openSslConnection.

Create an SSL connection to a remote host.

Parameters
ioThread:XnioIoThread

the IO Thread to use

bindAddress:InetSocketAddress

the local bind address

destination:InetSocketAddress

the destination connection address

openListener:ChannelListener<? super SslConnection>

the initial open-connection listener

bindListener:ChannelListener<? super BoundChannel>

the bind listener

optionMap:OptionMap

the option map

Returns:IoFuture<SslConnection>

the SSL connection