org.apache.camel.management
Class ManagedManagementStrategy

java.lang.Object
  extended by org.apache.camel.management.DefaultManagementStrategy
      extended by org.apache.camel.management.ManagedManagementStrategy
All Implemented Interfaces:
CamelContextAware, Service, ManagementStrategy

public class ManagedManagementStrategy
extends DefaultManagementStrategy

A JMX capable ManagementStrategy that Camel by default uses if possible.

Camel detects whether its possible to use this JMX capable strategy and if not then Camel will fallback to the DefaultManagementStrategy instead.

Version:
See Also:
ManagementStrategy, DefaultManagementStrategy

Constructor Summary
ManagedManagementStrategy()
           
ManagedManagementStrategy(CamelContext camelContext, ManagementAgent managementAgent)
           
ManagedManagementStrategy(ManagementAgent managementAgent)
          Deprecated. 
 
Method Summary
<T> T
getManagedObjectName(Object managedObject, String customName, Class<T> nameType)
          Construct an object name, where either the object to be managed and/or a custom name component are provided
 boolean isManaged(Object managedObject, Object name)
          Determines if an object or name is managed.
 void manageNamedObject(Object managedObject, Object preferredName)
          Adds a managed object allowing the ManagementStrategy implementation to record or expose the object as it sees fit.
 void manageObject(Object managedObject)
          Adds a managed object allowing the ManagementStrategy implementation to record or expose the object as it sees fit.
 boolean manageProcessor(ProcessorDefinition<?> definition)
          Filter whether the processor should be managed or not.
 void unmanageNamedObject(Object name)
          Removes a managed object by name.
 void unmanageObject(Object managedObject)
          Removes the managed object.
 
Methods inherited from class org.apache.camel.management.DefaultManagementStrategy
addEventNotifier, createStatistic, getCamelContext, getEventFactory, getEventNotifiers, getManagementAgent, getManagementNamingStrategy, getManagementObjectStrategy, getStatisticsLevel, isOnlyManageProcessorWithCustomId, notify, onlyManageProcessorWithCustomId, removeEventNotifier, setCamelContext, setEventFactory, setEventNotifiers, setManagementAgent, setManagementNamingStrategy, setManagementObjectStrategy, setStatisticsLevel, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ManagedManagementStrategy

public ManagedManagementStrategy()

ManagedManagementStrategy

@Deprecated
public ManagedManagementStrategy(ManagementAgent managementAgent)
Deprecated. 


ManagedManagementStrategy

public ManagedManagementStrategy(CamelContext camelContext,
                                 ManagementAgent managementAgent)
Method Detail

manageObject

public void manageObject(Object managedObject)
                  throws Exception
Description copied from interface: ManagementStrategy
Adds a managed object allowing the ManagementStrategy implementation to record or expose the object as it sees fit.

Specified by:
manageObject in interface ManagementStrategy
Overrides:
manageObject in class DefaultManagementStrategy
Parameters:
managedObject - the managed object
Throws:
Exception - can be thrown if the object could not be added

manageNamedObject

public void manageNamedObject(Object managedObject,
                              Object preferredName)
                       throws Exception
Description copied from interface: ManagementStrategy
Adds a managed object allowing the ManagementStrategy implementation to record or expose the object as it sees fit.

Specified by:
manageNamedObject in interface ManagementStrategy
Overrides:
manageNamedObject in class DefaultManagementStrategy
Parameters:
managedObject - the managed object
preferredName - representing the preferred name, maybe a String, or a JMX ObjectName
Throws:
Exception - can be thrown if the object could not be added

getManagedObjectName

public <T> T getManagedObjectName(Object managedObject,
                                  String customName,
                                  Class<T> nameType)
                       throws Exception
Description copied from interface: ManagementStrategy
Construct an object name, where either the object to be managed and/or a custom name component are provided

Specified by:
getManagedObjectName in interface ManagementStrategy
Overrides:
getManagedObjectName in class DefaultManagementStrategy
Parameters:
managedObject - the object to be managed
customName - a custom name component
nameType - the name type required
Returns:
an object name of the required type if supported, otherwise null
Throws:
Exception - can be thrown if the object name could not be created

unmanageObject

public void unmanageObject(Object managedObject)
                    throws Exception
Description copied from interface: ManagementStrategy
Removes the managed object.

Specified by:
unmanageObject in interface ManagementStrategy
Overrides:
unmanageObject in class DefaultManagementStrategy
Parameters:
managedObject - the managed object
Throws:
Exception - can be thrown if the object could not be removed

unmanageNamedObject

public void unmanageNamedObject(Object name)
                         throws Exception
Description copied from interface: ManagementStrategy
Removes a managed object by name.

Specified by:
unmanageNamedObject in interface ManagementStrategy
Overrides:
unmanageNamedObject in class DefaultManagementStrategy
Parameters:
name - an object name previously created by this strategy.
Throws:
Exception - can be thrown if the object could not be removed

isManaged

public boolean isManaged(Object managedObject,
                         Object name)
Description copied from interface: ManagementStrategy
Determines if an object or name is managed.

Specified by:
isManaged in interface ManagementStrategy
Overrides:
isManaged in class DefaultManagementStrategy
Parameters:
managedObject - the object to consider
name - the name to consider
Returns:
true if the given object or name is managed

manageProcessor

public boolean manageProcessor(ProcessorDefinition<?> definition)
Description copied from interface: ManagementStrategy
Filter whether the processor should be managed or not.

Is used to filter out unwanted processors to avoid managing at too fine grained level.

Specified by:
manageProcessor in interface ManagementStrategy
Overrides:
manageProcessor in class DefaultManagementStrategy
Parameters:
definition - definition of the processor
Returns:
true to manage it


Apache CAMEL