Package io.micronaut.configuration.jmx
Class JmxConfiguration
java.lang.Object
io.micronaut.configuration.jmx.JmxConfiguration
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 Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionIf specified, it is expected theMBeanServerFactory.findMBeanServer(java.lang.String)
will return a server.Used ifgetAgentId()
returns null andManagementFactory.getPlatformMBeanServer()
throws an exception.boolean
Only used ifgetAgentId()
returns null andManagementFactory.getPlatformMBeanServer()
throws an exception.boolean
If a server could not be found with theagentId
, an exception will be thrown unless this method returns true.boolean
If management beans should be registered for endpoints.void
setAddToFactory
(boolean addToFactory) Sets if the server should be kept in the factory.void
setAgentId
(String agentId) Sets the agent id.void
Sets the domain to create a new server with.void
setIgnoreAgentNotFound
(boolean ignoreAgentNotFound) Sets to ignore the exception if the agent is not found.void
setRegisterEndpoints
(boolean registerEndpoints) Sets if endpoints should be registered.
-
Field Details
-
PREFIX
- See Also:
-
-
Constructor Details
-
JmxConfiguration
public JmxConfiguration()
-
-
Method Details
-
getAgentId
If specified, it is expected theMBeanServerFactory.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
Sets the agent id.- Parameters:
agentId
- The agent id
-
getDomain
Used ifgetAgentId()
returns null andManagementFactory.getPlatformMBeanServer()
throws an exception.- Returns:
- The domain to create a new MBean server with
-
setDomain
Sets the domain to create a new server with.- Parameters:
domain
- The domain
-
isAddToFactory
public boolean isAddToFactory()Only used ifgetAgentId()
returns null andManagementFactory.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 theagentId
, 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
-