Class AbstractJMXServer

java.lang.Object
org.jppf.management.AbstractJMXServer
All Implemented Interfaces:
JMXServer
Direct Known Subclasses:
JMXMPServer, JPPFJMXServer

public abstract class AbstractJMXServer extends Object implements JMXServer
This class is a wrapper around a JMX management server. It is used essentially to hide the details of the remote management protocol used.
Author:
Laurent Cohen
  • Field Details

    • lock

      protected static Lock lock
      Used to synchronize lookup for available port.
    • mbeanServer

      protected final MBeanServer mbeanServer
      The mbean server.
    • connectorServer

      protected JMXConnectorServer connectorServer
      The JMX connector server.
    • stopped

      protected boolean stopped
      Determines whether this JMX server is stopped.
    • uuid

      protected String uuid
      This server's unique id.
    • managementHost

      protected String managementHost
      The host interface on which the JMX server is listeneing for connections.
    • managementPort

      protected int managementPort
      The port on which the connector is listening for connections from remote clients.
    • ssl

      protected boolean ssl
      Determines whether JMX should be used over an SSL/TLS connection.
    • forwarder

      protected MBeanServerForwarder forwarder
      An optional MBeanServerForwarder associated with the JMXConnectorServer.
    • config

      protected final TypedProperties config
      The configuration to use.
  • Constructor Details

    • AbstractJMXServer

      protected AbstractJMXServer(TypedProperties config, MBeanServer mbeanServer)
      Parameters:
      config - the configuration to use.
      mbeanServer - the mbean server to use.
  • Method Details

    • stop

      public void stop() throws Exception
      Description copied from interface: JMXServer
      Stop the MBean server and associated resources.
      Specified by:
      stop in interface JMXServer
      Throws:
      Exception - if an error occurs when stopping the server or one of its components.
    • getMBeanServer

      public MBeanServer getMBeanServer()
      Description copied from interface: JMXServer
      Get a reference to the MBean server.
      Specified by:
      getMBeanServer in interface JMXServer
      Returns:
      an MBeanServer instance.
    • isStopped

      public boolean isStopped()
      Description copied from interface: JMXServer
      Determine whether this JMX server is stopped.
      Specified by:
      isStopped in interface JMXServer
      Returns:
      true if this JMX server is stopped, false otherwise.
    • getUuid

      public String getUuid()
      Description copied from interface: JMXServer
      Get a unique identifier for this management server. This id must be unique across JPPF nodes and servers.
      Specified by:
      getUuid in interface JMXServer
      Returns:
      the id as a string.
    • getManagementPort

      public int getManagementPort()
      Description copied from interface: JMXServer
      Get the port on which the connector is listening for connections from remote clients.
      Specified by:
      getManagementPort in interface JMXServer
      Returns:
      the port number as an int.
    • getManagementHost

      public String getManagementHost()
      Description copied from interface: JMXServer
      Get the host interface on which the JMX server is listeneing for connections.
      Specified by:
      getManagementHost in interface JMXServer
      Returns:
      the host as a string.
    • getConnectorServer

      public JMXConnectorServer getConnectorServer()
      Description copied from interface: JMXServer
      Get the JMX connector server.
      Specified by:
      getConnectorServer in interface JMXServer
      Returns:
      a JMXConnectorServer instance.
    • getMBeanServerForwarder

      public MBeanServerForwarder getMBeanServerForwarder()
      Description copied from interface: JMXServer
      Get an optional MBeanServerForwarder associated with the underlying remote connector server.
      Specified by:
      getMBeanServerForwarder in interface JMXServer
      Returns:
      an MBeanServerForwarder instance, or null if node is associated with this jmx server.
    • getEnvironment

      public Map<String,?> getEnvironment()
      Description copied from interface: JMXServer
      Get the environment used at the creation of this server.
      Specified by:
      getEnvironment in interface JMXServer
      Returns:
      a JMX environment map.
    • startConnectorServer

      protected void startConnectorServer(String protocol, Map<String,Object> env) throws Exception
      Start the underlying conector server.
      Parameters:
      protocol - the connector server protocol.
      env - the environment parameters passed on to the server.
      Throws:
      Exception - if any eror occyrs.