Class RemoteControlHttpServer

  • All Implemented Interfaces:
    java.lang.Runnable

    public class RemoteControlHttpServer
    extends java.lang.Thread
    Simple HTTP server that spawns a RequestProcessor for every connection. Taken from YWMS plugin by frsantos.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.lang.Thread

        java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
    • Constructor Summary

      Constructors 
      Constructor Description
      RemoteControlHttpServer​(int port, boolean ipv6)
      Constructor
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static void restartRemoteControlHttpServer()
      Starts or restarts the HTTP server
      void run()
      The main loop, spawns a RequestProcessor for each connection
      static void stopRemoteControlHttpServer()
      Stops the HTTP server
      void stopServer()
      Stops the HTTP server
      • Methods inherited from class java.lang.Thread

        activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • RemoteControlHttpServer

        public RemoteControlHttpServer​(int port,
                                       boolean ipv6)
                                throws java.io.IOException
        Constructor
        Parameters:
        port - The port this server will listen on
        ipv6 - Whether IPv6 or IPv4 server should be started
        Throws:
        java.io.IOException - when connection errors
        Since:
        8339
    • Method Detail

      • run

        public void run()
        The main loop, spawns a RequestProcessor for each connection
        Specified by:
        run in interface java.lang.Runnable
        Overrides:
        run in class java.lang.Thread
      • stopServer

        public void stopServer()
                        throws java.io.IOException
        Stops the HTTP server
        Throws:
        java.io.IOException - if any I/O error occurs