XNIO API 2.1.0.CR2

org.jboss.xnio
Class Xnio

java.lang.Object
  extended by org.jboss.xnio.Xnio
All Implemented Interfaces:
Closeable

public abstract class Xnio
extends Object
implements Closeable

The XNIO entry point class.


Constructor Summary
protected Xnio(XnioConfiguration configuration)
          Construct an XNIO provider instance.
 
Method Summary
 void awaken(Thread targetThread)
          Wake up any blocking I/O operation being carried out on a given thread.
abstract  void close()
          Close this XNIO provider.
static Xnio create()
          Create an instance of the default XNIO provider.
static Xnio create(String implName, XnioConfiguration configuration)
          Create an instance of the named XNIO provider.
static Xnio create(XnioConfiguration configuration)
          Create an instance of the default XNIO provider.
 LocalDatagramConnector createLocalDatagramConnector(Executor executor, OptionMap optionMap)
          Create a local datagram connector.
 LocalDatagramConnector createLocalDatagramConnector(OptionMap optionMap)
          Create a local datagram connector.
 LocalServer createLocalDatagramServer(ChannelListener<? super DatagramChannel<String>> openListener, OptionMap optionMap)
          Create a local datagram server.
 LocalServer createLocalDatagramServer(Executor executor, ChannelListener<? super DatagramChannel<String>> openListener, OptionMap optionMap)
          Create a local datagram server.
 LocalStreamConnector createLocalStreamConnector(Executor executor, OptionMap optionMap)
          Create a local stream connector.
 LocalStreamConnector createLocalStreamConnector(OptionMap optionMap)
          Create a local stream connector.
 LocalServer createLocalStreamServer(ChannelListener<? super ConnectedStreamChannel<String>> openListener, OptionMap optionMap)
          Create a local stream server.
 LocalServer createLocalStreamServer(Executor executor, ChannelListener<? super ConnectedStreamChannel<String>> openListener, OptionMap optionMap)
          Create a local stream server.
 SocketFactory createManagedSocketFactory(OptionMap optionMap)
          Create a managed socket factory which uses this provider's MBean configuration to track management information.
 IoFuture<? extends Closeable> createOneWayPipeConnection(ChannelListener<? super StreamSourceChannel> sourceListener, ChannelListener<? super StreamSinkChannel> sinkListener)
          Create a single one-way pipe connection.
 IoFuture<? extends Closeable> createOneWayPipeConnection(Executor executor, ChannelListener<? super StreamSourceChannel> sourceListener, ChannelListener<? super StreamSinkChannel> sinkListener)
          Create a single one-way pipe connection.
 IoFuture<? extends Closeable> createPipeConnection(ChannelListener<? super StreamChannel> leftListener, ChannelListener<? super StreamChannel> rightListener)
          Create a single pipe connection.
 IoFuture<? extends Closeable> createPipeConnection(Executor executor, ChannelListener<? super StreamChannel> leftListener, ChannelListener<? super StreamChannel> rightListener)
          Create a single pipe connection.
 ChannelSource<? extends StreamChannel> createPipeServer(ChannelListener<? super StreamChannel> openListener)
          Create a pipe "server".
 ChannelSource<? extends StreamChannel> createPipeServer(Executor executor, ChannelListener<? super StreamChannel> openListener)
          Create a pipe "server".
 ChannelSource<? extends StreamSinkChannel> createPipeSinkServer(ChannelListener<? super StreamSourceChannel> openListener)
          Create a one-way pipe "server".
 ChannelSource<? extends StreamSinkChannel> createPipeSinkServer(Executor executor, ChannelListener<? super StreamSourceChannel> openListener)
          Create a one-way pipe "server".
 ChannelSource<? extends StreamSourceChannel> createPipeSourceServer(ChannelListener<? super StreamSinkChannel> openListener)
          Create a one-way pipe "server".
 ChannelSource<? extends StreamSourceChannel> createPipeSourceServer(Executor executor, ChannelListener<? super StreamSinkChannel> openListener)
          Create a one-way pipe "server".
 ServerSocketFactory createServerSocketFactory(OptionMap optionMap)
          Create a managed server socket factory which uses this provider's MBean configuration to track management information.
 SslTcpConnector createSslTcpConnector(Executor executor, InetSocketAddress src, OptionMap optionMap)
          Create an SSL TCP connector.
 SslTcpConnector createSslTcpConnector(InetSocketAddress src, OptionMap optionMap)
          Create an SSL TCP connector.
 SslTcpConnector createSslTcpConnector(OptionMap optionMap)
          Create an SSL TCP connector.
 SslTcpServer createSslTcpServer(ChannelListener<? super SslTcpChannel> openListener, OptionMap optionMap)
          Create an unbound TCP SSL server.
 SslTcpServer createSslTcpServer(Executor executor, ChannelListener<? super SslTcpChannel> openListener, OptionMap optionMap)
          Create an unbound TCP SSL server.
 SslTcpServer createSslTcpServer(OptionMap optionMap)
          Create an unbound TCP SSL server.
 TcpAcceptor createTcpAcceptor(Executor executor, OptionMap optionMap)
          Create a TCP acceptor.
 TcpAcceptor createTcpAcceptor(OptionMap optionMap)
          Create a TCP acceptor.
 TcpConnector createTcpConnector(Executor executor, InetSocketAddress src, OptionMap optionMap)
          Create a TCP connector.
 TcpConnector createTcpConnector(Executor executor, OptionMap optionMap)
          Create a TCP connector.
 TcpConnector createTcpConnector(InetSocketAddress src, OptionMap optionMap)
          Create a TCP connector.
 TcpConnector createTcpConnector(OptionMap optionMap)
          Create a TCP connector.
 TcpServer createTcpServer(ChannelListener<? super TcpChannel> openListener, OptionMap optionMap)
          Create an unbound TCP server.
 TcpServer createTcpServer(Executor executor, ChannelListener<? super TcpChannel> openListener, OptionMap optionMap)
          Create an unbound TCP server.
 UdpServer createUdpServer(ChannelListener<? super UdpChannel> bindListener, OptionMap optionMap)
          Create an unbound UDP server.
 UdpServer createUdpServer(Executor executor, ChannelListener<? super UdpChannel> bindListener, OptionMap optionMap)
          Create an unbound UDP server.
 UdpServer createUdpServer(OptionMap optionMap)
          Create an unbound UDP server.
