Package org.apache.camel.spi
Interface LifecycleStrategy
-
public interface LifecycleStrategy
Strategy for lifecycle notifications.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
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 initializing aCamelContext
.void
onContextStart(CamelContext context)
Notification on starting aCamelContext
.void
onContextStop(CamelContext context)
Notification on stopping aCamelContext
.void
onEndpointAdd(Endpoint endpoint)
Notification on adding anEndpoint
.void
onEndpointRemove(Endpoint endpoint)
Notification on removing anEndpoint
.void
onErrorHandlerAdd(Route route, Processor errorHandler, ErrorHandlerFactory errorHandlerBuilder)
Notification on adding error handler.void
onErrorHandlerRemove(Route route, Processor errorHandler, ErrorHandlerFactory errorHandlerBuilder)
Notification on removing error handler.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 Detail
-
onContextInitialized
default void onContextInitialized(CamelContext context) throws VetoCamelContextStartException
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.
-
onContextStart
void onContextStart(CamelContext context) throws VetoCamelContextStartException
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.
-
onContextStop
void onContextStop(CamelContext context)
Notification on stopping aCamelContext
.- Parameters:
context
- the camel context
-
onComponentAdd
void onComponentAdd(String name, Component component)
Notification on adding anComponent
.- Parameters:
name
- the unique name of this componentcomponent
- the added component
-
onComponentRemove
void onComponentRemove(String name, Component component)
Notification on removing anComponent
.- Parameters:
name
- the unique name of this componentcomponent
- the removed component
-
onEndpointAdd
void onEndpointAdd(Endpoint endpoint)
Notification on adding anEndpoint
.- Parameters:
endpoint
- the added endpoint
-
onEndpointRemove
void onEndpointRemove(Endpoint endpoint)
Notification on removing anEndpoint
.- Parameters:
endpoint
- the removed endpoint
-
onServiceAdd
void onServiceAdd(CamelContext context, Service service, Route route)
Notification on adding aService
.- Parameters:
context
- the camel contextservice
- the added serviceroute
- the route the service belongs to if any possible to determine
-
onServiceRemove
void onServiceRemove(CamelContext context, Service service, Route route)
Notification on removing aService
.- Parameters:
context
- the camel contextservice
- the removed serviceroute
- the route the service belongs to if any possible to determine
-
onRoutesAdd
void onRoutesAdd(Collection<Route> routes)
Notification on addingRoute
(s).- Parameters:
routes
- the added routes
-
onRoutesRemove
void onRoutesRemove(Collection<Route> routes)
Notification on removingRoute
(s).- Parameters:
routes
- the removed routes
-
onRouteContextCreate
void onRouteContextCreate(Route route)
Notification on creatingRoute
(s).- Parameters:
route
- the created route context
-
onErrorHandlerAdd
void onErrorHandlerAdd(Route route, Processor errorHandler, ErrorHandlerFactory errorHandlerBuilder)
Notification on adding error handler.- Parameters:
route
- the added route contexterrorHandler
- the error handlererrorHandlerBuilder
- the error handler builder
-
onErrorHandlerRemove
void onErrorHandlerRemove(Route route, Processor errorHandler, ErrorHandlerFactory errorHandlerBuilder)
Notification on removing error handler.- Parameters:
route
- the removed route contexterrorHandler
- the error handlererrorHandlerBuilder
- the error handler builder
-
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
void onThreadPoolRemove(CamelContext camelContext, ThreadPoolExecutor threadPool)
Notification on removing a thread pool.- Parameters:
camelContext
- the camel contextthreadPool
- the thread pool
-
-