Package org.apache.camel.spi
Interface ManagementStrategy
- All Superinterfaces:
AutoCloseable
,Service
,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 Summary
Modifier and TypeMethodDescriptionvoid
addEventNotifier
(EventNotifier eventNotifier) Adds the event notifier to use.Gets the event factoryGets the event notifiers.Gets the management agentGets the naming strategy to useGets the object strategy to useGets all the started event notifiers, which is ready to be used.boolean
Determines if an object or name is managed.boolean
isManagedName
(Object name) Determines if an object or name is managed.void
manageObject
(Object managedObject) Adds a managed object allowing the ManagementStrategy implementation to record or expose the object as it sees fit.boolean
manageProcessor
(NamedNode definition) Filter whether the processor should be managed or not.void
notify
(CamelEvent event) Management events provide a single model for capturing information about execution points in the application code.boolean
removeEventNotifier
(EventNotifier eventNotifier) Removes the event notifiervoid
setEventFactory
(EventFactory eventFactory) Sets the event factory to usevoid
setManagementAgent
(ManagementAgent managementAgent) Sets the management agent to usevoid
Sets the naming strategy to usevoid
Sets the object strategy to usevoid
unmanageObject
(Object managedObject) Removes the managed object.
-
Method Details
-
manageObject
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
Removes the managed object.- Parameters:
managedObject
- the managed object- Throws:
Exception
- can be thrown if the object could not be removed
-
isManaged
Determines if an object or name is managed.- Parameters:
managedObject
- the object to consider- Returns:
- true if the given object is managed
-
isManagedName
Determines if an object or name is managed.- Parameters:
name
- the name to consider- Returns:
- true if the given name is managed
-
notify
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
Adds the event notifier to use. Ensure the event notifier has been started if its aService
, as otherwise it would not be used.- Parameters:
eventNotifier
- event notifier
-
removeEventNotifier
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
Sets the event factory to use- Parameters:
eventFactory
- event factory
-
getManagementObjectNameStrategy
ManagementObjectNameStrategy getManagementObjectNameStrategy()Gets the naming strategy to use- Returns:
- naming strategy
-
setManagementObjectNameStrategy
Sets the naming strategy to use- Parameters:
strategy
- naming strategy
-
getManagementObjectStrategy
ManagementObjectStrategy getManagementObjectStrategy()Gets the object strategy to use- Returns:
- object strategy
-
setManagementObjectStrategy
Sets the object strategy to use- Parameters:
strategy
- object strategy
-
getManagementAgent
ManagementAgent getManagementAgent()Gets the management agent- Returns:
- management agent
-
setManagementAgent
Sets the management agent to use- Parameters:
managementAgent
- management agent
-
manageProcessor
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
-