protected  Executor getExecutor()
          Get the default listener executor.
static Xnio getInstance()
          Get the "default" instance.
static Xnio getInstance(String name)
          Get or create a named XNIO provider instance, which is automatically configured from a properties file.
 String getName()
          Get the name of this XNIO instance.
protected  String getProperty(String name)
          Get an XNIO property.
protected  String getProperty(String name, String defaultValue)
          Get an XNIO property.
protected  Closeable registerMBean(OneWayPipeConnectionMBean mBean)
          Register a one-way pipe connection MBean.
protected  Closeable registerMBean(PipeConnectionMBean mBean)
          Register a pipe connection MBean.
protected  Closeable registerMBean(PipeServerMBean mBean)
          Register a pipe server MBean.
protected  Closeable registerMBean(PipeSinkServerMBean mBean)
          Register a pipe sink server MBean.
protected  Closeable registerMBean(PipeSourceServerMBean mBean)
          Register a pipe source server MBean.
protected  Closeable registerMBean(TcpConnectionMBean mBean)
          Register a TCP connection MBean.
protected  Closeable registerMBean(TcpServerMBean mBean)
          Register a TCP server MBean.
protected  Closeable registerMBean(UdpServerMBean mBean)
          Register a UDP server MBean.
 String toString()
          Get a string representation of this XNIO instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Xnio

protected Xnio(XnioConfiguration configuration)
Construct an XNIO provider instance.

Method Detail

getExecutor

protected Executor getExecutor()
Get the default listener executor.

Returns:
the executor

getInstance

public static Xnio getInstance(String name)
                        throws IOException
Get or create a named XNIO provider instance, which is automatically configured from a properties file.

The boot classpath is searched for a file named "xnio.properties" (the name can be overridden by way of the "xnio.property.file" system property). This file contains properties which are used to configure all created providers.

