Class JmxConfiguration

java.lang.Object
io.micronaut.configuration.jmx.JmxConfiguration

@ConfigurationProperties("jmx") public class JmxConfiguration extends Object
Configuration properties for JMX. The agent id will be used to find an MBean server. If no servers are found, an exception will be thrown unless ignoreAgentNotFound is true. Next the default platform MBean server will be retrieved. If an error is thrown, a new MBean server will be created using the domain. The newly created server will be registered with the MBeanFactory if addToFactory is true.
Since:
1.0
Author:
James Kleeh
  • Field Details

  • Constructor Details

    • JmxConfiguration

      public JmxConfiguration()
  • Method Details

    • getAgentId

      public String getAgentId()
      If specified, it is expected the MBeanServerFactory.findMBeanServer(java.lang.String) will return a server. An error will be thrown otherwise.
      Returns:
      The agent id to find an existing MBean server
    • setAgentId

      public void setAgentId(String agentId)
      Sets the agent id.
      Parameters:
      agentId - The agent id
    • getDomain

      public String getDomain()
      Used if getAgentId() returns null and ManagementFactory.getPlatformMBeanServer() throws an exception.
      Returns:
      The domain to create a new MBean server with
    • setDomain

      public void setDomain(String domain)
      Sets the domain to create a new server with.
      Parameters:
      domain - The domain
    • isAddToFactory

      public boolean isAddToFactory()
      Only used if getAgentId() returns null and ManagementFactory.getPlatformMBeanServer() throws an exception.
      Returns:
      Whether a newly created MBean server will be kept in the MBeanServerFactory
    • setAddToFactory

      public void setAddToFactory(boolean addToFactory)
      Sets if the server should be kept in the factory. Default .
      Parameters:
      addToFactory - The add to factory flag
    • isIgnoreAgentNotFound

      public boolean isIgnoreAgentNotFound()
      If a server could not be found with the agentId, an exception will be thrown unless this method returns true.
      Returns:
      True, if the exception should not be thrown
    • setIgnoreAgentNotFound

      public void setIgnoreAgentNotFound(boolean ignoreAgentNotFound)
      Sets to ignore the exception if the agent is not found. Default .
      Parameters:
      ignoreAgentNotFound - The ignoreAgentNotFound
    • isRegisterEndpoints

      public boolean isRegisterEndpoints()
      If management beans should be registered for endpoints.
      Returns:
      True if endpoints should be registered
    • setRegisterEndpoints

      public void setRegisterEndpoints(boolean registerEndpoints)
      Sets if endpoints should be registered. Default .
      Parameters:
      registerEndpoints - The flag