Class JmxJetty9WebServer

java.lang.Object
com.j256.simplejmx.web.JmxJetty9WebServer
All Implemented Interfaces:
Closeable, AutoCloseable

public class JmxJetty9WebServer extends Object implements Closeable
Simple web-server which exposes JMX beans via HTTP. To use this class you need to provide a Jetty version 9 in your dependency list or classpath.
Author:
graywatson
  • Constructor Details

    • JmxJetty9WebServer

      public JmxJetty9WebServer()
    • JmxJetty9WebServer

      public JmxJetty9WebServer(InetAddress inetAddress, int serverPort)
    • JmxJetty9WebServer

      public JmxJetty9WebServer(int serverPort)
  • Method Details

    • start

      public void start() throws Exception
      Start the internal Jetty web server and configure the JmxWebHandler to handle the requests.
      Throws:
      Exception
    • stop

      public void stop() throws Exception
      Stop the internal web server and associated classes.
      Throws:
      Exception
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException
    • setServerAddress

      public void setServerAddress(InetAddress serverAddress)
      Optional address that the Jetty web server will be running on.
    • setServerPort

      public void setServerPort(int serverPort)
      Required port that the Jetty web server will be running on.
    • setMinNumThreads

      public void setMinNumThreads(int minNumThreads)
      Ignored. Used to be needed for Java 8.
    • setMaxNumThreads

      public void setMaxNumThreads(int maxNumThreads)
      Ignored. Used to be needed for Java 8.
    • setPathPrefix

      public void setPathPrefix(String pathPrefix)
      Prefix to all of the jmx web requests.