|
|||||||||
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. |
ConfigurableFactory<CloseableConnector<java.lang.String,DatagramChannel<java.lang.String>>> |
createLocalDatagramConnector()
Create a configurable local datagram connector. |
ConfigurableFactory<CloseableConnector<java.lang.String,DatagramChannel<java.lang.String>>> |
createLocalDatagramConnector(java.util.concurrent.Executor executor)
Create a configurable local datagram connector. |
ConfigurableFactory<BoundServer<java.lang.String,BoundChannel<java.lang.String>>> |
createLocalDatagramServer(java.util.concurrent.Executor executor,
IoHandlerFactory<? super DatagramChannel<java.lang.String>> handlerFactory)
Create a local datagram server. |
ConfigurableFactory<BoundServer<java.lang.String,BoundChannel<java.lang.String>>> |
createLocalDatagramServer(IoHandlerFactory<? super DatagramChannel<java.lang.String>> handlerFactory)
Create a local datagram server. |
ConfigurableFactory<CloseableConnector<java.lang.String,ConnectedStreamChannel<java.lang.String>>> |
createLocalStreamConnector()
Create a configurable local stream connector. |
ConfigurableFactory<CloseableConnector<java.lang.String,ConnectedStreamChannel<java.lang.String>>> |
createLocalStreamConnector(java.util.concurrent.Executor executor)
Create a configurable local stream connector. |
ConfigurableFactory<BoundServer<java.lang.String,BoundChannel<java.lang.String>>> |
createLocalStreamServer(java.util.concurrent.Executor executor,
IoHandlerFactory<? super ConnectedStreamChannel<java.lang.String>> handlerFactory)
Create a local stream server. |
ConfigurableFactory<BoundServer<java.lang.String,BoundChannel<java.lang.String>>> |
createLocalStreamServer(IoHandlerFactory<? super StreamChannel> handlerFactory)
Create a local stream server. |
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. |
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 |
---|
public static Xnio create() throws java.io.IOException
xnio.provider
system property. Any failure to create the XNIO provider will cause an java.io.IOException
to be thrown.
java.io.IOException
- the the XNIO provider could not be createdpublic ConfigurableFactory<BoundServer<java.net.SocketAddress,BoundChannel<java.net.SocketAddress>>> createTcpServer(java.util.concurrent.Executor executor, IoHandlerFactory<? super TcpChannel> handlerFactory, java.net.SocketAddress... bindAddresses)
executor
- 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)
handlerFactory
- the factory which will produce handlers for inbound connectionsbindAddresses
- the addresses to bind to
public ConfigurableFactory<CloseableTcpConnector> createTcpConnector(java.util.concurrent.Executor executor)
executor
- the executor to use to execute the handlers
public ConfigurableFactory<CloseableTcpConnector> createTcpConnector()
public ConfigurableFactory<BoundServer<java.net.SocketAddress,UdpChannel>> createUdpServer(java.util.concurrent.Executor executor, boolean multicast, IoHandlerFactory<? super UdpChannel> handlerFactory, java.net.SocketAddress... bindAddresses)
executor
- 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)
multicast
- 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)
executor
- the executor to use to execute the handlershandlerFactory
- the server handler factory
public ChannelSource<StreamChannel> createPipeServer(IoHandlerFactory<? super StreamChannel> handlerFactory)
handlerFactory
- the server handler factory
public ChannelSource<StreamSourceChannel> createPipeSourceServer(java.util.concurrent.Executor executor, IoHandlerFactory<? super StreamSinkChannel> handlerFactory)
executor
- the executor to use to execute the handlershandlerFactory
- the server handler factory
public ChannelSource<StreamSourceChannel> createPipeSourceServer(IoHandlerFactory<? super StreamSinkChannel> handlerFactory)
handlerFactory
- the server handler factory
public ChannelSource<StreamSinkChannel> createPipeSinkServer(java.util.concurrent.Executor executor, IoHandlerFactory<? super StreamSourceChannel> handlerFactory)
executor
- the executor to use to execute the handlershandlerFactory
- the server handler factory
public ChannelSource<StreamSinkChannel> createPipeSinkServer(IoHandlerFactory<? super StreamSourceChannel> handlerFactory)
handlerFactory
- the server handler factory
public IoFuture<java.io.Closeable> createPipeConnection(java.util.concurrent.Executor executor, IoHandler<? super StreamChannel> leftHandler, IoHandler<? super StreamChannel> rightHandler)
executor
- 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)
leftHandler
- 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)
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<java.io.Closeable> createOneWayPipeConnection(IoHandler<? super StreamSourceChannel> sourceHandler, IoHandler<? super StreamSinkChannel> sinkHandler)
sourceHandler
- 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)
executor
- the executor to use to execute the handlers
public ConfigurableFactory<CloseableTcpAcceptor> createTcpAcceptor()
public ConfigurableFactory<BoundServer<java.lang.String,BoundChannel<java.lang.String>>> createLocalStreamServer(java.util.concurrent.Executor executor, IoHandlerFactory<? super ConnectedStreamChannel<java.lang.String>> handlerFactory)
executor
- the executor to use to execute the handlershandlerFactory
- the factory which will produce handlers for inbound connections
public ConfigurableFactory<BoundServer<java.lang.String,BoundChannel<java.lang.String>>> createLocalStreamServer(IoHandlerFactory<? super StreamChannel> handlerFactory)
handlerFactory
- the factory which will produce handlers for inbound connections
public ConfigurableFactory<CloseableConnector<java.lang.String,ConnectedStreamChannel<java.lang.String>>> createLocalStreamConnector(java.util.concurrent.Executor executor)
executor
- the executor to use to execute the handlers
public ConfigurableFactory<CloseableConnector<java.lang.String,ConnectedStreamChannel<java.lang.String>>> createLocalStreamConnector()
public ConfigurableFactory<BoundServer<java.lang.String,BoundChannel<java.lang.String>>> createLocalDatagramServer(java.util.concurrent.Executor executor, IoHandlerFactory<? super DatagramChannel<java.lang.String>> handlerFactory)
executor
- the executor to use to execute the handlershandlerFactory
- the factory which will produce handlers for inbound connections
public ConfigurableFactory<BoundServer<java.lang.String,BoundChannel<java.lang.String>>> createLocalDatagramServer(IoHandlerFactory<? super DatagramChannel<java.lang.String>> handlerFactory)
handlerFactory
- the factory which will produce handlers for inbound connections
public ConfigurableFactory<CloseableConnector<java.lang.String,DatagramChannel<java.lang.String>>> createLocalDatagramConnector(java.util.concurrent.Executor executor)
executor
- the executor to use to execute the handlers
public ConfigurableFactory<CloseableConnector<java.lang.String,DatagramChannel<java.lang.String>>> createLocalDatagramConnector()
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.Closeable
java.io.IOException
protected java.lang.String getProperty(java.lang.String name)
"xnio."
.
name
- the property name
null
if it wasn't foundprotected 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
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |