Package edu.jas.util

Class ExecutableServer

java.lang.Object
java.lang.Thread
edu.jas.util.ExecutableServer
All Implemented Interfaces:
Runnable

public class ExecutableServer extends Thread
ExecutableServer is used to receive and execute classes.
  • Field Details

    • logger

      private static final org.apache.logging.log4j.Logger logger
    • debug

      private static final boolean debug
    • cf

      protected final ChannelFactory cf
      ChannelFactory to use.
    • servers

      protected List<Executor> servers
      List of server threads.
    • DEFAULT_PORT

      public static final int DEFAULT_PORT
      Default port to listen to.
      See Also:
    • DONE

      public static final String DONE
      Constant to signal completion.
      See Also:
    • STOP

      public static final String STOP
      Constant to request shutdown.
      See Also:
    • goon

      private volatile boolean goon
    • mythread

      private volatile Thread mythread
  • Constructor Details

    • ExecutableServer

      public ExecutableServer()
      ExecutableServer on default port.
    • ExecutableServer

      public ExecutableServer(int port)
      ExecutableServer.
      Parameters:
      port -
    • ExecutableServer

      public ExecutableServer(ChannelFactory cf)
      ExecutableServer.
      Parameters:
      cf - channel factory to reuse.
  • Method Details

    • main

      public static void main(String[] args) throws InterruptedException
      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.
      Specified by:
      run in interface Runnable
      Overrides:
      run in class Thread
    • terminate

      public void terminate()
      terminate all servers.
    • toString

      public String toString()
      String representation.
      Overrides:
      toString in class Thread