Package org.apache.camel.spi
Interface LifecycleStrategy
- All Known Subinterfaces:
AutowiredLifecycleStrategy
public interface LifecycleStrategy
Strategy for lifecycle notifications.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
onComponentAdd
(String name, Component component) Notification on adding anComponent
.void
onComponentRemove
(String name, Component component) Notification on removing anComponent
.default void
onContextInitialized
(CamelContext context) Notification on initializedCamelContext
.default void
onContextInitializing
(CamelContext context) Notification on initializing aCamelContext
.default void
onContextStarted
(CamelContext context) Notification on startedCamelContext
.default void
onContextStarting
(CamelContext context) Notification on starting aCamelContext
.default void
onContextStopped
(CamelContext context) Notification on stoppedCamelContext
.default void
onContextStopping
(CamelContext context) Notification on stopping aCamelContext
.default void
onDataFormatCreated
(String name, DataFormat dataFormat) Notification onDataFormat
being resolved from theRegistry
void
onEndpointAdd
(Endpoint endpoint) Notification on adding anEndpoint
.void
onEndpointRemove
(Endpoint endpoint) Notification on removing anEndpoint
.default void
onLanguageCreated
(String name, Language language) Notification on aLanguage
instance being resolved.void
onRouteContextCreate
(Route route) Notification on creatingRoute
(s).void
onRoutesAdd
(Collection<Route> routes) Notification on addingRoute
(s).void
onRoutesRemove
(Collection<Route> routes) Notification on removingRoute
(s).void
onServiceAdd
(CamelContext context, Service service, Route route) Notification on adding aService
.void
onServiceRemove
(CamelContext context, Service service, Route route) Notification on removing aService
.void
onThreadPoolAdd
(CamelContext camelContext, ThreadPoolExecutor threadPool, String id, String sourceId, String routeId, String threadPoolProfileId) Notification on adding a thread pool.void
onThreadPoolRemove
(CamelContext camelContext, ThreadPoolExecutor threadPool) Notification on removing a thread pool.
-
Method Details
-
onContextInitializing
Notification on initializing aCamelContext
.- Parameters:
context
- the camel context- Throws:
VetoCamelContextStartException
- can be thrown to veto startingCamelContext
. Any other runtime exceptions will be logged at WARN level by Camel will continue starting itself.
-
onContextInitialized
Notification on initializedCamelContext
.- Parameters:
context
- the camel context- Throws:
VetoCamelContextStartException
- can be thrown to veto startingCamelContext
. Any other runtime exceptions will be logged at WARN level by Camel will continue starting itself.
-
onContextStarting
Notification on starting aCamelContext
.- Parameters:
context
- the camel context- Throws:
VetoCamelContextStartException
- can be thrown to veto startingCamelContext
. Any other runtime exceptions will be logged at WARN level by Camel will continue starting itself.
-
onContextStarted
Notification on startedCamelContext
.- Parameters:
context
- the camel context
-
onContextStopping
Notification on stopping aCamelContext
.- Parameters:
context
- the camel context
-
onContextStopped
Notification on stoppedCamelContext
.- Parameters:
context
- the camel context
-
onComponentAdd
Notification on adding anComponent
.- Parameters:
name
- the unique name of this componentcomponent
- the added component
-
onComponentRemove
Notification on removing anComponent
.- Parameters:
name
- the unique name of this componentcomponent
- the removed component
-
onEndpointAdd
Notification on adding anEndpoint
.- Parameters:
endpoint
- the added endpoint
-
onEndpointRemove
Notification on removing anEndpoint
.- Parameters:
endpoint
- the removed endpoint
-
onDataFormatCreated
Notification onDataFormat
being resolved from theRegistry
- Parameters:
name
- the unique name of theDataFormat
dataFormat
- the resolvedDataFormat
-
onLanguageCreated
Notification on aLanguage
instance being resolved. -
onServiceAdd
Notification on adding aService
.- Parameters:
context
- the camel contextservice
- the added serviceroute
- the route the service belongs to if any possible to determine
-
onServiceRemove
Notification on removing aService
.- Parameters:
context
- the camel contextservice
- the removed serviceroute
- the route the service belongs to if any possible to determine
-
onRoutesAdd
Notification on addingRoute
(s).- Parameters:
routes
- the added routes
-
onRoutesRemove
Notification on removingRoute
(s).- Parameters:
routes
- the removed routes
-
onRouteContextCreate
Notification on creatingRoute
(s).- Parameters:
route
- the created route context
-
onThreadPoolAdd
void onThreadPoolAdd(CamelContext camelContext, ThreadPoolExecutor threadPool, String id, String sourceId, String routeId, String threadPoolProfileId) Notification on adding a thread pool.- Parameters:
camelContext
- the camel contextthreadPool
- the thread poolid
- id of the thread pool (can be null in special cases)sourceId
- id of the source creating the thread pool (can be null in special cases)routeId
- id of the route for the source (is null if no source)threadPoolProfileId
- id of the thread pool profile, if used for creating this thread pool (can be null)
-
onThreadPoolRemove
Notification on removing a thread pool.- Parameters:
camelContext
- the camel contextthreadPool
- the thread pool
-