Package org.apache.camel.spi
Interface ManagementAgent
-
- All Superinterfaces:
AutoCloseable
,Service
public interface ManagementAgent extends Service
Camel JMX service agent
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Boolean
getEndpointRuntimeStatisticsEnabled()
Gets whether endpoint runtime statistics is enabledBoolean
getIncludeHostName()
Gets whether host name is included in MBean names.Boolean
getLoadStatisticsEnabled()
Gets whether load statistics is enabledString
getManagementNamePattern()
The naming pattern for creating the CamelContext management name.Boolean
getMask()
Whether to remove detected sensitive information (such as passwords) from MBean names and attributes.String
getMBeanObjectDomainName()
Get domain name for Camel MBeans.MBeanServer
getMBeanServer()
Get the MBeanServer which hosts managed objects.String
getMBeanServerDefaultDomain()
Gets the default domain on the MBean serverManagementMBeansLevel
getMBeansLevel()
§ Gets the mbeans registration levelBoolean
getOnlyRegisterProcessorWithCustomId()
Whether to only register processors which has a custom id assigned.Boolean
getRegisterAlways()
Whether to always register mbeans.Boolean
getRegisterNewRoutes()
Whether to register mbeans when starting a new routeManagementStatisticsLevel
getStatisticsLevel()
§ Gets the statistics levelBoolean
getUseHostIPAddress()
Gets whether host IP Address to be used instead of host name.Boolean
getUsePlatformMBeanServer()
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
setEndpointRuntimeStatisticsEnabled(Boolean flag)
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
setLoadStatisticsEnabled(Boolean flag)
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
setMask(Boolean sanitize)
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
setMBeansLevel(ManagementMBeansLevel level)
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
setStatisticsLevel(ManagementStatisticsLevel level)
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 Detail
-
register
void register(Object obj, ObjectName name) throws JMException
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
void register(Object obj, ObjectName name, boolean forceRegistration) throws JMException
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
void unregister(ObjectName name) throws JMException
Unregisters object based upon registered name- Parameters:
name
- the name- Throws:
JMException
- is thrown if the unregistration failed
-
isRegistered
boolean isRegistered(ObjectName name)
Is the given object registered- Parameters:
name
- the name- Returns:
- true if registered
-
newProxyClient
<T> T newProxyClient(ObjectName name, Class<T> mbean)
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
void setMBeanServer(MBeanServer mbeanServer)
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
void setMBeanServerDefaultDomain(String domain)
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
void setMBeanObjectDomainName(String domainName)
Sets the object domain name- Parameters:
domainName
- the object domain name
-
setUsePlatformMBeanServer
void setUsePlatformMBeanServer(Boolean usePlatformMBeanServer)
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
void setOnlyRegisterProcessorWithCustomId(Boolean onlyRegisterProcessorWithCustomId)
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
void setRegisterAlways(Boolean registerAlways)
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
void setRegisterNewRoutes(Boolean registerNewRoutes)
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
void setMask(Boolean sanitize)
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
void setIncludeHostName(Boolean includeHostName)
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
void setManagementNamePattern(String managementNamePattern)
The naming pattern for creating the CamelContext management name. The default pattern is #name#
-
setLoadStatisticsEnabled
void setLoadStatisticsEnabled(Boolean flag)
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
void setEndpointRuntimeStatisticsEnabled(Boolean flag)
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
void setStatisticsLevel(ManagementStatisticsLevel level)
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
void setMBeansLevel(ManagementMBeansLevel level)
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
void setUseHostIPAddress(Boolean useHostIPAddress)
Sets whether to use host IP Address- Parameters:
useHostIPAddress
- true to use IP Address.
-
-