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
Fields -
Constructor Summary
Constructors -
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.booleanOnly used ifgetAgentId()returns null andManagementFactory.getPlatformMBeanServer()throws an exception.booleanIf a server could not be found with theagentId, an exception will be thrown unless this method returns true.booleanIf management beans should be registered for endpoints.voidsetAddToFactory(boolean addToFactory) Sets if the server should be kept in the factory.voidsetAgentId(String agentId) Sets the agent id.voidSets the domain to create a new server with.voidsetIgnoreAgentNotFound(boolean ignoreAgentNotFound) Sets to ignore the exception if the agent is not found.voidsetRegisterEndpoints(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
-