public abstract class Reactor extends Thread
Reactor
abstraction which reacts on
incoming messages and let ReactorClient
process
them.Thread.State, Thread.UncaughtExceptionHandler
MAX_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, yield
public Reactor() throws IOException
IOException
public void run()
public void queueFuture(Future<?> f)
public void wakeup()
public Future<ReactorListener> createListener(String hostname, int port, ReactorListener.EventListener owner) throws ClientConnectionException
ClientConnectionException
public ReactorClient createClient(String hostname, int port) throws ClientConnectionException
ClientConnectionException
public void close() throws IOException
IOException
protected abstract ReactorClient createClient(Reactor reactor, Selector selector, String hostname, int port) throws ClientConnectionException
ClientConnectionException
protected abstract ReactorClient createConnectedClient(Reactor reactor, Selector selector, String hostname, int port, SocketChannel channel) throws ClientConnectionException
ClientConnectionException
protected abstract String getReactorName()
Copyright © 2016. All rights reserved.