Package edu.jas.util
Class ExecutableServer
java.lang.Object
java.lang.Thread
edu.jas.util.ExecutableServer
- All Implemented Interfaces:
Runnable
ExecutableServer is used to receive and execute classes.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ChannelFactory
ChannelFactory to use.private static final boolean
static final int
Default port to listen to.static final String
Constant to signal completion.private boolean
private static final org.apache.logging.log4j.Logger
private Thread
List of server threads.static final String
Constant to request shutdown.Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
Constructor Summary
ConstructorsConstructorDescriptionExecutableServer on default port.ExecutableServer
(int port) ExecutableServer.ExecutableServer. -
Method Summary
Methods inherited from class java.lang.Thread
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, yield
-
Field Details
-
logger
private static final org.apache.logging.log4j.Logger logger -
debug
private static final boolean debug -
cf
ChannelFactory to use. -
servers
List of server threads. -
DEFAULT_PORT
public static final int DEFAULT_PORTDefault port to listen to.- See Also:
-
DONE
Constant to signal completion.- See Also:
-
STOP
Constant to request shutdown.- See Also:
-
goon
private volatile boolean goon -
mythread
-
-
Constructor Details
-
ExecutableServer
public ExecutableServer()ExecutableServer on default port. -
ExecutableServer
public ExecutableServer(int port) ExecutableServer.- Parameters:
port
-
-
ExecutableServer
ExecutableServer.- Parameters:
cf
- channel factory to reuse.
-
-
Method Details
-
main
main method to start serving thread.- Parameters:
args
- args[0] is port- Throws:
InterruptedException
-
init
public void init()thread initialization and start. -
size
public int size()number of servers. -
run
public void run()run is main server method. -
terminate
public void terminate()terminate all servers. -
toString
String representation.
-