Interface ManagementStrategyFactory
public interface ManagementStrategyFactory
SPI factory that creates the
ManagementStrategy and its associated LifecycleStrategy for a
CamelContext.
Camel discovers implementations via FactoryFinder from the META-INF/services/ directory. Adding
camel-management to the classpath registers the JMX-backed factory; without it the default no-op strategy is
used. The factory produces three artifacts: a ManagementStrategy (which owns the event-notifier list and
delegates to the ManagementAgent), an optional LifecycleStrategy (which listens to route and service
lifecycle events and drives MBean registration), and then wires both into the context via
setupManagement(org.apache.camel.CamelContext, ManagementStrategy, LifecycleStrategy).
See JMX in the Camel user manual.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptioncreate(CamelContext context, Map<String, Object> properties) Creates theManagementStrategy.createLifecycle(CamelContext context) Creates the associatedLifecycleStrategythat the management strategy uses.voidsetupManagement(CamelContext camelContext, ManagementStrategy strategy, @Nullable LifecycleStrategy lifecycle) Setup the management on theCamelContext.
-
Method Details
-
create
Creates theManagementStrategy.- Parameters:
context- the camel contextproperties- optional options to set onManagementAgent- Returns:
- the created strategy
- Throws:
Exception- is thrown if error creating the strategy
-
createLifecycle
Creates the associatedLifecycleStrategythat the management strategy uses.- Parameters:
context- the camel context- Returns:
- the created lifecycle strategy
- Throws:
Exception- is thrown if error creating the lifecycle strategy
-
setupManagement
void setupManagement(CamelContext camelContext, ManagementStrategy strategy, @Nullable LifecycleStrategy lifecycle) Setup the management on theCamelContext. This allows implementations to provide the logic for setting up management on Camel.- Parameters:
camelContext- the camel contextstrategy- the management strategylifecycle- the associated lifecycle strategy (optional)
-