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 routeWhether to register mbeans for routes created by a KameletWhether to register mbeans for routes created by a route templates (not Kamelets)§ Gets the statistics levelGets whether updating routes via JMX is allowed (is default disabled).Gets whether host IP Address to be used instead of host name.Whether to use the platform MBean Server.booleanisRegistered(ObjectName name) Is the given object registered<T> TnewProxyClient(ObjectName name, Class<T> mbean) Creates a new proxy clientvoidregister(Object obj, ObjectName name) Registers object with management infrastructure with a specific name.voidregister(Object obj, ObjectName name, boolean forceRegistration) Registers object with management infrastructure with a specific name.voidSets whether endpoint runtime statistics is enabled (gathers runtime usage of each incoming and outgoing endpoints).voidsetIncludeHostName(Boolean includeHostName) Sets whether to include host name in theManagementObjectNameStrategy.voidSets whether load statistics is enabled (gathers load statistics using a background thread per CamelContext).voidsetManagementNamePattern(String managementNamePattern) The naming pattern for creating the CamelContext management name.voidWhether to remove detected sensitive information (such as passwords) from MBean names and attributes.voidsetMBeanObjectDomainName(String domainName) Sets the object domain namevoidsetMBeanServer(MBeanServer mbeanServer) Sets a custom mbean server to usevoidsetMBeanServerDefaultDomain(String domain) Sets the default domain on the MBean servervoidSets the mbeans registration levelvoidsetOnlyRegisterProcessorWithCustomId(Boolean onlyRegisterProcessorWithCustomId) Whether to only register processors which has a custom id assigned.voidsetRegisterAlways(Boolean registerAlways) Whether to always register mbeans.voidsetRegisterNewRoutes(Boolean registerNewRoutes) Whether to register mbeans when starting a new routevoidsetRegisterRoutesCreateByKamelet(Boolean registerRoutesCreateByKamelet) Whether to register mbeans for routes created by a KameletvoidsetRegisterRoutesCreateByTemplate(Boolean registerRoutesCreateByTemplate) Whether to register mbeans for routes created by a route templates (not Kamelets)voidSets the statistics levelvoidsetUpdateRouteEnabled(Boolean updateRouteEnabled) Sets whether updating routes via JMX is allowed (is default disabled).voidsetUseHostIPAddress(Boolean useHostIPAddress) Sets whether to use host IP AddressvoidsetUsePlatformMBeanServer(Boolean usePlatformMBeanServer) Whether to use the platform MBean Server.voidunregister(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 thepackage.invalid reference
org.apache.camel.api.management.mbean- Returns:
- the client or null if mbean does not exist
-
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
-
getRegisterRoutesCreateByKamelet
Boolean getRegisterRoutesCreateByKamelet()Whether to register mbeans for routes created by a Kamelet This option is default false. -
setRegisterRoutesCreateByKamelet
Whether to register mbeans for routes created by a Kamelet This option is default false. -
getRegisterRoutesCreateByTemplate
Boolean getRegisterRoutesCreateByTemplate()Whether to register mbeans for routes created by a route templates (not Kamelets) This option is default true. -
setRegisterRoutesCreateByTemplate
Whether to register mbeans for routes created by a route templates (not Kamelets) This option is default true. -
getMask
Boolean getMask()Whether to remove detected sensitive information (such as passwords) from MBean names and attributes. This option is default true. -
setMask
Whether to remove detected sensitive information (such as passwords) from MBean names and attributes. This option is default true. -
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.DefaultThe 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.
-
getUpdateRouteEnabled
Boolean getUpdateRouteEnabled()Gets whether updating routes via JMX is allowed (is default disabled). -
setUpdateRouteEnabled
Sets whether updating routes via JMX is allowed (is default disabled).
-