Package org.apache.camel.spi
Interface RoutePolicy
public interface RoutePolicy
Policy for a
Route which allows controlling the route at runtime.
For example using the org.apache.camel.throttling.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.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidonExchangeBegin(Route route, Exchange exchange) voidonExchangeDone(Route route, Exchange exchange) voidCallback invoked when theRouteis being initializedvoidCallback invoked when theRouteis being removed fromCamelContextvoidCallback invoked when theRouteis being resumedvoidCallback invoked when theRouteis being startedvoidCallback invoked when theRouteis being stoppedvoidCallback invoked when theRouteis being suspended
-
Method Details
-
onInit
Callback invoked when theRouteis being initialized- Parameters:
route- the route being initialized
-
onRemove
Callback invoked when theRouteis being removed fromCamelContext- Parameters:
route- the route being removed
-
onStart
Callback invoked when theRouteis being started- Parameters:
route- the route being started
-
onStop
Callback invoked when theRouteis being stopped- Parameters:
route- the route being stopped
-
onSuspend
Callback invoked when theRouteis being suspended- Parameters:
route- the route being suspended
-
onResume
Callback invoked when theRouteis being resumed- Parameters:
route- the route being resumed
-
onExchangeBegin
- Parameters:
route- the route where the exchange started fromexchange- the created exchange
-
onExchangeDone
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
-