|
XNIO API 2.0.2.GA | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.xnio.Xnio
public abstract class Xnio

The XNIO entry point class.
| Constructor Summary | |
|---|---|
protected |
Xnio(XnioConfiguration configuration)
Construct an XNIO provider instance. |
| Method Summary | |
|---|---|
void |
awaken(java.lang.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(java.lang.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(java.util.concurrent.Executor executor,
OptionMap optionMap)
Create a local datagram connector. |
LocalDatagramConnector |
createLocalDatagramConnector(OptionMap optionMap)
Create a local datagram connector. |
LocalServer |
createLocalDatagramServer(ChannelListener<? super DatagramChannel<java.lang.String>> openHandler,
OptionMap optionMap)
Create a local datagram server. |
LocalServer |
createLocalDatagramServer(java.util.concurrent.Executor executor,
ChannelListener<? super DatagramChannel<java.lang.String>> openHandler,
OptionMap optionMap)
Create a local datagram server. |
LocalStreamConnector |
createLocalStreamConnector(java.util.concurrent.Executor executor,
OptionMap optionMap)
Create a local stream connector. |
LocalStreamConnector |
createLocalStreamConnector(OptionMap optionMap)
Create a local stream connector. |
LocalServer |
createLocalStreamServer(ChannelListener<? super ConnectedStreamChannel<java.lang.String>> openListener,
OptionMap optionMap)
Create a local stream server. |
LocalServer |
createLocalStreamServer(java.util.concurrent.Executor executor,
ChannelListener<? super ConnectedStreamChannel<java.lang.String>> openListener,
OptionMap optionMap)
Create a local stream server. |
javax.net.SocketFactory |
createManagedSocketFactory(OptionMap optionMap)
Create a managed socket factory which uses this provider's MBean configuration to track management information. |
IoFuture<? extends java.io.Closeable> |
createOneWayPipeConnection(ChannelListener<? super StreamSourceChannel> sourceHandler,
ChannelListener<? super StreamSinkChannel> sinkHandler)
Create a single one-way pipe connection. |
IoFuture<? extends java.io.Closeable> |
createOneWayPipeConnection(java.util.concurrent.Executor executor,
ChannelListener<? super StreamSourceChannel> sourceHandler,
ChannelListener<? super StreamSinkChannel> sinkHandler)
Create a single one-way pipe connection. |
IoFuture<? extends java.io.Closeable> |
createPipeConnection(ChannelListener<? super StreamChannel> leftHandler,
ChannelListener<? super StreamChannel> rightHandler)
Create a single pipe connection. |
IoFuture<? extends java.io.Closeable> |
createPipeConnection(java.util.concurrent.Executor executor,
ChannelListener<? super StreamChannel> leftHandler,
ChannelListener<? super StreamChannel> rightHandler)
Create a single pipe connection. |
ChannelSource<? extends StreamChannel> |
createPipeServer(ChannelListener<? super StreamChannel> openHandler)
Create a pipe "server". |
ChannelSource<? extends StreamChannel> |
createPipeServer(java.util.concurrent.Executor executor,
ChannelListener<? super StreamChannel> openHandler)
Create a pipe "server". |
ChannelSource<? extends StreamSinkChannel> |
createPipeSinkServer(ChannelListener<? super StreamSourceChannel> openHandler)
Create a one-way pipe "server". |
ChannelSource<? extends StreamSinkChannel> |
createPipeSinkServer(java.util.concurrent.Executor executor,
ChannelListener<? super StreamSourceChannel> openHandler)
Create a one-way pipe "server". |
ChannelSource<? extends StreamSourceChannel> |
createPipeSourceServer(ChannelListener<? super StreamSinkChannel> openHandler)
Create a one-way pipe "server". |
ChannelSource<? extends StreamSourceChannel> |
createPipeSourceServer(java.util.concurrent.Executor executor,
ChannelListener<? super StreamSinkChannel> openHandler)
Create a one-way pipe "server". |
javax.net.ServerSocketFactory |
createServerSocketFactory(OptionMap optionMap)
Create a managed server socket factory which uses this provider's MBean configuration to track management information. |
TcpAcceptor |
createTcpAcceptor(java.util.concurrent.Executor executor,
OptionMap optionMap)
Create a TCP acceptor. |
TcpAcceptor |
createTcpAcceptor(OptionMap optionMap)
Create a TCP acceptor. |
TcpConnector |
createTcpConnector(java.util.concurrent.Executor executor,
java.net.InetSocketAddress src,
OptionMap optionMap)
Create a TCP connector. |
TcpConnector |
createTcpConnector(java.util.concurrent.Executor executor,
OptionMap optionMap)
Create a TCP connector. |
TcpConnector |
createTcpConnector(java.net.InetSocketAddress src,
OptionMap optionMap)
Create a TCP connector. |
TcpConnector |
createTcpConnector(OptionMap optionMap)
Create a TCP connector. |
TcpServer |
createTcpServer(ChannelListener<? super TcpChannel> openHandler,
OptionMap optionMap)
Create an unbound TCP server. |
TcpServer |
createTcpServer(java.util.concurrent.Executor executor,
ChannelListener<? super TcpChannel> openHandler,
OptionMap optionMap)
Create an unbound TCP server. |
UdpServer |
createUdpServer(ChannelListener<? super UdpChannel> openHandler,
OptionMap optionMap)
Create an unbound UDP server. |
UdpServer |
createUdpServer(java.util.concurrent.Executor executor,
ChannelListener<? super UdpChannel> openHandler,
OptionMap optionMap)
Create an unbound UDP server. |
UdpServer |
createUdpServer(OptionMap optionMap)
Create an unbound UDP server. |
protected java.util.concurrent.Executor |
getExecutor()
Get the default handler executor. |
java.lang.String |
getName()
Get the name of this XNIO instance. |
protected java.lang.String |
getProperty(java.lang.String name)
Get an XNIO property. |
protected java.lang.String |
getProperty(java.lang.String name,
java.lang.String defaultValue)
Get an XNIO property. |
protected java.io.Closeable |
registerMBean(OneWayPipeConnectionMBean mBean)
Register a one-way pipe connection MBean. |
protected java.io.Closeable |
registerMBean(PipeConnectionMBean mBean)
Register a pipe connection MBean. |
protected java.io.Closeable |
registerMBean(PipeServerMBean mBean)
Register a pipe server MBean. |
protected java.io.Closeable |
registerMBean(PipeSinkServerMBean mBean)
Register a pipe sink server MBean. |
protected java.io.Closeable |
registerMBean(PipeSourceServerMBean mBean)
Register a pipe source server MBean. |
protected java.io.Closeable |
registerMBean(TcpConnectionMBean mBean)
Register a TCP connection MBean. |
protected java.io.Closeable |
registerMBean(TcpServerMBean mBean)
Register a TCP server MBean. |
protected java.io.Closeable |
registerMBean(UdpServerMBean mBean)
Register a UDP server MBean. |
java.lang.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 |
|---|
protected Xnio(XnioConfiguration configuration)
| Method Detail |
|---|
protected java.util.concurrent.Executor getExecutor()
public static Xnio create()
throws java.io.IOException
xnio.provider.name system property. Any failure to create the XNIO provider will cause an java.io.IOException
to be thrown.
java.io.IOException - if the XNIO provider could not be created
public static Xnio create(XnioConfiguration configuration)
throws java.io.IOException
xnio.provider.name system property. Any failure to create the XNIO provider will cause an java.io.IOException
to be thrown.
configuration - the configuration parameters for the implementation
java.io.IOException - if the XNIO provider could not be created
public static Xnio create(java.lang.String implName,
XnioConfiguration configuration)
throws java.io.IOException
java.io.IOException
to be thrown.
implName - the name of the implementationconfiguration - the configuration parameters for the implementation
java.io.IOException - if the XNIO provider could not be createdpublic javax.net.SocketFactory createManagedSocketFactory(OptionMap optionMap)
optionMap - the option map
public javax.net.ServerSocketFactory createServerSocketFactory(OptionMap optionMap)
optionMap - the option map
public TcpServer createTcpServer(java.util.concurrent.Executor executor,
ChannelListener<? super TcpChannel> openHandler,
OptionMap optionMap)
executor - the executor to use to execute the handlersopenHandler - the initial open-connection handleroptionMap - the initial configuration for the server
public TcpServer createTcpServer(ChannelListener<? super TcpChannel> openHandler,
OptionMap optionMap)
openHandler - the initial open-connection handleroptionMap - the initial configuration for the server
public TcpConnector createTcpConnector(java.util.concurrent.Executor executor,
OptionMap optionMap)
executor - the executor to use to execute the handlersoptionMap - the initial configuration for the connector
public TcpConnector createTcpConnector(OptionMap optionMap)
optionMap - the initial configuration for the connector
public TcpConnector createTcpConnector(java.util.concurrent.Executor executor,
java.net.InetSocketAddress src,
OptionMap optionMap)
executor - the executor to use to execute the handlerssrc - the source address for connectionsoptionMap - the initial configuration for the connector
public TcpConnector createTcpConnector(java.net.InetSocketAddress src,
OptionMap optionMap)
src - the source address for connectionsoptionMap - the initial configuration for the connector
public UdpServer createUdpServer(java.util.concurrent.Executor executor,
ChannelListener<? super UdpChannel> openHandler,
OptionMap optionMap)
executor - the executor to use to execute the handlersopenHandler - the initial open-connection handleroptionMap - the initial configuration for the server
public UdpServer createUdpServer(ChannelListener<? super UdpChannel> openHandler,
OptionMap optionMap)
openHandler - the initial open-connection handleroptionMap - the initial configuration for the server
public UdpServer createUdpServer(OptionMap optionMap)
optionMap - the initial configuration for the server
public ChannelSource<? extends StreamChannel> createPipeServer(java.util.concurrent.Executor executor,
ChannelListener<? super StreamChannel> openHandler)
executor - the executor to use to execute the handlersopenHandler - the initial open-connection handler
public ChannelSource<? extends StreamChannel> createPipeServer(ChannelListener<? super StreamChannel> openHandler)
openHandler - the initial open-connection handler
public ChannelSource<? extends StreamSourceChannel> createPipeSourceServer(java.util.concurrent.Executor executor,
ChannelListener<? super StreamSinkChannel> openHandler)
executor - the executor to use to execute the handlersopenHandler - the initial open-connection handler
public ChannelSource<? extends StreamSourceChannel> createPipeSourceServer(ChannelListener<? super StreamSinkChannel> openHandler)
openHandler - the initial open-connection handler
public ChannelSource<? extends StreamSinkChannel> createPipeSinkServer(java.util.concurrent.Executor executor,
ChannelListener<? super StreamSourceChannel> openHandler)
executor - the executor to use to execute the handlersopenHandler - the initial open-connection handler
public ChannelSource<? extends StreamSinkChannel> createPipeSinkServer(ChannelListener<? super StreamSourceChannel> openHandler)
openHandler - the initial open-connection handler
public IoFuture<? extends java.io.Closeable> createPipeConnection(java.util.concurrent.Executor executor,
ChannelListener<? super StreamChannel> leftHandler,
ChannelListener<? super StreamChannel> rightHandler)
executor - the executor to use to execute the handlersleftHandler - the open handler for the "left" side of the piperightHandler - the open handler for the "right" side of the pipe
public IoFuture<? extends java.io.Closeable> createPipeConnection(ChannelListener<? super StreamChannel> leftHandler,
ChannelListener<? super StreamChannel> rightHandler)
leftHandler - the handler for the "left" side of the piperightHandler - the handler for the "right" side of the pipe
public IoFuture<? extends java.io.Closeable> createOneWayPipeConnection(java.util.concurrent.Executor executor,
ChannelListener<? super StreamSourceChannel> sourceHandler,
ChannelListener<? super StreamSinkChannel> sinkHandler)
executor - the executor to use to execute the handlerssourceHandler - the handler for the "source" side of the pipesinkHandler - the handler for the "sink" side of the pipe
public IoFuture<? extends java.io.Closeable> createOneWayPipeConnection(ChannelListener<? super StreamSourceChannel> sourceHandler,
ChannelListener<? super StreamSinkChannel> sinkHandler)
sourceHandler - the handler for the "source" side of the pipesinkHandler - the handler for the "sink" side of the pipe
public TcpAcceptor createTcpAcceptor(java.util.concurrent.Executor executor,
OptionMap optionMap)
executor - the executor to use to execute the handlersoptionMap - the initial configuration for the acceptor
public TcpAcceptor createTcpAcceptor(OptionMap optionMap)
optionMap - the initial configuration for the acceptor
public LocalServer createLocalStreamServer(java.util.concurrent.Executor executor,
ChannelListener<? super ConnectedStreamChannel<java.lang.String>> openListener,
OptionMap optionMap)
executor - the executor to use to execute the handlersopenListener - a listener which is notified on channel openoptionMap - the initial configuration for the server
public LocalServer createLocalStreamServer(ChannelListener<? super ConnectedStreamChannel<java.lang.String>> openListener,
OptionMap optionMap)
openListener - a listener which is notified on channel openoptionMap - the initial configuration for the server
public LocalStreamConnector createLocalStreamConnector(java.util.concurrent.Executor executor,
OptionMap optionMap)
executor - the executor to use to execute the handlersoptionMap - the initial configuration for the connector
public LocalStreamConnector createLocalStreamConnector(OptionMap optionMap)
optionMap - the initial configuration for the connector
public LocalServer createLocalDatagramServer(java.util.concurrent.Executor executor,
ChannelListener<? super DatagramChannel<java.lang.String>> openHandler,
OptionMap optionMap)
executor - the executor to use to execute the handlersopenHandler - the initial open-connection handleroptionMap - the initial configuration for the server
public LocalServer createLocalDatagramServer(ChannelListener<? super DatagramChannel<java.lang.String>> openHandler,
OptionMap optionMap)
openHandler - the initial open-connection handleroptionMap - the initial configuration for the server
public LocalDatagramConnector createLocalDatagramConnector(java.util.concurrent.Executor executor,
OptionMap optionMap)
executor - the executor to use to execute the handlersoptionMap - the initial configuration for the connector
public LocalDatagramConnector createLocalDatagramConnector(OptionMap optionMap)
optionMap - the initial configuration for the connector
public void awaken(java.lang.Thread targetThread)
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.
targetThread - the thread to awakenpublic java.lang.String getName()
public java.lang.String toString()
toString in class java.lang.Object
public abstract void close()
throws java.io.IOException
close in interface java.io.Closeablejava.io.IOExceptionprotected java.lang.String getProperty(java.lang.String name)
"xnio.".
name - the property name
null if it wasn't found
protected java.lang.String getProperty(java.lang.String name,
java.lang.String defaultValue)
"xnio.".
name - the property namedefaultValue - the default value
defaultValue if it wasn't foundprotected java.io.Closeable registerMBean(TcpServerMBean mBean)
mBean - the MBean
protected java.io.Closeable registerMBean(TcpConnectionMBean mBean)
mBean - the MBean
protected java.io.Closeable registerMBean(UdpServerMBean mBean)
mBean - the MBean
protected java.io.Closeable registerMBean(OneWayPipeConnectionMBean mBean)
mBean - the MBean
protected java.io.Closeable registerMBean(PipeConnectionMBean mBean)
mBean - the MBean
protected java.io.Closeable registerMBean(PipeServerMBean mBean)
mBean - the MBean
protected java.io.Closeable registerMBean(PipeSourceServerMBean mBean)
mBean - the MBean
protected java.io.Closeable registerMBean(PipeSinkServerMBean mBean)
mBean - the MBean
|
XNIO API 2.0.2.GA | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||