The following properties are recognized:

Parameters:
name - the provider name to get
Returns:
the configured global XNIO instance
Throws:
IOException - if the XNIO provider could not be created

getInstance

public static Xnio getInstance()
                        throws IOException
Get the "default" instance. Equivalent to calling getInstance("default").

Returns:
the default instance
Throws:
IOException - if the XNIO provider could not be created

create

public static Xnio create()
                   throws IOException
Create an instance of the default XNIO provider. The provider name can be specified through the xnio.provider.name system property. Any failure to create the XNIO provider will cause an java.io.IOException to be thrown.

Returns:
an XNIO instance
Throws:
IOException - if the XNIO provider could not be created

create

public static Xnio create(XnioConfiguration configuration)
                   throws IOException
Create an instance of the default XNIO provider. The provider name can be specified through the xnio.provider.name system property. Any failure to create the XNIO provider will cause an java.io.IOException to be thrown.

Parameters:
configuration - the configuration parameters for the implementation
Returns:
an XNIO instance
Throws:
IOException - if the XNIO provider could not be created

create

public static Xnio create(String implName,
                          XnioConfiguration configuration)
                   throws IOException
Create an instance of the named XNIO provider. Any failure to create the XNIO provider will cause an java.io.IOException to be thrown.

Parameters:
implName - the name of the implementation
configuration - the configuration parameters for the implementation
Returns:
an XNIO instance
Throws:
IOException - if the XNIO provider could not be created

createManagedSocketFactory

public SocketFactory createManagedSocketFactory(OptionMap optionMap)
Create a managed socket factory which uses this provider's MBean configuration to track management information.

Parameters:
optionMap - the option map
Returns:
the managed socket factory
Since:
2.0

createServerSocketFactory

public ServerSocketFactory createServerSocketFactory(OptionMap optionMap)
Create a managed server socket factory which uses this provider's MBean configuration to track management information.

Parameters:
optionMap - the option map
Returns:
the managed server socket factory
Since:
2.0

createTcpServer

public TcpServer createTcpServer(Executor executor,
                                 ChannelListener<? super TcpChannel> openListener,
                                 OptionMap optionMap)
Create an unbound TCP server. The given executor will be used to execute listener methods.

Parameters:
executor - the executor to use to execute the listeners
openListener - the initial open-connection listener
optionMap - the initial configuration for the server
Returns:
the unbound TCP server
Since:
2.0

createTcpServer

public TcpServer createTcpServer(ChannelListener<? super TcpChannel> openListener,
                                 OptionMap optionMap)
Create an unbound TCP server. The provider's default executor will be used to execute listener methods.

Parameters:
openListener - the initial open-connection listener
optionMap - the initial configuration for the server
Returns:
the unbound TCP server
Since:
2.0

createSslTcpServer

public SslTcpServer createSslTcpServer(Executor executor,
                                       ChannelListener<? super SslTcpChannel> openListener,
                                       OptionMap optionMap)
                                throws NoSuchProviderException,
                                       NoSuchAlgorithmException
Create an unbound TCP SSL server. The given executor will be used to execute listener methods and SSL tasks.

Parameters:
executor - the executor to use to execute the listeners
openListener - the initial open-connection listener
optionMap - the initial configuration for the server
Returns:
the unbound TCP SSL server
Throws:
NoSuchProviderException - if an SSL provider was selected which is not supported
NoSuchAlgorithmException - if an SSL algorithm was selected which is not supported
Since:
2.1

createSslTcpServer

public SslTcpServer createSslTcpServer(ChannelListener<? super SslTcpChannel> openListener,
                                       OptionMap optionMap)
                                throws NoSuchProviderException,
                                       NoSuchAlgorithmException
Create an unbound TCP SSL server. The provider's default executor will be used to execute listener methods and SSL tasks.

Parameters:
openListener - the initial open-connection listener
optionMap - the initial configuration for the server
Returns:
the unbound TCP SSL server
Throws:
NoSuchProviderException - if an SSL provider was selected which is not supported
NoSuchAlgorithmException - if an SSL algorithm was selected which is not supported
Since:
2.1

