|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jboss.xnio.Xnio
org.jboss.xnio.nio.NioXnio
public final class NioXnio
An NIO-based XNIO provider for a standalone application.
| Method Summary | |
|---|---|
void |
awaken(java.lang.Thread targetThread)
Wake up any blocking I/O operation being carried out on a given thread. |
void |
close()
Close this XNIO provider. |
static Xnio |
create()
Create an NIO-based XNIO provider. |
static Xnio |
create(java.util.concurrent.Executor handlerExecutor,
int readSelectorThreads,
int writeSelectorThreads,
int connectSelectorThreads)
Create an NIO-based XNIO provider. |
static Xnio |
create(java.util.concurrent.Executor handlerExecutor,
java.util.concurrent.ThreadFactory selectorThreadFactory,
int readSelectorThreads,
int writeSelectorThreads,
int connectSelectorThreads)
Create an NIO-based XNIO provider. |
static Xnio |
create(int readSelectorThreads,
int writeSelectorThreads,
int connectSelectorThreads)
Create an NIO-based XNIO provider. |
static Xnio |
create(NioXnioConfiguration configuration)
Create an NIO-based XNIO provider. |
IoFuture<java.io.Closeable> |
createOneWayPipeConnection(java.util.concurrent.Executor executor,
IoHandler<? super StreamSourceChannel> sourceHandler,
IoHandler<? super StreamSinkChannel> sinkHandler)
Create a single one-way pipe connection. |
IoFuture<java.io.Closeable> |
createOneWayPipeConnection(IoHandler<? super StreamSourceChannel> sourceHandler,
IoHandler<? super StreamSinkChannel> sinkHandler)
Create a single one-way pipe connection. |
IoFuture<java.io.Closeable> |
createPipeConnection(java.util.concurrent.Executor executor,
IoHandler<? super StreamChannel> leftHandler,
IoHandler<? super StreamChannel> rightHandler)
Create a single pipe connection. |
IoFuture<java.io.Closeable> |
createPipeConnection(IoHandler<? super StreamChannel> leftHandler,
IoHandler<? super StreamChannel> rightHandler)
Create a single pipe connection. |
ChannelSource<StreamChannel> |
createPipeServer(java.util.concurrent.Executor executor,
IoHandlerFactory<? super StreamChannel> handlerFactory)
Create a pipe "server". |
ChannelSource<StreamChannel> |
createPipeServer(IoHandlerFactory<? super StreamChannel> handlerFactory)
Create a pipe "server". |
ChannelSource<StreamSinkChannel> |
createPipeSinkServer(java.util.concurrent.Executor executor,
IoHandlerFactory<? super StreamSourceChannel> handlerFactory)
Create a one-way pipe "server". |
ChannelSource<StreamSinkChannel> |
createPipeSinkServer(IoHandlerFactory<? super StreamSourceChannel> handlerFactory)
Create a one-way pipe "server". |
ChannelSource<StreamSourceChannel> |
createPipeSourceServer(java.util.concurrent.Executor executor,
IoHandlerFactory<? super StreamSinkChannel> handlerFactory)
Create a one-way pipe "server". |
ChannelSource<StreamSourceChannel> |
createPipeSourceServer(IoHandlerFactory<? super StreamSinkChannel> handlerFactory)
Create a one-way pipe "server". |
ConfigurableFactory<CloseableTcpAcceptor> |
createTcpAcceptor()
Create a TCP acceptor. |
ConfigurableFactory<CloseableTcpAcceptor> |
createTcpAcceptor(java.util.concurrent.Executor executor)
Create a TCP acceptor. |
ConfigurableFactory<CloseableTcpConnector> |
createTcpConnector()
Create a configurable TCP connector. |
ConfigurableFactory<CloseableTcpConnector> |
createTcpConnector(java.util.concurrent.Executor executor)
Create a configurable TCP connector. |
ConfigurableFactory<BoundServer<java.net.SocketAddress,BoundChannel<java.net.SocketAddress>>> |
createTcpServer(java.util.concurrent.Executor executor,
IoHandlerFactory<? super TcpChannel> handlerFactory,
java.net.SocketAddress... bindAddresses)
Create a TCP server. |
ConfigurableFactory<BoundServer<java.net.SocketAddress,BoundChannel<java.net.SocketAddress>>> |
createTcpServer(IoHandlerFactory<? super TcpChannel> handlerFactory,
java.net.SocketAddress... bindAddresses)
Create a TCP server. |
ConfigurableFactory<BoundServer<java.net.SocketAddress,UdpChannel>> |
createUdpServer(boolean multicast,
IoHandlerFactory<? super UdpChannel> handlerFactory,
java.net.SocketAddress... bindAddresses)
Create a UDP server. |
ConfigurableFactory<BoundServer<java.net.SocketAddress,UdpChannel>> |
createUdpServer(java.util.concurrent.Executor executor,
boolean multicast,
IoHandlerFactory<? super UdpChannel> handlerFactory,
java.net.SocketAddress... bindAddresses)
Create a UDP server. |
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 org.jboss.xnio.Xnio |
|---|
createLocalDatagramConnector, createLocalDatagramConnector, createLocalDatagramServer, createLocalDatagramServer, createLocalStreamConnector, createLocalStreamConnector, createLocalStreamServer, createLocalStreamServer, getName, getProperty, getProperty |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public static Xnio create(NioXnioConfiguration configuration)
throws java.io.IOException
configuration - the configuration
java.io.IOException - if an I/O error occurs while starting the service
public static Xnio create()
throws java.io.IOException
java.io.IOException - if an I/O error occurs while starting the service
public static Xnio create(int readSelectorThreads,
int writeSelectorThreads,
int connectSelectorThreads)
throws java.io.IOException,
java.lang.IllegalArgumentException
readSelectorThreads - the number of threads to assign for readable eventswriteSelectorThreads - the number of threads to assign for writable eventsconnectSelectorThreads - the number of threads to assign for connect/accept events
java.io.IOException - if an I/O error occurs while starting the service
java.lang.IllegalArgumentException - if a given argument is not valid
public static Xnio create(java.util.concurrent.Executor handlerExecutor,
int readSelectorThreads,
int writeSelectorThreads,
int connectSelectorThreads)
throws java.io.IOException,
java.lang.IllegalArgumentException
handlerExecutor - the executor to use to handle eventsreadSelectorThreads - the number of threads to assign for readable eventswriteSelectorThreads - the number of threads to assign for writable eventsconnectSelectorThreads - the number of threads to assign for connect/accept events
java.io.IOException - if an I/O error occurs while starting the service
java.lang.IllegalArgumentException - if a given argument is not valid
public static Xnio create(java.util.concurrent.Executor handlerExecutor,
java.util.concurrent.ThreadFactory selectorThreadFactory,
int readSelectorThreads,
int writeSelectorThreads,
int connectSelectorThreads)
throws java.io.IOException,
java.lang.IllegalArgumentException
handlerExecutor - the executor to use to handle eventsselectorThreadFactory - the selector thread factory to usereadSelectorThreads - the number of threads to assign for readable eventswriteSelectorThreads - the number of threads to assign for writable eventsconnectSelectorThreads - the number of threads to assign for connect/accept events
java.io.IOException - if an I/O error occurs while starting the service
java.lang.IllegalArgumentException - if a given argument is not valid
public ConfigurableFactory<BoundServer<java.net.SocketAddress,BoundChannel<java.net.SocketAddress>>> createTcpServer(java.util.concurrent.Executor executor,
IoHandlerFactory<? super TcpChannel> handlerFactory,
java.net.SocketAddress... bindAddresses)
createTcpServer in class Xnioexecutor - the executor to use to execute the handlershandlerFactory - the factory which will produce handlers for inbound connectionsbindAddresses - the addresses to bind to
public ConfigurableFactory<BoundServer<java.net.SocketAddress,BoundChannel<java.net.SocketAddress>>> createTcpServer(IoHandlerFactory<? super TcpChannel> handlerFactory,
java.net.SocketAddress... bindAddresses)
createTcpServer in class XniohandlerFactory - the factory which will produce handlers for inbound connectionsbindAddresses - the addresses to bind to
public ConfigurableFactory<CloseableTcpConnector> createTcpConnector(java.util.concurrent.Executor executor)
createTcpConnector in class Xnioexecutor - the executor to use to execute the handlers
public ConfigurableFactory<CloseableTcpConnector> createTcpConnector()
createTcpConnector in class Xnio
public ConfigurableFactory<BoundServer<java.net.SocketAddress,UdpChannel>> createUdpServer(java.util.concurrent.Executor executor,
boolean multicast,
IoHandlerFactory<? super UdpChannel> handlerFactory,
java.net.SocketAddress... bindAddresses)
createUdpServer in class Xnioexecutor - the executor to use to execute the handlersmulticast - true if the UDP server should be multicast-capablehandlerFactory - the factory which will produce handlers for each channelbindAddresses - the addresses to bind
public ConfigurableFactory<BoundServer<java.net.SocketAddress,UdpChannel>> createUdpServer(boolean multicast,
IoHandlerFactory<? super UdpChannel> handlerFactory,
java.net.SocketAddress... bindAddresses)
createUdpServer in class Xniomulticast - true if the UDP server should be multicast-capablehandlerFactory - the factory which will produce handlers for each channelbindAddresses - the addresses to bind
public ChannelSource<StreamChannel> createPipeServer(java.util.concurrent.Executor executor,
IoHandlerFactory<? super StreamChannel> handlerFactory)
createPipeServer in class Xnioexecutor - the executor to use to execute the handlershandlerFactory - the server handler factory
public ChannelSource<StreamChannel> createPipeServer(IoHandlerFactory<? super StreamChannel> handlerFactory)
createPipeServer in class XniohandlerFactory - the server handler factory
public ChannelSource<StreamSourceChannel> createPipeSourceServer(java.util.concurrent.Executor executor,
IoHandlerFactory<? super StreamSinkChannel> handlerFactory)
createPipeSourceServer in class Xnioexecutor - the executor to use to execute the handlershandlerFactory - the server handler factory
public ChannelSource<StreamSourceChannel> createPipeSourceServer(IoHandlerFactory<? super StreamSinkChannel> handlerFactory)
createPipeSourceServer in class XniohandlerFactory - the server handler factory
public ChannelSource<StreamSinkChannel> createPipeSinkServer(java.util.concurrent.Executor executor,
IoHandlerFactory<? super StreamSourceChannel> handlerFactory)
createPipeSinkServer in class Xnioexecutor - the executor to use to execute the handlershandlerFactory - the server handler factory
public ChannelSource<StreamSinkChannel> createPipeSinkServer(IoHandlerFactory<? super StreamSourceChannel> handlerFactory)
createPipeSinkServer in class XniohandlerFactory - the server handler factory
public IoFuture<java.io.Closeable> createPipeConnection(java.util.concurrent.Executor executor,
IoHandler<? super StreamChannel> leftHandler,
IoHandler<? super StreamChannel> rightHandler)
createPipeConnection in class Xnioexecutor - the executor to use to execute the handlersleftHandler - the handler for the "left" side of the piperightHandler - the handler for the "right" side of the pipe
public IoFuture<java.io.Closeable> createPipeConnection(IoHandler<? super StreamChannel> leftHandler,
IoHandler<? super StreamChannel> rightHandler)
createPipeConnection in class XnioleftHandler - the handler for the "left" side of the piperightHandler - the handler for the "right" side of the pipe
public IoFuture<java.io.Closeable> createOneWayPipeConnection(java.util.concurrent.Executor executor,
IoHandler<? super StreamSourceChannel> sourceHandler,
IoHandler<? super StreamSinkChannel> sinkHandler)
createOneWayPipeConnection in class Xnioexecutor - 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<java.io.Closeable> createOneWayPipeConnection(IoHandler<? super StreamSourceChannel> sourceHandler,
IoHandler<? super StreamSinkChannel> sinkHandler)
createOneWayPipeConnection in class XniosourceHandler - the handler for the "source" side of the pipesinkHandler - the handler for the "sink" side of the pipe
public ConfigurableFactory<CloseableTcpAcceptor> createTcpAcceptor(java.util.concurrent.Executor executor)
createTcpAcceptor in class Xnioexecutor - the executor to use to execute the handlers
public ConfigurableFactory<CloseableTcpAcceptor> createTcpAcceptor()
createTcpAcceptor in class Xniopublic 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. This implementation relies on NIO mechanisms to awaken interrupted threads.
awaken in class XniotargetThread - the thread to awaken
public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in class Xniojava.io.IOExceptionpublic java.lang.String toString()
Xnio
toString in class Xnioprotected java.io.Closeable registerMBean(TcpServerMBean mBean)
Xnio
registerMBean in class XniomBean - the MBean
protected java.io.Closeable registerMBean(TcpConnectionMBean mBean)
Xnio
registerMBean in class XniomBean - the MBean
protected java.io.Closeable registerMBean(UdpServerMBean mBean)
Xnio
registerMBean in class XniomBean - the MBean
protected java.io.Closeable registerMBean(OneWayPipeConnectionMBean mBean)
Xnio
registerMBean in class XniomBean - the MBean
protected java.io.Closeable registerMBean(PipeConnectionMBean mBean)
Xnio
registerMBean in class XniomBean - the MBean
protected java.io.Closeable registerMBean(PipeServerMBean mBean)
Xnio
registerMBean in class XniomBean - the MBean
protected java.io.Closeable registerMBean(PipeSourceServerMBean mBean)
Xnio
registerMBean in class XniomBean - the MBean
protected java.io.Closeable registerMBean(PipeSinkServerMBean mBean)
Xnio
registerMBean in class XniomBean - the MBean
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||