Package org.apache.camel.spi
Interface RoutePolicy
-
public interface RoutePolicy
Policy for aRoute
which allows controlling the route at runtime. For example using theorg.apache.camel.throttling.ThrottlingInflightRoutePolicy
to throttle theRoute
at runtime where it suspends and resume theRoute.getConsumer()
. See alsoRoute
class javadoc about controlling the lifecycle of aRoute
.- See Also:
Route
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
onExchangeBegin(Route route, Exchange exchange)
void
onExchangeDone(Route route, Exchange exchange)
void
onInit(Route route)
Callback invoked when theRoute
is being initializedvoid
onRemove(Route route)
Callback invoked when theRoute
is being removed fromCamelContext
void
onResume(Route route)
Callback invoked when theRoute
is being resumedvoid
onStart(Route route)
Callback invoked when theRoute
is being startedvoid
onStop(Route route)
Callback invoked when theRoute
is being stoppedvoid
onSuspend(Route route)
Callback invoked when theRoute
is being suspended
-
-
-
Method Detail
-
onInit
void onInit(Route route)
Callback invoked when theRoute
is being initialized- Parameters:
route
- the route being initialized
-
onRemove
void onRemove(Route route)
Callback invoked when theRoute
is being removed fromCamelContext
- Parameters:
route
- the route being removed
-
onStart
void onStart(Route route)
Callback invoked when theRoute
is being started- Parameters:
route
- the route being started
-
onStop
void onStop(Route route)
Callback invoked when theRoute
is being stopped- Parameters:
route
- the route being stopped
-
onSuspend
void onSuspend(Route route)
Callback invoked when theRoute
is being suspended- Parameters:
route
- the route being suspended
-
onResume
void onResume(Route route)
Callback invoked when theRoute
is being resumed- Parameters:
route
- the route being resumed
-
onExchangeBegin
void onExchangeBegin(Route route, Exchange exchange)
- Parameters:
route
- the route where the exchange started fromexchange
- the created exchange
-
onExchangeDone
void onExchangeDone(Route route, Exchange exchange)
Callback invoked when anExchange
is done being routed, where it started from the givenRoute
Notice this callback is invoked when the Exchange is done and theRoute
is the route where theExchange
was started. Most often its also the route where the exchange is done. However its possible to route anExchange
to other routes using endpoints such as direct or seda. Bottom line is that theRoute
parameter may not be the endpoint route and thus why we state its the starting route.- Parameters:
route
- the route where the exchange started fromexchange
- the created exchange
-
-