createSslTcpServer

public SslTcpServer createSslTcpServer(OptionMap optionMap)
                                throws NoSuchProviderException,
                                       NoSuchAlgorithmException
Create an unbound TCP SSL server. The provider's default executor will be used to execute listener methods and SSL tasks.

Parameters:
optionMap - the initial configuration for the server
Returns:
the unbound TCP SSL server
Throws:
NoSuchProviderException - if an SSL provider was selected which is not supported
NoSuchAlgorithmException - if an SSL algorithm was selected which is not supported
Since:
2.1

createTcpConnector

public TcpConnector createTcpConnector(Executor executor,
                                       OptionMap optionMap)
Create a TCP connector. The given executor will be used to execute listener methods.

Parameters:
executor - the executor to use to execute the listeners
optionMap - the initial configuration for the connector
Returns:
the TCP connector
Since:
2.0

createTcpConnector

public TcpConnector createTcpConnector(OptionMap optionMap)
Create a TCP connector. The provider's default executor will be used to execute listener methods.

Parameters:
optionMap - the initial configuration for the connector
Returns:
the TCP connector
Since:
2.0

createTcpConnector

public TcpConnector createTcpConnector(Executor executor,
                                       InetSocketAddress src,
                                       OptionMap optionMap)
Create a TCP connector. The given executor will be used to execute listener methods.

Parameters:
executor - the executor to use to execute the listeners
src - the source address for connections
optionMap - the initial configuration for the connector
Returns:
the TCP connector
Since:
2.0

createTcpConnector

public TcpConnector createTcpConnector(InetSocketAddress src,
                                       OptionMap optionMap)
Create a TCP connector. The provider's default executor will be used to execute listener methods.

Parameters:
src - the source address for connections
optionMap - the initial configuration for the connector
Returns:
the TCP connector
Since:
2.0

createSslTcpConnector

public SslTcpConnector createSslTcpConnector(Executor executor,
                                             InetSocketAddress src,
                                             OptionMap optionMap)
                                      throws NoSuchProviderException,
                                             NoSuchAlgorithmException
Create an SSL TCP connector. The given executor will be used to execute listener methods.

Parameters:
executor - the executor to use to execute the listeners
src - the source address for connections
optionMap - the initial configuration for the connector
Returns:
the SSL TCP connector
Throws:
NoSuchProviderException - if an SSL provider was selected which is not supported
NoSuchAlgorithmException - if an SSL algorithm was selected which is not supported
Since:
2.1

createSslTcpConnector

public SslTcpConnector createSslTcpConnector(InetSocketAddress src,
                                             OptionMap optionMap)
                                      throws NoSuchProviderException,
                                             NoSuchAlgorithmException
Create an SSL TCP connector. The provider's default executor will be used to execute listener methods.

Parameters:
src - the source address for connections
optionMap - the initial configuration for the connector
Returns:
the SSL TCP connector
Throws:
NoSuchProviderException - if an SSL provider was selected which is not supported
NoSuchAlgorithmException - if an SSL algorithm was selected which is not supported
Since:
2.1

createSslTcpConnector

public SslTcpConnector createSslTcpConnector(OptionMap optionMap)
                                      throws NoSuchProviderException,
                                             NoSuchAlgorithmException
Create an SSL TCP connector. The provider's default executor will be used to execute listener methods.

Parameters:
optionMap - the initial configuration for the connector
Returns:
the SSL TCP connector
Throws:
NoSuchProviderException - if an SSL provider was selected which is not supported
NoSuchAlgorithmException - if an SSL algorithm was selected which is not supported
Since:
2.1

createUdpServer

public UdpServer createUdpServer(Executor executor,
                                 ChannelListener<? super UdpChannel> bindListener,
                                 OptionMap optionMap)
Create an unbound UDP server. The UDP server can be configured to be multicast-capable; this should only be done if multicast is needed, since some providers have a performance penalty associated with multicast. The given executor will be used to execute listener methods.

Parameters:
executor - the executor to use to execute the listeners
bindListener - the initial open-connection listener
optionMap - the initial configuration for the server
Returns:
a factory that can be used to configure the new UDP server
Since:
2.0

createUdpServer

public UdpServer createUdpServer(ChannelListener<? super UdpChannel> bindListener,
                                 OptionMap optionMap)
Create an unbound UDP server. The UDP server can be configured to be multicast-capable; this should only be done if multicast is needed, since some providers have a performance penalty associated with multicast. The provider's default executor will be used to execute listener methods.

Parameters:
bindListener - the initial open-connection listener
optionMap - the initial configuration for the server
Returns:
a factory that can be used to configure the new UDP server
Since:
2.0

createUdpServer

public UdpServer createUdpServer(OptionMap optionMap)
Create an unbound UDP server. The UDP server can be configured to be multicast-capable; this should only be done if multicast is needed, since some providers have a performance penalty associated with multicast. The provider's default executor will be used to execute listener methods.

Parameters:
optionMap - the initial configuration for the server
Returns:
a factory that can be used to configure the new UDP server
Since:
2.0

createPipeServer

public ChannelSource<? extends StreamChannel> createPipeServer(Executor executor,
                                                               ChannelListener<? super StreamChannel> openListener)
Create a pipe "server". The provided open listener acts upon the server "end" of the pipe. The returned channel source is used to establish connections to the server.

Parameters:
executor - the executor to use to execute the listeners
openListener - the initial open-connection listener
Returns:
the client channel source
Since:
2.0

createPipeServer

public ChannelSource<? extends StreamChannel> createPipeServer(ChannelListener<? super StreamChannel> openListener)
Create a pipe "server". The provided open listener acts upon the server "end" of the pipe. The returned channel source is used to establish connections to the server. The provider's default executor will be used to execute listener methods.

Parameters:
openListener - the initial open-connection listener
Returns:
the client channel source
Since:
2.0

createPipeSourceServer

public ChannelSource<? extends StreamSourceChannel> createPipeSourceServer(Executor executor,
                                                                           ChannelListener<? super StreamSinkChannel> openListener)
Create a one-way pipe "server". The provided open listener acts upon the server "end" of the the pipe. The returned channel source is used to establish connections to the server. The data flows from the server to the client.

Parameters:
executor - the executor to use to execute the listeners
openListener - the initial open-connection listener
Returns:
the client channel source
Since:
2.0

createPipeSourceServer

public ChannelSource<? extends StreamSourceChannel> createPipeSourceServer(ChannelListener<? super StreamSinkChannel> openListener)
Create a one-way pipe "server". The provided open listener acts upon the server "end" of the the pipe. The returned channel source is used to establish connections to the server. The data flows from the server to the client. The provider's default executor will be used to execute listener methods.

Parameters:
openListener - the initial open-connection listener
Returns:
the client channel source
Since:
2.0

createPipeSinkServer

public ChannelSource<? extends StreamSinkChannel> createPipeSinkServer(Executor executor,
                                                                       ChannelListener<? super StreamSourceChannel> openListener)
Create a one-way pipe "server". The provided open listener acts upon the server "end" of the the pipe. The returned channel source is used to establish connections to the server. The data flows from the client to the server.

Parameters:
executor - the executor to use to execute the listeners
openListener - the initial open-connection listener
Returns:
the client channel source
Since:
2.0

createPipeSinkServer

public ChannelSource<? extends StreamSinkChannel> createPipeSinkServer(ChannelListener<? super StreamSourceChannel> openListener)
Create a one-way pipe "server". The provided open listener acts upon the server "end" of the the pipe. The returned channel source is used to establish connections to the server. The data flows from the client to the server. The provider's default executor will be used to execute listener methods.

Parameters:
openListener - the initial open-connection listener
Returns:
the client channel source
Since:
2.0

createPipeConnection

public IoFuture<? extends Closeable> createPipeConnection(Executor executor,
                                                          ChannelListener<? super StreamChannel> leftListener,
                                                          ChannelListener<? super StreamChannel> rightListener)
Create a single pipe connection.

