Class ResinRun

  • All Implemented Interfaces:
    Runnable

    public class ResinRun
    extends Thread
    Starts/stop Resin by setting up a listener socket. Supports Resin 3.x onwards.

    When this application is first called to start the server, a listener socket is set up. Then, when it is later called to stop the server, we connect to the listener socket and tell the server to stop.
    • Field Detail

      • DEFAULT_KEEPALIVE_SOCKET_PORT

        public static final int DEFAULT_KEEPALIVE_SOCKET_PORT
        Default keepalive socket port for Resin. We create a server socket on this port that acts as a keepalive for Resin. When this socket closes Resin stops. This is a Resin feature.
        See Also:
        Constant Field Values
    • Constructor Detail

      • ResinRun

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

      • main

        public static void main​(String[] args)
        Entry point to start/stop the Resin server.
        Parameters:
        args - the command line arguments
      • 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
      • doStartServer

        protected void doStartServer​(String[] args)
        Start the Resin server. We use reflection so that the Resin jars do not need to be in the classpath to compile this class.
        Parameters:
        args - the command line arguments
      • doStopServer

        protected void doStopServer​(String[] args)
        Stops the Resin server by closing the keepalive socket.
        Parameters:
        args - the command line arguments