Interface ManagementStrategy

All Superinterfaces:
AutoCloseable, Service, StaticService

public interface ManagementStrategy extends StaticService
Strategy for management.

If JMX is detected (camel-management JAR on the classpath) then org.apache.camel.management.JmxManagementStrategy is in use. Otherwise, the DefaultManagementStrategy is in use.

You can also plugin and use a 3rd party management implementation with Camel.

See Also:
  • Method Details

    • manageObject

      void manageObject(Object managedObject) throws Exception
      Adds a managed object allowing the ManagementStrategy implementation to record or expose the object as it sees fit.
      Parameters:
      managedObject - the managed object
      Throws:
      Exception - can be thrown if the object could not be added
    • unmanageObject

      void unmanageObject(Object managedObject) throws Exception
      Removes the managed object.
      Parameters:
      managedObject - the managed object
      Throws:
      Exception - can be thrown if the object could not be removed
    • isManaged

      boolean isManaged(Object managedObject)
      Determines if an object or name is managed.
      Parameters:
      managedObject - the object to consider
      Returns:
      true if the given object is managed
    • isManagedName

      boolean isManagedName(Object name)
      Determines if an object or name is managed.
      Parameters:
      name - the name to consider
      Returns:
      true if the given name is managed
    • notify

      void notify(CamelEvent event) throws Exception
      Management events provide a single model for capturing information about execution points in the application code. Management strategy implementations decide if and where to record these events. Applications communicate events to management strategy implementations via the notify(EventObject) method.
      Parameters:
      event - the event
      Throws:
      Exception - can be thrown if the notification failed
    • getEventNotifiers

      List<EventNotifier> getEventNotifiers()
      Gets the event notifiers.
      Returns:
      event notifiers
    • getStartedEventNotifiers

      List<EventNotifier> getStartedEventNotifiers()
      Gets all the started event notifiers, which is ready to be used.
      Returns:
      started event notifiers
    • addEventNotifier

      void addEventNotifier(EventNotifier eventNotifier)
      Adds the event notifier to use.

      Ensure the event notifier has been started if its a Service, as otherwise it would not be used.

      Parameters:
      eventNotifier - event notifier
    • removeEventNotifier

      boolean removeEventNotifier(EventNotifier eventNotifier)
      Removes the event notifier
      Parameters:
      eventNotifier - event notifier to remove
      Returns:
      true if removed, false if already removed
    • getEventFactory

      EventFactory getEventFactory()
      Gets the event factory
      Returns:
      event factory
    • setEventFactory

      void setEventFactory(EventFactory eventFactory)
      Sets the event factory to use
      Parameters:
      eventFactory - event factory
    • getManagementObjectNameStrategy

      ManagementObjectNameStrategy getManagementObjectNameStrategy()
      Gets the naming strategy to use
      Returns:
      naming strategy
    • setManagementObjectNameStrategy

      void setManagementObjectNameStrategy(ManagementObjectNameStrategy strategy)
      Sets the naming strategy to use
      Parameters:
      strategy - naming strategy
    • getManagementObjectStrategy

      ManagementObjectStrategy getManagementObjectStrategy()
      Gets the object strategy to use
      Returns:
      object strategy
    • setManagementObjectStrategy

      void setManagementObjectStrategy(ManagementObjectStrategy strategy)
      Sets the object strategy to use
      Parameters:
      strategy - object strategy
    • getManagementAgent

      ManagementAgent getManagementAgent()
      Gets the management agent
      Returns:
      management agent
    • setManagementAgent

      void setManagementAgent(ManagementAgent managementAgent)
      Sets the management agent to use
      Parameters:
      managementAgent - management agent
    • manageProcessor

      boolean manageProcessor(NamedNode definition)
      Filter whether the processor should be managed or not.

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

      Parameters:
      definition - definition of the processor
      Returns:
      true to manage it