Parameters:
executor - the executor to use to execute the listeners
leftListener - the open listener for the "left" side of the pipe
rightListener - the open listener for the "right" side of the pipe
Returns:
the future connection
Since:
2.0

createPipeConnection

public IoFuture<? extends Closeable> createPipeConnection(ChannelListener<? super StreamChannel> leftListener,
                                                          ChannelListener<? super StreamChannel> rightListener)
Create a single pipe connection. The provider's default executor will be used to execute listener methods.

Parameters:
leftListener - the listener for the "left" side of the pipe
rightListener - the listener for the "right" side of the pipe
Returns:
the future connection
Since:
2.0

createOneWayPipeConnection

public IoFuture<? extends Closeable> createOneWayPipeConnection(Executor executor,
                                                                ChannelListener<? super StreamSourceChannel> sourceListener,
                                                                ChannelListener<? super StreamSinkChannel> sinkListener)
Create a single one-way pipe connection.

Parameters:
executor - the executor to use to execute the listeners
sourceListener - the listener for the "source" side of the pipe
sinkListener - the listener for the "sink" side of the pipe
Returns:
the future connection
Since:
2.0

createOneWayPipeConnection

public IoFuture<? extends Closeable> createOneWayPipeConnection(ChannelListener<? super StreamSourceChannel> sourceListener,
                                                                ChannelListener<? super StreamSinkChannel> sinkListener)
Create a single one-way pipe connection. The provider's default executor will be used to execute listener methods.

Parameters:
sourceListener - the listener for the "source" side of the pipe
sinkListener - the listener for the "sink" side of the pipe
Returns:
the future connection
Since:
2.0

createTcpAcceptor

public TcpAcceptor createTcpAcceptor(Executor executor,
                                     OptionMap optionMap)
Create a TCP acceptor.

Parameters:
executor - the executor to use to execute the listeners
optionMap - the initial configuration for the acceptor
Returns:
the TCP acceptor
Since:
2.0

createTcpAcceptor

public TcpAcceptor createTcpAcceptor(OptionMap optionMap)
Create a TCP acceptor.

Parameters:
optionMap - the initial configuration for the acceptor
Returns:
the TCP acceptor
Since:
2.0

createLocalStreamServer

public LocalServer createLocalStreamServer(Executor executor,
                                           ChannelListener<? super ConnectedStreamChannel<String>> openListener,
                                           OptionMap optionMap)
Create a local stream server. The stream server can be bound to one or more files in the filesystem.

Parameters:
executor - the executor to use to execute the listeners
openListener - a listener which is notified on channel open
optionMap - the initial configuration for the server
Returns:
a factory that can be used to configure the new stream server
Since:
2.0

createLocalStreamServer

public LocalServer createLocalStreamServer(ChannelListener<? super ConnectedStreamChannel<String>> openListener,
                                           OptionMap optionMap)
Create a local stream server. The stream server can be bound to one or more files in the filesystem.

Parameters:
openListener - a listener which is notified on channel open
optionMap - the initial configuration for the server
Returns:
a factory that can be used to configure the new stream server
Since:
2.0

createLocalStreamConnector

public LocalStreamConnector createLocalStreamConnector(Executor executor,
                                                       OptionMap optionMap)
Create a local stream connector.

Parameters:
executor - the executor to use to execute the listeners
optionMap - the initial configuration for the connector
Returns:
the stream connector
Since:
2.0

createLocalStreamConnector

public LocalStreamConnector createLocalStreamConnector(OptionMap optionMap)
Create a local stream connector.

Parameters:
optionMap - the initial configuration for the connector
Returns:
the stream connector
Since:
2.0

createLocalDatagramServer

public LocalServer createLocalDatagramServer(Executor executor,
                                             ChannelListener<? super DatagramChannel<String>> openListener,
                                             OptionMap optionMap)
Create a local datagram server. The datagram server is bound to one or more files in the filesystem.

Parameters:
executor - the executor to use to execute the listeners
openListener - the initial open-connection listener
optionMap - the initial configuration for the server
Returns:
the new datagram server
Since:
2.0

createLocalDatagramServer

