org.apache.camel.management
Class DefaultInstrumentationAgent

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

public class DefaultInstrumentationAgent
extends ServiceSupport
implements InstrumentationAgent

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
DefaultInstrumentationAgent()
           
 
Method Summary
protected  void createJmxConnector(String host)
           
protected  void createMBeanServer()
           
protected  void doStart()
           
protected  void doStop()
           
protected  void finalizeSettings()
           
protected  MBeanServer findOrCreateMBeanServer()
           
 String getMBeanObjectDomainName()
          Get domain name for Camel MBeans.
 MBeanServer getMBeanServer()
          Get the MBeanServer which hosts managed objects.
 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 setMBeanObjectDomainName(String value)
           
 void setMBeanServerDefaultDomain(String value)
           
 void setRegistryPort(Integer value)
           
 void setServer(MBeanServer 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, getThreadName, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, nextThreadCounter, 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

DefaultInstrumentationAgent

public DefaultInstrumentationAgent()
Method Detail

finalizeSettings

protected void finalizeSettings()

setRegistryPort

public void setRegistryPort(Integer value)

setConnectorPort

public void setConnectorPort(Integer value)

setMBeanServerDefaultDomain

public void setMBeanServerDefaultDomain(String value)

setMBeanObjectDomainName

public void setMBeanObjectDomainName(String value)

setServiceUrlPath

public void setServiceUrlPath(String value)

setCreateConnector

public void setCreateConnector(Boolean flag)

setUsePlatformMBeanServer

public void setUsePlatformMBeanServer(Boolean flag)

getMBeanServer

public MBeanServer getMBeanServer()
Description copied from interface: InstrumentationAgent
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 InstrumentationAgent
Returns:
the MBeanServer

register

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

Specified by:
register in interface InstrumentationAgent
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: InstrumentationAgent
Registers object with management infrastructure with a specific name. Object must be annotated or implement standard MBean interface.

Specified by:
register in interface InstrumentationAgent
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: InstrumentationAgent
Unregisters object based upon registered name

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

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

getMBeanObjectDomainName

public String getMBeanObjectDomainName()
Description copied from interface: InstrumentationAgent
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 InstrumentationAgent
Returns:
domain name

setServer

public void setServer(MBeanServer value)


Copyright © 2009 Apache Software Foundation. All Rights Reserved.