Package org.apache.camel.spi
Interface RoutePolicy
-
public interface RoutePolicyPolicy for aRoutewhich allows controlling the route at runtime. For example using theorg.apache.camel.throttling.ThrottlingInflightRoutePolicyto throttle theRouteat runtime where it suspends and resume theRoute.getConsumer(). See alsoRouteclass javadoc about controlling the lifecycle of aRoute.- See Also:
Route
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidonExchangeBegin(Route route, Exchange exchange)voidonExchangeDone(Route route, Exchange exchange)voidonInit(Route route)Callback invoked when theRouteis being initializedvoidonRemove(Route route)Callback invoked when theRouteis being removed fromCamelContextvoidonResume(Route route)Callback invoked when theRouteis being resumedvoidonStart(Route route)Callback invoked when theRouteis being startedvoidonStop(Route route)Callback invoked when theRouteis being stoppedvoidonSuspend(Route route)Callback invoked when theRouteis being suspended
-
-
-
Method Detail
-
onInit
void onInit(Route route)
Callback invoked when theRouteis being initialized- Parameters:
route- the route being initialized
-
onRemove
void onRemove(Route route)
Callback invoked when theRouteis being removed fromCamelContext- Parameters:
route- the route being removed
-
onStart
void onStart(Route route)
Callback invoked when theRouteis being started- Parameters:
route- the route being started
-
onStop
void onStop(Route route)
Callback invoked when theRouteis being stopped- Parameters:
route- the route being stopped
-
onSuspend
void onSuspend(Route route)
Callback invoked when theRouteis being suspended- Parameters:
route- the route being suspended
-
onResume
void onResume(Route route)
Callback invoked when theRouteis 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 anExchangeis done being routed, where it started from the givenRouteNotice this callback is invoked when the Exchange is done and theRouteis the route where theExchangewas started. Most often its also the route where the exchange is done. However its possible to route anExchangeto other routes using endpoints such as direct or seda. Bottom line is that theRouteparameter 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
-
-