public abstract class XnioIoThread extends Thread implements XnioExecutor, XnioIoFactory
Thread.State, Thread.UncaughtExceptionHandler
XnioExecutor.Key
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Modifier | Constructor and Description |
---|---|
protected |
XnioIoThread(XnioWorker worker,
int number)
Construct a new instance.
|
protected |
XnioIoThread(XnioWorker worker,
int number,
String name)
Construct a new instance.
|
protected |
XnioIoThread(XnioWorker worker,
int number,
ThreadGroup group,
String name)
Construct a new instance.
|
protected |
XnioIoThread(XnioWorker worker,
int number,
ThreadGroup group,
String name,
long stackSize)
Construct a new instance.
|
Modifier and Type | Method and Description |
---|---|
protected IoFuture<MessageConnection> |
acceptLocalMessageConnection(LocalSocketAddress destination,
ChannelListener<? super MessageConnection> openListener,
ChannelListener<? super BoundChannel> bindListener,
OptionMap optionMap)
Implementation helper method to accept a local (UNIX domain) datagram connection.
|
protected IoFuture<StreamConnection> |
acceptLocalStreamConnection(LocalSocketAddress destination,
ChannelListener<? super StreamConnection> openListener,
ChannelListener<? super BoundChannel> bindListener,
OptionMap optionMap)
Implementation helper method to accept a local (UNIX domain) stream connection.
|
IoFuture<MessageConnection> |
acceptMessageConnection(SocketAddress destination,
ChannelListener<? super MessageConnection> openListener,
ChannelListener<? super BoundChannel> bindListener,
OptionMap optionMap)
Accept a message connection at a destination address.
|
IoFuture<StreamConnection> |
acceptStreamConnection(SocketAddress destination,
ChannelListener<? super StreamConnection> openListener,
ChannelListener<? super BoundChannel> bindListener,
OptionMap optionMap)
Accept a stream connection at a destination address.
|
protected IoFuture<StreamConnection> |
acceptTcpStreamConnection(InetSocketAddress destination,
ChannelListener<? super StreamConnection> openListener,
ChannelListener<? super BoundChannel> bindListener,
OptionMap optionMap)
Implementation helper method to accept a TCP connection.
|
ChannelPipe<StreamChannel,StreamChannel> |
createFullDuplexPipe()
Create a two-way stream pipe.
|
ChannelPipe<StreamConnection,StreamConnection> |
createFullDuplexPipeConnection()
Create a two-way stream pipe.
|
ChannelPipe<StreamConnection,StreamConnection> |
createFullDuplexPipeConnection(XnioIoFactory peer)
Create a two-way stream pipe.
|
ChannelPipe<StreamSourceChannel,StreamSinkChannel> |
createHalfDuplexPipe()
Create a one-way stream pipe.
|
ChannelPipe<StreamSourceChannel,StreamSinkChannel> |
createHalfDuplexPipe(XnioIoFactory peer)
Create a one-way stream pipe.
|
static XnioIoThread |
currentThread()
Get the current XNIO thread.
|
int |
getNumber()
Get the number of this thread.
|
XnioWorker |
getWorker()
Get the XNIO worker associated with this thread.
|
protected IoFuture<MessageConnection> |
openLocalMessageConnection(LocalSocketAddress bindAddress,
LocalSocketAddress destinationAddress,
ChannelListener<? super MessageConnection> openListener,
OptionMap optionMap)
Implementation helper method to connect to a local (UNIX domain) server.
|
protected IoFuture<StreamConnection> |
openLocalStreamConnection(LocalSocketAddress bindAddress,
LocalSocketAddress destinationAddress,
ChannelListener<? super StreamConnection> openListener,
ChannelListener<? super BoundChannel> bindListener,
OptionMap optionMap)
Implementation helper method to connect to a local (UNIX domain) server.
|
IoFuture<MessageConnection> |
openMessageConnection(SocketAddress destination,
ChannelListener<? super MessageConnection> openListener,
OptionMap optionMap)
Connect to a remote message server.
|
IoFuture<StreamConnection> |
openStreamConnection(SocketAddress destination,
ChannelListener<? super StreamConnection> openListener,
ChannelListener<? super BoundChannel> bindListener,
OptionMap optionMap)
Connect to a remote stream server.
|
IoFuture<StreamConnection> |
openStreamConnection(SocketAddress destination,
ChannelListener<? super StreamConnection> openListener,
OptionMap optionMap)
Connect to a remote stream server.
|
IoFuture<StreamConnection> |
openStreamConnection(SocketAddress bindAddress,
SocketAddress destination,
ChannelListener<? super StreamConnection> openListener,
ChannelListener<? super BoundChannel> bindListener,
OptionMap optionMap)
Connect to a remote stream server.
|
protected IoFuture<StreamConnection> |
openTcpStreamConnection(InetSocketAddress bindAddress,
InetSocketAddress destinationAddress,
ChannelListener<? super StreamConnection> openListener,
ChannelListener<? super BoundChannel> bindListener,
OptionMap optionMap)
Implementation helper method to connect to a TCP server.
|
static XnioIoThread |
requireCurrentThread()
Get the current XNIO thread.
|
activeCount, checkAccess, clone, countStackFrames, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
execute, executeAfter, executeAtInterval
protected XnioIoThread(XnioWorker worker, int number)
worker
- the XNIO worker to associate withnumber
- the thread numberprotected XnioIoThread(XnioWorker worker, int number, String name)
worker
- the XNIO worker to associate withnumber
- the thread numbername
- the thread nameprotected XnioIoThread(XnioWorker worker, int number, ThreadGroup group, String name)
worker
- the XNIO worker to associate withnumber
- the thread numbergroup
- the thread groupname
- the thread nameprotected XnioIoThread(XnioWorker worker, int number, ThreadGroup group, String name, long stackSize)
worker
- the XNIO worker to associate withnumber
- the thread numbergroup
- the thread groupname
- the thread namestackSize
- the thread stack sizepublic static XnioIoThread currentThread()
null
is returned.public static XnioIoThread requireCurrentThread() throws IllegalStateException
IllegalStateException
is
thrown.IllegalStateException
- if the current thread is not an XNIO threadpublic int getNumber()
public XnioWorker getWorker()
public IoFuture<StreamConnection> acceptStreamConnection(SocketAddress destination, ChannelListener<? super StreamConnection> openListener, ChannelListener<? super BoundChannel> bindListener, OptionMap optionMap)
XnioIoFactory
acceptStreamConnection
in interface XnioIoFactory
destination
- the destination (bind) addressopenListener
- the listener which will be notified when the channel is open, or null
for nonebindListener
- the listener which will be notified when the acceptor is bound, or null
for noneoptionMap
- the option mapprotected IoFuture<StreamConnection> acceptLocalStreamConnection(LocalSocketAddress destination, ChannelListener<? super StreamConnection> openListener, ChannelListener<? super BoundChannel> bindListener, OptionMap optionMap)
destination
- the destination (bind) addressopenListener
- the listener which will be notified when the channel is open, or null
for nonebindListener
- the listener which will be notified when the acceptor is bound, or null
for noneoptionMap
- the option mapprotected IoFuture<StreamConnection> acceptTcpStreamConnection(InetSocketAddress destination, ChannelListener<? super StreamConnection> openListener, ChannelListener<? super BoundChannel> bindListener, OptionMap optionMap)
destination
- the destination (bind) addressopenListener
- the listener which will be notified when the channel is open, or null
for nonebindListener
- the listener which will be notified when the acceptor is bound, or null
for noneoptionMap
- the option mappublic IoFuture<MessageConnection> openMessageConnection(SocketAddress destination, ChannelListener<? super MessageConnection> openListener, OptionMap optionMap)
XnioIoFactory
IoFuture
, and vice-versa.openMessageConnection
in interface XnioIoFactory
destination
- the destination addressopenListener
- the listener which will be notified when the channel is open, or null
for noneoptionMap
- the option mappublic IoFuture<MessageConnection> acceptMessageConnection(SocketAddress destination, ChannelListener<? super MessageConnection> openListener, ChannelListener<? super BoundChannel> bindListener, OptionMap optionMap)
XnioIoFactory
IoFuture
, and vice-versa.acceptMessageConnection
in interface XnioIoFactory
destination
- the destination (bind) addressopenListener
- the listener which will be notified when the channel is open, or null
for nonebindListener
- the listener which will be notified when the acceptor is bound, or null
for noneoptionMap
- the option mapprotected IoFuture<MessageConnection> acceptLocalMessageConnection(LocalSocketAddress destination, ChannelListener<? super MessageConnection> openListener, ChannelListener<? super BoundChannel> bindListener, OptionMap optionMap)
destination
- the destination (bind) addressopenListener
- the listener which will be notified when the channel is open, or null
for nonebindListener
- the listener which will be notified when the acceptor is bound, or null
for noneoptionMap
- the option mappublic IoFuture<StreamConnection> openStreamConnection(SocketAddress destination, ChannelListener<? super StreamConnection> openListener, OptionMap optionMap)
XnioIoFactory
IoFuture
, and vice-versa.openStreamConnection
in interface XnioIoFactory
destination
- the destination addressopenListener
- the listener which will be notified when the channel is open, or null
for noneoptionMap
- the option mappublic IoFuture<StreamConnection> openStreamConnection(SocketAddress destination, ChannelListener<? super StreamConnection> openListener, ChannelListener<? super BoundChannel> bindListener, OptionMap optionMap)
XnioIoFactory
IoFuture
, and vice-versa.openStreamConnection
in interface XnioIoFactory
destination
- the destination addressopenListener
- the listener which will be notified when the channel is open, or null
for nonebindListener
- the listener which will be notified when the channel is bound, or null
for noneoptionMap
- the option mappublic IoFuture<StreamConnection> openStreamConnection(SocketAddress bindAddress, SocketAddress destination, ChannelListener<? super StreamConnection> openListener, ChannelListener<? super BoundChannel> bindListener, OptionMap optionMap)
XnioIoFactory
IoFuture
, and vice-versa.openStreamConnection
in interface XnioIoFactory
bindAddress
- the local address to bind todestination
- the destination addressopenListener
- the listener which will be notified when the channel is open, or null
for nonebindListener
- the listener which will be notified when the channel is bound, or null
for noneoptionMap
- the option mapprotected IoFuture<StreamConnection> openTcpStreamConnection(InetSocketAddress bindAddress, InetSocketAddress destinationAddress, ChannelListener<? super StreamConnection> openListener, ChannelListener<? super BoundChannel> bindListener, OptionMap optionMap)
bindAddress
- the bind addressdestinationAddress
- the destination addressopenListener
- the listener which will be notified when the channel is open, or null
for nonebindListener
- the listener which will be notified when the channel is bound, or null
for noneoptionMap
- the option mapprotected IoFuture<StreamConnection> openLocalStreamConnection(LocalSocketAddress bindAddress, LocalSocketAddress destinationAddress, ChannelListener<? super StreamConnection> openListener, ChannelListener<? super BoundChannel> bindListener, OptionMap optionMap)
bindAddress
- the bind addressdestinationAddress
- the destination addressopenListener
- the listener which will be notified when the channel is open, or null
for nonebindListener
- the listener which will be notified when the channel is bound, or null
for noneoptionMap
- the option mapprotected IoFuture<MessageConnection> openLocalMessageConnection(LocalSocketAddress bindAddress, LocalSocketAddress destinationAddress, ChannelListener<? super MessageConnection> openListener, OptionMap optionMap)
bindAddress
- the bind addressdestinationAddress
- the destination addressopenListener
- the listener which will be notified when the channel is open, or null
for noneoptionMap
- the option mappublic ChannelPipe<StreamChannel,StreamChannel> createFullDuplexPipe() throws IOException
XnioIoFactory
createFullDuplexPipe
in interface XnioIoFactory
IOException
- if the pipe could not be createdpublic ChannelPipe<StreamConnection,StreamConnection> createFullDuplexPipeConnection() throws IOException
XnioIoFactory
createFullDuplexPipeConnection
in interface XnioIoFactory
IOException
- if the pipe could not be createdpublic ChannelPipe<StreamSourceChannel,StreamSinkChannel> createHalfDuplexPipe() throws IOException
XnioIoFactory
createHalfDuplexPipe
in interface XnioIoFactory
IOException
- if the pipe could not be createdpublic ChannelPipe<StreamConnection,StreamConnection> createFullDuplexPipeConnection(XnioIoFactory peer) throws IOException
XnioIoFactory
createFullDuplexPipeConnection
in interface XnioIoFactory
peer
- the peer to use for controlling the remote (right) sideIOException
- if the pipe could not be createdpublic ChannelPipe<StreamSourceChannel,StreamSinkChannel> createHalfDuplexPipe(XnioIoFactory peer) throws IOException
XnioIoFactory
createHalfDuplexPipe
in interface XnioIoFactory
peer
- the peer to use for the sink (right) sideIOException
- if the pipe could not be createdCopyright © 2021 JBoss by Red Hat. All rights reserved.