public class DefaultManagementAgent extends ServiceSupport implements ManagementAgent, CamelContextAware
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_CONNECTION_PORT |
static String |
DEFAULT_DOMAIN |
static String |
DEFAULT_HOST |
static int |
DEFAULT_REGISTRY_PORT |
static String |
DEFAULT_SERVICE_URL_PATH |
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending| Constructor and Description |
|---|
DefaultManagementAgent() |
DefaultManagementAgent(CamelContext camelContext) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
createJmxConnector(String host) |
protected void |
createMBeanServer() |
protected void |
doStart()
Implementations override this method to support customized start/stop.
|
protected void |
doStop()
Implementations override this method to support customized start/stop.
|
protected void |
finalizeSettings() |
protected MBeanServer |
findOrCreateMBeanServer() |
CamelContext |
getCamelContext()
Get the
CamelContext |
Integer |
getConnectorPort()
Gets the port clients must use to connect
|
Boolean |
getCreateConnector()
Whether connector is created, allowing clients to connect remotely
|
Boolean |
getIncludeHostName()
Gets whether host name is included in MBean names.
|
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 server
|
Boolean |
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 route
This option is default true.
|
Integer |
getRegistryPort()
Gets the port used by
LocateRegistry. |
String |
getServiceUrlPath()
Gets the service url
|
Boolean |
getUsePlatformMBeanServer()
Whether to use the platform MBean Server.
|
boolean |
isRegistered(ObjectName name)
Is the given object registered
|
void |
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 |
setCamelContext(CamelContext camelContext)
Injects the
CamelContext |
void |
setConnectorPort(Integer port)
Sets the port clients must use to connect
|
void |
setCreateConnector(Boolean flag)
Whether connector should be created, allowing clients to connect remotely
|
void |
setIncludeHostName(Boolean includeHostName)
Sets whether to include host name in the
ManagementNamingStrategy. |
void |
setMask(Boolean mask)
Whether to remove detected sensitive information (such as passwords) from MBean names and attributes.
|
void |
setMBeanObjectDomainName(String domainName)
Sets the object domain name
|
void |
setMBeanServer(MBeanServer mbeanServer)
Sets a custom mbean server to use
|
void |
setMBeanServerDefaultDomain(String domain)
Sets the default domain on the MBean server
|
void |
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 route
This option is default true.
|
void |
setRegistryPort(Integer port)
Sets the port used by
LocateRegistry. |
void |
setServiceUrlPath(String url)
Sets the service url
|
void |
setUsePlatformMBeanServer(Boolean flag)
Whether to use the platform MBean Server.
|
void |
unregister(ObjectName name)
Unregisters object based upon registered name
|
doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendpublic static final String DEFAULT_DOMAIN
public static final String DEFAULT_HOST
public static final int DEFAULT_REGISTRY_PORT
public static final int DEFAULT_CONNECTION_PORT
public static final String DEFAULT_SERVICE_URL_PATH
public DefaultManagementAgent()
public DefaultManagementAgent(CamelContext camelContext)
protected void finalizeSettings()
public void setRegistryPort(Integer port)
ManagementAgentLocateRegistry.setRegistryPort in interface ManagementAgentport - the portpublic Integer getRegistryPort()
ManagementAgentLocateRegistry.getRegistryPort in interface ManagementAgentpublic void setConnectorPort(Integer port)
ManagementAgentsetConnectorPort in interface ManagementAgentport - the portpublic Integer getConnectorPort()
ManagementAgentgetConnectorPort in interface ManagementAgentpublic void setMBeanServerDefaultDomain(String domain)
ManagementAgentsetMBeanServerDefaultDomain in interface ManagementAgentdomain - the domainpublic String getMBeanServerDefaultDomain()
ManagementAgentgetMBeanServerDefaultDomain in interface ManagementAgentpublic void setMBeanObjectDomainName(String domainName)
ManagementAgentsetMBeanObjectDomainName in interface ManagementAgentdomainName - the object domain namepublic String getMBeanObjectDomainName()
ManagementAgentgetMBeanObjectDomainName in interface ManagementAgentpublic void setServiceUrlPath(String url)
ManagementAgentsetServiceUrlPath in interface ManagementAgenturl - the service urlpublic String getServiceUrlPath()
ManagementAgentgetServiceUrlPath in interface ManagementAgentpublic void setCreateConnector(Boolean flag)
ManagementAgentsetCreateConnector in interface ManagementAgentflag - true to create connectorpublic Boolean getCreateConnector()
ManagementAgentgetCreateConnector in interface ManagementAgentpublic void setUsePlatformMBeanServer(Boolean flag)
ManagementAgentsetUsePlatformMBeanServer in interface ManagementAgentflag - true to use platform MBean serverpublic Boolean getUsePlatformMBeanServer()
ManagementAgentgetUsePlatformMBeanServer in interface ManagementAgentpublic Boolean getOnlyRegisterProcessorWithCustomId()
ManagementAgentgetOnlyRegisterProcessorWithCustomId in interface ManagementAgentpublic void setOnlyRegisterProcessorWithCustomId(Boolean onlyRegisterProcessorWithCustomId)
ManagementAgentsetOnlyRegisterProcessorWithCustomId in interface ManagementAgentonlyRegisterProcessorWithCustomId - true to only register if custom id has been assignedpublic void setMBeanServer(MBeanServer mbeanServer)
ManagementAgentsetMBeanServer in interface ManagementAgentmbeanServer - the custom mbean serverpublic MBeanServer getMBeanServer()
ManagementAgentgetMBeanServer in interface ManagementAgentpublic Boolean getRegisterAlways()
ManagementAgentgetRegisterAlways in interface ManagementAgentpublic void setRegisterAlways(Boolean registerAlways)
ManagementAgentsetRegisterAlways in interface ManagementAgentregisterAlways - true to always registerpublic Boolean getRegisterNewRoutes()
ManagementAgentgetRegisterNewRoutes in interface ManagementAgentpublic void setRegisterNewRoutes(Boolean registerNewRoutes)
ManagementAgentsetRegisterNewRoutes in interface ManagementAgentregisterNewRoutes - true to register when starting a new routepublic Boolean getMask()
ManagementAgentgetMask in interface ManagementAgentpublic void setMask(Boolean mask)
ManagementAgentsetMask in interface ManagementAgentpublic Boolean getIncludeHostName()
ManagementAgentgetIncludeHostName in interface ManagementAgentpublic void setIncludeHostName(Boolean includeHostName)
ManagementAgentManagementNamingStrategy.
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.setIncludeHostName in interface ManagementAgentincludeHostName - true to include host name in the MBean names.public CamelContext getCamelContext()
CamelContextAwareCamelContextgetCamelContext in interface CamelContextAwarepublic void setCamelContext(CamelContext camelContext)
CamelContextAwareCamelContextsetCamelContext in interface CamelContextAwarecamelContext - the Camel contextpublic void register(Object obj, ObjectName name) throws JMException
ManagementAgentregister in interface ManagementAgentobj - the object to registername - the nameJMException - is thrown if the registration failedpublic void register(Object obj, ObjectName name, boolean forceRegistration) throws JMException
ManagementAgentregister in interface ManagementAgentobj - the object to registername - the nameforceRegistration - if set to true, then object will be registered despite
existing object is already registered with the name.JMException - is thrown if the registration failedpublic void unregister(ObjectName name) throws JMException
ManagementAgentunregister in interface ManagementAgentname - the nameJMException - is thrown if the unregistration failedpublic boolean isRegistered(ObjectName name)
ManagementAgentisRegistered in interface ManagementAgentname - the nameprotected void doStart()
throws Exception
ServiceSupportServiceSupport.doStop() for more details.doStart in class ServiceSupportExceptionServiceSupport.doStop()protected void doStop()
throws Exception
ServiceSupportServiceSupport.doStop() method when
the service is being stopped. This method will also be invoked
if the service is still in uninitialized state (eg has not
been started). The method is always called to allow the service
to do custom logic when the service is being stopped, such as when
CamelContext is shutting down.doStop in class ServiceSupportExceptionServiceSupport.doStart()protected void createMBeanServer()
protected MBeanServer findOrCreateMBeanServer()
protected void createJmxConnector(String host) throws IOException
IOExceptionApache Camel