public interface RoutePolicy
Route
which allows controlling the route at runtime.
For example using the ThrottlingInflightRoutePolicy
to throttle the Route
at runtime where it suspends and resume the Route.getConsumer()
.
See also Route
class javadoc about controlling the lifecycle of a Route
Route
Modifier and Type | Method and Description |
---|---|
void |
onExchangeBegin(Route route,
Exchange exchange)
|
void |
onExchangeDone(Route route,
Exchange exchange)
|
void |
onInit(Route route)
Callback invoked when the
Route is being initialized |
void |
onRemove(Route route)
Callback invoked when the
Route is being removed from CamelContext |
void |
onResume(Route route)
Callback invoked when the
Route is being resumed |
void |
onStart(Route route)
Callback invoked when the
Route is being started |
void |
onStop(Route route)
Callback invoked when the
Route is being stopped |
void |
onSuspend(Route route)
Callback invoked when the
Route is being suspended |
void onInit(Route route)
Route
is being initializedroute
- the route being initializedvoid onRemove(Route route)
Route
is being removed from CamelContext
route
- the route being removedvoid onStart(Route route)
Route
is being startedroute
- the route being startedvoid onStop(Route route)
Route
is being stoppedroute
- the route being stoppedvoid onSuspend(Route route)
Route
is being suspendedroute
- the route being suspendedvoid onResume(Route route)
Route
is being resumedroute
- the route being resumedvoid onExchangeBegin(Route route, Exchange exchange)
route
- the route where the exchange started fromexchange
- the created exchangevoid onExchangeDone(Route route, Exchange exchange)
Exchange
is done being routed, where it started from the given Route
Notice this callback is invoked when the Exchange is done and the Route
is the route where
the Exchange
was started. Most often its also the route where the exchange is done. However its
possible to route an Exchange
to other routes using endpoints such as
direct or seda. Bottom line is that the Route
parameter may not be the endpoint
route and thus why we state its the starting route.route
- the route where the exchange started fromexchange
- the created exchangeApache Camel