|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.camel.support.ServiceSupport
org.apache.camel.management.DefaultManagementAgent
public class DefaultManagementAgent
Default implementation of the Camel JMX service agent
| Field Summary | |
|---|---|
static int |
DEFAULT_CONNECTION_PORT
|
static String |
DEFAULT_DOMAIN
|
static String |
DEFAULT_HOST
|
static int |
DEFAULT_REGISTRY_PORT
|
static String |
DEFAULT_SERVICE_URL_PATH
|
| Fields inherited from class org.apache.camel.support.ServiceSupport |
|---|
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending |
| Constructor Summary | |
|---|---|
DefaultManagementAgent()
|
|
DefaultManagementAgent(CamelContext camelContext)
|
|
| Method Summary | |
|---|---|
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 |
| Methods inherited from class org.apache.camel.support.ServiceSupport |
|---|
doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, resume, shutdown, start, stop, suspend |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.apache.camel.Service |
|---|
start, stop |
| Field Detail |
|---|
public 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
| Constructor Detail |
|---|
public DefaultManagementAgent()
public DefaultManagementAgent(CamelContext camelContext)
| Method Detail |
|---|
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)
ManagementAgent
setConnectorPort in interface ManagementAgentport - the portpublic Integer getConnectorPort()
ManagementAgent
getConnectorPort in interface ManagementAgentpublic void setMBeanServerDefaultDomain(String domain)
ManagementAgent
setMBeanServerDefaultDomain in interface ManagementAgentdomain - the domainpublic String getMBeanServerDefaultDomain()
ManagementAgent
getMBeanServerDefaultDomain in interface ManagementAgentpublic void setMBeanObjectDomainName(String domainName)
ManagementAgent
setMBeanObjectDomainName in interface ManagementAgentdomainName - the object domain namepublic String getMBeanObjectDomainName()
ManagementAgent
getMBeanObjectDomainName in interface ManagementAgentpublic void setServiceUrlPath(String url)
ManagementAgent
setServiceUrlPath in interface ManagementAgenturl - the service urlpublic String getServiceUrlPath()
ManagementAgent
getServiceUrlPath in interface ManagementAgentpublic void setCreateConnector(Boolean flag)
ManagementAgent
setCreateConnector in interface ManagementAgentflag - true to create connectorpublic Boolean getCreateConnector()
ManagementAgent
getCreateConnector in interface ManagementAgentpublic void setUsePlatformMBeanServer(Boolean flag)
ManagementAgent
setUsePlatformMBeanServer in interface ManagementAgentflag - true to use platform MBean serverpublic Boolean getUsePlatformMBeanServer()
ManagementAgent
getUsePlatformMBeanServer in interface ManagementAgentpublic Boolean getOnlyRegisterProcessorWithCustomId()
ManagementAgent
getOnlyRegisterProcessorWithCustomId in interface ManagementAgentpublic void setOnlyRegisterProcessorWithCustomId(Boolean onlyRegisterProcessorWithCustomId)
ManagementAgent
setOnlyRegisterProcessorWithCustomId in interface ManagementAgentonlyRegisterProcessorWithCustomId - true to only register if custom id has been assignedpublic void setMBeanServer(MBeanServer mbeanServer)
ManagementAgent
setMBeanServer in interface ManagementAgentmbeanServer - the custom mbean serverpublic MBeanServer getMBeanServer()
ManagementAgent
getMBeanServer in interface ManagementAgentpublic Boolean getRegisterAlways()
ManagementAgent
getRegisterAlways in interface ManagementAgentpublic void setRegisterAlways(Boolean registerAlways)
ManagementAgent
setRegisterAlways in interface ManagementAgentregisterAlways - true to always registerpublic Boolean getRegisterNewRoutes()
ManagementAgent
getRegisterNewRoutes in interface ManagementAgentpublic void setRegisterNewRoutes(Boolean registerNewRoutes)
ManagementAgent
setRegisterNewRoutes in interface ManagementAgentregisterNewRoutes - true to register when starting a new routepublic Boolean getMask()
ManagementAgent
getMask in interface ManagementAgentpublic void setMask(Boolean mask)
ManagementAgent
setMask in interface ManagementAgentpublic Boolean getIncludeHostName()
ManagementAgent
getIncludeHostName 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()
CamelContextAwareCamelContext
getCamelContext in interface CamelContextAwarepublic void setCamelContext(CamelContext camelContext)
CamelContextAwareCamelContext
setCamelContext in interface CamelContextAwarecamelContext - the Camel context
public void register(Object obj,
ObjectName name)
throws JMException
ManagementAgent
register in interface ManagementAgentobj - the object to registername - the name
JMException - is thrown if the registration failed
public void register(Object obj,
ObjectName name,
boolean forceRegistration)
throws JMException
ManagementAgent
register 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 failed
public void unregister(ObjectName name)
throws JMException
ManagementAgent
unregister in interface ManagementAgentname - the name
JMException - is thrown if the unregistration failedpublic boolean isRegistered(ObjectName name)
ManagementAgent
isRegistered in interface ManagementAgentname - the name
protected 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
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||