Class DefaultServerRun

  • All Implemented Interfaces:
    Runnable
    Direct Known Subclasses:
    ResinRun

    public class DefaultServerRun
    extends Thread
    Helper class to start/stop a container. When this application is first called to start the server, a listener socket is set up. Then, we it is later called to stop the server, we connect to the listener socket and tell the server to stop.
    • Constructor Detail

      • DefaultServerRun

        public DefaultServerRun​(String[] theArgs)
        Parameters:
        theArgs - the command line arguments
    • Method Detail

      • doStartServer

        protected void doStartServer​(String[] theArgs)
                              throws Exception
        Starts the server (in a blocking mode) and set up a socket listener.
        Parameters:
        theArgs - the command line arguments
        Throws:
        Exception - if any error happens when starting the server
      • doStopServer

        protected void doStopServer​(String[] theArgs)
                             throws Exception
        Stops the server by connecting to the socket set up when the server was started.
        Parameters:
        theArgs - the command line arguments
        Throws:
        Exception - if any error happens when stopping the server
      • doRun

        protected final void doRun()
        Parse and process the command line to start/stop the server.
      • run

        public void run()
        Sets up a listener socket and wait until we receive a request on it to stop the running server.
        Specified by:
        run in interface Runnable
        Overrides:
        run in class Thread