Package org.apache.camel.spi
Interface ManagementAgent
- All Superinterfaces:
AutoCloseable
,Service
Camel JMX service agent
-
Method Summary
Modifier and TypeMethodDescriptionGets whether endpoint runtime statistics is enabledGets whether host name is included in MBean names.Gets whether load statistics is enabledThe naming pattern for creating the CamelContext management name.getMask()
Whether to remove detected sensitive information (such as passwords) from MBean names and attributes.Get domain name for Camel MBeans.Get the MBeanServer which hosts managed objects.Gets the default domain on the MBean server§ Gets the mbeans registration levelWhether to only register processors which has a custom id assigned.Whether to always register mbeans.Whether to register mbeans when starting a new route§ Gets the statistics levelGets whether host IP Address to be used instead of host name.Whether to use the platform MBean Server.boolean
isRegistered
(ObjectName name) Is the given object registered<T> T
newProxyClient
(ObjectName name, Class<T> mbean) Creates a new proxy clientvoid
register
(Object obj, ObjectName name) Registers object with management infrastructure with a specific name.void
register
(Object obj, ObjectName name, boolean forceRegistration) Registers object with management infrastructure with a specific name.void
Sets whether endpoint runtime statistics is enabled (gathers runtime usage of each incoming and outgoing endpoints).void
setIncludeHostName
(Boolean includeHostName) Sets whether to include host name in theManagementObjectNameStrategy
.void
Sets whether load statistics is enabled (gathers load statistics using a background thread per CamelContext).void
setManagementNamePattern
(String managementNamePattern) The naming pattern for creating the CamelContext management name.void
Whether to remove detected sensitive information (such as passwords) from MBean names and attributes.void
setMBeanObjectDomainName
(String domainName) Sets the object domain namevoid
setMBeanServer
(MBeanServer mbeanServer) Sets a custom mbean server to usevoid
setMBeanServerDefaultDomain
(String domain) Sets the default domain on the MBean servervoid
Sets the mbeans registration levelvoid
setOnlyRegisterProcessorWithCustomId
(Boolean onlyRegisterProcessorWithCustomId) Whether to only register processors which has a custom id assigned.void
setRegisterAlways
(Boolean registerAlways) Whether to always register mbeans.void
setRegisterNewRoutes
(Boolean registerNewRoutes) Whether to register mbeans when starting a new routevoid
Sets the statistics levelvoid
setUseHostIPAddress
(Boolean useHostIPAddress) Sets whether to use host IP Addressvoid
setUsePlatformMBeanServer
(Boolean usePlatformMBeanServer) Whether to use the platform MBean Server.void
unregister
(ObjectName name) Unregisters object based upon registered name
-
Method Details
-
register
Registers object with management infrastructure with a specific name. Object must be annotated or implement standard MBean interface.- Parameters:
obj
- the object to registername
- the name- Throws:
JMException
- is thrown if the registration failed
-
register
Registers object with management infrastructure with a specific name. Object must be annotated or implement standard MBean interface.- Parameters:
obj
- the object to registername
- the nameforceRegistration
- if set to true, then object will be registered despite existing object is already registered with the name.- Throws:
JMException
- is thrown if the registration failed
-
unregister
Unregisters object based upon registered name- Parameters:
name
- the name- Throws:
JMException
- is thrown if the unregistration failed
-
isRegistered
Is the given object registered- Parameters:
name
- the name- Returns:
- true if registered
-
newProxyClient
Creates a new proxy client- Parameters:
name
- the mbean namembean
- the client interface, such as from theorg.apache.camel.api.management.mbean
package.- Returns:
- the client or null if mbean does not exists
-
getMBeanServer
MBeanServer getMBeanServer()Get the MBeanServer which hosts managed objects. Notice: If the JMXEnabled configuration is not set to true, this method will return null.- Returns:
- the MBeanServer
-
setMBeanServer
Sets a custom mbean server to use- Parameters:
mbeanServer
- the custom mbean server
-
getMBeanObjectDomainName
String getMBeanObjectDomainName()Get domain name for Camel MBeans. Notice: That this can be different that the default domain name of the MBean Server.- Returns:
- domain name
-
setMBeanServerDefaultDomain
Sets the default domain on the MBean server- Parameters:
domain
- the domain
-
getMBeanServerDefaultDomain
String getMBeanServerDefaultDomain()Gets the default domain on the MBean server- Returns:
- the domain
-
setMBeanObjectDomainName
Sets the object domain name- Parameters:
domainName
- the object domain name
-
setUsePlatformMBeanServer
Whether to use the platform MBean Server.- Parameters:
usePlatformMBeanServer
- true to use platform MBean server
-
getUsePlatformMBeanServer
Boolean getUsePlatformMBeanServer()Whether to use the platform MBean Server.- Returns:
- true if platform MBean server is to be used
-
getOnlyRegisterProcessorWithCustomId
Boolean getOnlyRegisterProcessorWithCustomId()Whether to only register processors which has a custom id assigned. This allows you to filter unwanted processors.- Returns:
- true if only processors with custom id is registered
-
setOnlyRegisterProcessorWithCustomId
Whether to only register processors which has a custom id assigned. This allows you to filter unwanted processors.- Parameters:
onlyRegisterProcessorWithCustomId
- true to only register if custom id has been assigned
-
getRegisterAlways
Boolean getRegisterAlways()Whether to always register mbeans. This option is default false. Important: If this option is enabled then any service is registered as mbean. When using dynamic EIP patterns using unique endpoint urls, you may create excessive mbeans in the registry. This could lead to degraded performance as memory consumption will rise due the rising number of mbeans.- Returns:
- true if always registering
-
setRegisterAlways
Whether to always register mbeans. This option is default false. Important: If this option is enabled then any service is registered as mbean. When using dynamic EIP patterns using unique endpoint urls, you may create excessive mbeans in the registry. This could lead to degraded performance as memory consumption will rise due the rising number of mbeans.- Parameters:
registerAlways
- true to always register
-
getRegisterNewRoutes
Boolean getRegisterNewRoutes()Whether to register mbeans when starting a new route This option is default true.- Returns:
- true to register when starting a new route
-
setRegisterNewRoutes
Whether to register mbeans when starting a new route This option is default true.- Parameters:
registerNewRoutes
- true to register when starting a new route
-
getMask
Boolean getMask()Whether to remove detected sensitive information (such as passwords) from MBean names and attributes. This option is default false. -
setMask
Whether to remove detected sensitive information (such as passwords) from MBean names and attributes. This option is default false. -
getIncludeHostName
Boolean getIncludeHostName()Gets whether host name is included in MBean names.- Returns:
- true if included
-
setIncludeHostName
Sets whether to include host name in theManagementObjectNameStrategy
. By default this is turned off from Camel 2.13 onwards, but this option can be set to true to include the hostname as Camel 2.12 or older releases does.- Parameters:
includeHostName
- true to include host name in the MBean names.
-
getManagementNamePattern
String getManagementNamePattern()The naming pattern for creating the CamelContext management name. The default pattern is #name# -
setManagementNamePattern
The naming pattern for creating the CamelContext management name. The default pattern is #name# -
setLoadStatisticsEnabled
Sets whether load statistics is enabled (gathers load statistics using a background thread per CamelContext). The default value is false- Parameters:
flag
- true to enable load statistics
-
getLoadStatisticsEnabled
Boolean getLoadStatisticsEnabled()Gets whether load statistics is enabled- Returns:
- true if enabled
-
setEndpointRuntimeStatisticsEnabled
Sets whether endpoint runtime statistics is enabled (gathers runtime usage of each incoming and outgoing endpoints). The default value is false- Parameters:
flag
- true to enable endpoint runtime statistics
-
getEndpointRuntimeStatisticsEnabled
Boolean getEndpointRuntimeStatisticsEnabled()Gets whether endpoint runtime statistics is enabled- Returns:
- true if enabled
-
setStatisticsLevel
Sets the statistics level Default isManagementStatisticsLevel.Default
The level can be set to Extended to gather additional information- Parameters:
level
- the new level
-
getStatisticsLevel
ManagementStatisticsLevel getStatisticsLevel()§ Gets the statistics level- Returns:
- the level
-
setMBeansLevel
Sets the mbeans registration level Default isManagementMBeansLevel.Default
- Parameters:
level
- the new level
-
getMBeansLevel
ManagementMBeansLevel getMBeansLevel()§ Gets the mbeans registration level- Returns:
- the level
-
getUseHostIPAddress
Boolean getUseHostIPAddress()Gets whether host IP Address to be used instead of host name.- Returns:
- true if included
-
setUseHostIPAddress
Sets whether to use host IP Address- Parameters:
useHostIPAddress
- true to use IP Address.
-