|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.camel.impl.ServiceSupport
org.apache.camel.impl.DefaultShutdownStrategy
public class DefaultShutdownStrategy
Default ShutdownStrategy which uses graceful shutdown.
setTimeout(long) and
setShutdownNowOnTimeout(boolean) methods.
| Constructor Summary | |
|---|---|
DefaultShutdownStrategy()
|
|
| Method Summary | |
|---|---|
protected void |
doStart()
|
protected void |
doStop()
|
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 |
protected void |
shutdownNow(Consumer consumer)
Shutdown the consumer immediately. |
protected void |
shutdownNow(List<Consumer> consumers)
Shutdown all the consumers immediately. |
protected void |
shutdownRoutesNow(List<RouteStartupOrder> routes)
Shutdown all the consumers immediately. |
protected void |
suspendNow(SuspendableService service,
Consumer consumer)
Suspends the consumer immediately. |
| Methods inherited from class org.apache.camel.impl.ServiceSupport |
|---|
addChildService, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, removeChildService, start, stop |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.apache.camel.Service |
|---|
start, stop |
| Constructor Detail |
|---|
public DefaultShutdownStrategy()
| Method Detail |
|---|
public void shutdown(CamelContext context,
List<RouteStartupOrder> routes)
throws Exception
ShutdownStrategy
shutdown in interface ShutdownStrategycontext - 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 thispublic void setTimeout(long timeout)
ShutdownStrategy
setTimeout in interface ShutdownStrategytimeout - timeout in millispublic long getTimeout()
ShutdownStrategy
getTimeout in interface ShutdownStrategypublic void setTimeUnit(TimeUnit timeUnit)
ShutdownStrategy
setTimeUnit in interface ShutdownStrategytimeUnit - the unit to usepublic TimeUnit getTimeUnit()
ShutdownStrategy
getTimeUnit in interface ShutdownStrategypublic void setShutdownNowOnTimeout(boolean shutdownNowOnTimeout)
ShutdownStrategyCamelContext has been shutdown.
setShutdownNowOnTimeout in interface ShutdownStrategyshutdownNowOnTimeout - true to force shutdown, false to leave them runningpublic boolean isShutdownNowOnTimeout()
ShutdownStrategy
isShutdownNowOnTimeout in interface ShutdownStrategyprotected void shutdownRoutesNow(List<RouteStartupOrder> routes)
routes - the routes to shutdownprotected void shutdownNow(List<Consumer> consumers)
consumers - the consumers to shutdownprotected void shutdownNow(Consumer consumer)
consumer - the consumer to shutdown
protected void suspendNow(SuspendableService service,
Consumer consumer)
service - the suspendable consumerconsumer - the consumer to suspend
protected void doStart()
throws Exception
doStart in class ServiceSupportException
protected void doStop()
throws Exception
doStop in class ServiceSupportException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||