public abstract class Reactor extends Thread
Reactor abstraction which reacts on
incoming messages and let ReactorClient process
them.Thread.State, Thread.UncaughtExceptionHandlerMAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| Constructor and Description |
|---|
Reactor() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected abstract ReactorClient |
createClient(Reactor reactor,
Selector selector,
String hostname,
int port) |
ReactorClient |
createClient(String hostname,
int port) |
protected abstract ReactorClient |
createConnectedClient(Reactor reactor,
Selector selector,
String hostname,
int port,
SocketChannel channel) |
Future<ReactorListener> |
createListener(String hostname,
int port,
ReactorListener.EventListener owner) |
protected abstract String |
getReactorName() |
void |
queueFuture(Future<?> f) |
void |
run()
Main loop for message processing.
|
void |
wakeup() |
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yieldpublic Reactor()
throws IOException
IOExceptionpublic void run()
public void queueFuture(Future<?> f)
public void wakeup()
public Future<ReactorListener> createListener(String hostname, int port, ReactorListener.EventListener owner) throws ClientConnectionException
ClientConnectionExceptionpublic ReactorClient createClient(String hostname, int port) throws ClientConnectionException
ClientConnectionExceptionpublic void close()
throws IOException
IOExceptionprotected abstract ReactorClient createClient(Reactor reactor, Selector selector, String hostname, int port) throws ClientConnectionException
ClientConnectionExceptionprotected abstract ReactorClient createConnectedClient(Reactor reactor, Selector selector, String hostname, int port, SocketChannel channel) throws ClientConnectionException
ClientConnectionExceptionprotected abstract String getReactorName()
Copyright © 2018. All Rights Reserved.