org.apache.camel.management
Class DefaultManagementAgent

java.lang.Object
  extended by org.apache.camel.impl.ServiceSupport
      extended by org.apache.camel.management.DefaultManagementAgent
All Implemented Interfaces:
Service, ManagementAgent

public class DefaultManagementAgent
extends ServiceSupport
implements ManagementAgent

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
           
 
Constructor Summary
DefaultManagementAgent()
           
 
Method Summary
protected  void createJmxConnector(String host)
           
protected  void createMBeanServer()
           
protected  void doStart()
           
protected  void doStop()
           
protected  void finalizeSettings()
           
protected  MBeanServer findOrCreateMBeanServer()
           
 Integer getConnectorPort()
           
 Boolean getCreateConnector()
           
 ExecutorService getExecutorService()
           
 String getMBeanObjectDomainName()
          Get domain name for Camel MBeans.
 MBeanServer getMBeanServer()
          Get the MBeanServer which hosts managed objects.
 String getMBeanServerDefaultDomain()
           
 Boolean getOnlyRegisterProcessorWithCustomId()
           
 Integer getRegistryPort()
           
 String getServiceUrlPath()
           
 Boolean getUsePlatformMBeanServer()
           
 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 setConnectorPort(Integer value)
           
 void setCreateConnector(Boolean flag)
           
 void setExecutorService(ExecutorService executorService)
           
 void setMBeanObjectDomainName(String value)
           
 void setMBeanServer(MBeanServer mbeanServer)
          Sets a custom mbean server to use
 void setMBeanServerDefaultDomain(String value)
           
 void setOnlyRegisterProcessorWithCustomId(Boolean onlyRegisterProcessorWithCustomId)
           
 void setRegistryPort(Integer value)
           
 void setServiceUrlPath(String value)
           
 void setUsePlatformMBeanServer(Boolean flag)
           
 void unregister(ObjectName name)
          Unregisters object based upon registered name
 
Methods inherited from class org.apache.camel.impl.ServiceSupport
addChildService, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, removeChildService, start, stop
 
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

DEFAULT_DOMAIN

public static final String DEFAULT_DOMAIN
See Also:
Constant Field Values

DEFAULT_HOST

public static final String DEFAULT_HOST
See Also:
Constant Field Values

DEFAULT_REGISTRY_PORT

public static final int DEFAULT_REGISTRY_PORT
See Also:
Constant Field Values

DEFAULT_CONNECTION_PORT

public static final int DEFAULT_CONNECTION_PORT
See Also:
Constant Field Values

DEFAULT_SERVICE_URL_PATH

public static final String DEFAULT_SERVICE_URL_PATH
See Also:
Constant Field Values
Constructor Detail

DefaultManagementAgent

public DefaultManagementAgent()
Method Detail

finalizeSettings

protected void finalizeSettings()

setRegistryPort

public void setRegistryPort(Integer value)

getRegistryPort

public Integer getRegistryPort()

setConnectorPort

public void setConnectorPort(Integer value)

getConnectorPort

public Integer getConnectorPort()

setMBeanServerDefaultDomain

public void setMBeanServerDefaultDomain(String value)

getMBeanServerDefaultDomain

public String getMBeanServerDefaultDomain()

setMBeanObjectDomainName

public void setMBeanObjectDomainName(String value)

getMBeanObjectDomainName

public String getMBeanObjectDomainName()
Description copied from interface: ManagementAgent
Get domain name for Camel MBeans.

Notice: That this can be different that the default domain name of the MBean Server.

Specified by:
getMBeanObjectDomainName in interface ManagementAgent
Returns:
domain name

setServiceUrlPath

public void setServiceUrlPath(String value)

getServiceUrlPath

public String getServiceUrlPath()

setCreateConnector

public void setCreateConnector(Boolean flag)

getCreateConnector

public Boolean getCreateConnector()

setUsePlatformMBeanServer

public void setUsePlatformMBeanServer(Boolean flag)

getUsePlatformMBeanServer

public Boolean getUsePlatformMBeanServer()

getOnlyRegisterProcessorWithCustomId

public Boolean getOnlyRegisterProcessorWithCustomId()

setOnlyRegisterProcessorWithCustomId

public void setOnlyRegisterProcessorWithCustomId(Boolean onlyRegisterProcessorWithCustomId)

setMBeanServer

public void setMBeanServer(MBeanServer mbeanServer)
Description copied from interface: ManagementAgent
Sets a custom mbean server to use

Specified by:
setMBeanServer in interface ManagementAgent
Parameters:
mbeanServer - the custom mbean server

getMBeanServer

public MBeanServer getMBeanServer()
Description copied from interface: ManagementAgent
Get the MBeanServer which hosts managed objects.

Notice: If the JMXEnabled configuration is not set to true, this method will return null.

Specified by:
getMBeanServer in interface ManagementAgent
Returns:
the MBeanServer

getExecutorService

public ExecutorService getExecutorService()

setExecutorService

public void setExecutorService(ExecutorService executorService)

register

public void register(Object obj,
                     ObjectName name)
              throws JMException
Description copied from interface: ManagementAgent
Registers object with management infrastructure with a specific name. Object must be annotated or implement standard MBean interface.

Specified by:
register in interface ManagementAgent
Parameters:
obj - the object to register
name - the name
Throws:
JMException - is thrown if the registration failed

register

public void register(Object obj,
                     ObjectName name,
                     boolean forceRegistration)
              throws JMException
Description copied from interface: ManagementAgent
Registers object with management infrastructure with a specific name. Object must be annotated or implement standard MBean interface.

Specified by:
register in interface ManagementAgent
Parameters:
obj - the object to register
name - the name
forceRegistration - 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

public void unregister(ObjectName name)
                throws JMException
Description copied from interface: ManagementAgent
Unregisters object based upon registered name

Specified by:
unregister in interface ManagementAgent
Parameters:
name - the name
Throws:
JMException - is thrown if the unregistration failed

isRegistered

public boolean isRegistered(ObjectName name)
Description copied from interface: ManagementAgent
Is the given object registered

Specified by:
isRegistered in interface ManagementAgent
Parameters:
name - the name
Returns:
true if registered

doStart

protected void doStart()
                throws Exception
Specified by:
doStart in class ServiceSupport
Throws:
Exception

doStop

protected void doStop()
               throws Exception
Specified by:
doStop in class ServiceSupport
Throws:
Exception

createMBeanServer

protected void createMBeanServer()

findOrCreateMBeanServer

protected MBeanServer findOrCreateMBeanServer()

createJmxConnector

protected void createJmxConnector(String host)
                           throws IOException
Throws:
IOException


Copyright © 2007-2010 IONA Open Source Community. All Rights Reserved.