|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ShutdownStrategy
Pluggable shutdown strategy executed during shutdown of routes.
Shutting down routes in a reliable and graceful manner is not a trivial task. Therefore Camel provides a pluggable strategy allowing 3rd party to use their own strategy if needed. The key problem is to stop the input consumers for the routes such that no new messages is coming into Camel. But at the same time still keep the routes running so the existing in flight exchanges can still be run to completion. On top of that there are some in memory components (such as SEDA) which may have pending messages on its in memory queue which we want to run to completion as well, otherwise they will get lost. Camel provides a default strategy which supports all that that can be used as inspiration for your own strategy.
ShutdownAware| Method Summary | |
|---|---|
long |
getTimeout()
Gets the timeout. |
TimeUnit |
getTimeUnit()
Gets the time unit used |
boolean |
isShutdownNowOnTimeout()
whether to force shutdown of all consumers when a timeout occurred. |
void |
setShutdownNowOnTimeout(boolean shutdownNowOnTimeout)
Sets whether to force shutdown of all consumers when a timeout occurred and thus not all consumers was shutdown within that period. |
void |
setTimeout(long timeout)
Set an timeout to wait for the shutdown to complete. |
void |
setTimeUnit(TimeUnit timeUnit)
Set the time unit to use |
void |
shutdown(CamelContext context,
List<RouteStartupOrder> routes)
Shutdown the routes |
| Methods inherited from interface org.apache.camel.Service |
|---|
start, stop |
| Method Detail |
|---|
void shutdown(CamelContext context,
List<RouteStartupOrder> routes)
throws Exception
context - the camel contextroutes - the routes, ordered by the order they was started
Exception - is thrown if error shutting down the consumers, however its preferred to avoid thisvoid setTimeout(long timeout)
timeout - timeout in millislong getTimeout()
void setTimeUnit(TimeUnit timeUnit)
timeUnit - the unit to useTimeUnit getTimeUnit()
void setShutdownNowOnTimeout(boolean shutdownNowOnTimeout)
CamelContext has been shutdown.
shutdownNowOnTimeout - true to force shutdown, false to leave them runningboolean isShutdownNowOnTimeout()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||