public LocalServer createLocalDatagramServer(ChannelListener<? super DatagramChannel<String>> openListener,
                                             OptionMap optionMap)
Create a local datagram server. The datagram server is bound to one or more files in the filesystem.

Parameters:
openListener - the initial open-connection listener
optionMap - the initial configuration for the server
Returns:
the new datagram server
Since:
2.0

createLocalDatagramConnector

public LocalDatagramConnector createLocalDatagramConnector(Executor executor,
                                                           OptionMap optionMap)
Create a local datagram connector.

Parameters:
executor - the executor to use to execute the listeners
optionMap - the initial configuration for the connector
Returns:
the new datagram connector
Since:
2.0

createLocalDatagramConnector

public LocalDatagramConnector createLocalDatagramConnector(OptionMap optionMap)
Create a local datagram connector.

Parameters:
optionMap - the initial configuration for the connector
Returns:
the new datagram connector
Since:
2.0

awaken

public void awaken(Thread targetThread)
Wake up any blocking I/O operation being carried out on a given thread. Custom implementors of Thread may call this method from their implementation of Thread.interrupt() after the default implementation to ensure that any thread waiting in a blocking operation is woken up in a timely manner. Some implementations may not implement this method, relying instead on the interruption mechanism built in to the JVM; as such this method should not be relied upon as a guaranteed way to awaken a blocking thread independently of thread interruption.

Parameters:
targetThread - the thread to awaken
Since:
1.2

getName

public String getName()
Get the name of this XNIO instance.

Returns:
the name

toString

public String toString()
Get a string representation of this XNIO instance.

Overrides:
toString in class Object
Returns:
the string representation

close

public abstract void close()
                    throws IOException
Close this XNIO provider. Calling this method more than one time has no additional effect.

Specified by:
close in interface Closeable
Throws:
IOException

getProperty

protected String getProperty(String name)
Get an XNIO property. The property name must start with "xnio.".

Parameters:
name - the property name
Returns:
the property value, or null if it wasn't found
Since:
1.2

getProperty

protected String getProperty(String name,
                             String defaultValue)
Get an XNIO property. The property name must start with "xnio.".

Parameters:
name - the property name
defaultValue - the default value
Returns:
the property value, or defaultValue if it wasn't found
Since:
1.2

registerMBean

protected Closeable registerMBean(TcpServerMBean mBean)
Register a TCP server MBean.

Parameters:
mBean - the MBean
Returns:
a handle which may be used to unregister the MBean
Since:
1.2

registerMBean

protected Closeable registerMBean(TcpConnectionMBean mBean)
Register a TCP connection MBean.

Parameters:
mBean - the MBean
Returns:
a handle which may be used to unregister the MBean
Since:
1.2

registerMBean

protected Closeable registerMBean(UdpServerMBean mBean)
Register a UDP server MBean.

Parameters:
mBean - the MBean
Returns:
a handle which may be used to unregister the MBean
Since:
1.2

registerMBean

protected Closeable registerMBean(OneWayPipeConnectionMBean mBean)
Register a one-way pipe connection MBean.

Parameters:
mBean - the MBean
Returns:
a handle which may be used to unregister the MBean
Since:
1.2

registerMBean

protected Closeable registerMBean(PipeConnectionMBean mBean)
Register a pipe connection MBean.

Parameters:
mBean - the MBean
Returns:
a handle which may be used to unregister the MBean
Since:
1.2

registerMBean

protected Closeable registerMBean(PipeServerMBean mBean)
Register a pipe server MBean.

Parameters:
mBean - the MBean
Returns:
a handle which may be used to unregister the MBean
Since:
1.2

registerMBean

protected Closeable registerMBean(PipeSourceServerMBean mBean)
Register a pipe source server MBean.

Parameters:
mBean - the MBean
Returns:
a handle which may be used to unregister the MBean
Since:
1.2

registerMBean

protected Closeable registerMBean(PipeSinkServerMBean mBean)
Register a pipe sink server MBean.

Parameters:
mBean - the MBean
Returns:
a handle which may be used to unregister the MBean
Since:
1.2

XNIO API 2.1.0.CR2

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