Package org.apache.camel.main
Interface MainShutdownStrategy
- All Known Implementing Classes:
DefaultMainShutdownStrategy,SimpleMainShutdownStrategy
public interface MainShutdownStrategy
Graceful shutdown when using Camel Main.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceEvent listener when shutting down. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a shutdown listenervoidawait()Waiting for Camel Main to complete.booleanWaiting for Camel Main to complete (with timeout).intbooleanReturns true if the application is allowed to run.voidThis is used for restarting await with timeout.voidsetExtraShutdownTimeout(int extraShutdownTimeout) Extra timeout in seconds to graceful shutdown Camel.booleanshutdown()Return true if the shutdown has been initiated by the caller.
-
Method Details
-
addShutdownListener
Adds a shutdown listener- Parameters:
listener- the listener
-
isRunAllowed
boolean isRunAllowed()Returns true if the application is allowed to run.- Returns:
- true if the application is allowed to run.
-
shutdown
boolean shutdown()Return true if the shutdown has been initiated by the caller.- Returns:
- true if the shutdown has been initiated by the caller.
-
await
Waiting for Camel Main to complete.- Throws:
InterruptedException
-
await
Waiting for Camel Main to complete (with timeout).- Parameters:
timeout- the maximum time to waitunit- the time unit of thetimeoutargument- Returns:
- true if Camel Main was completed before the timeout, false if timeout was triggered.
- Throws:
InterruptedException
-
restartAwait
void restartAwait()This is used for restarting await with timeout. -
getExtraShutdownTimeout
int getExtraShutdownTimeout() -
setExtraShutdownTimeout
void setExtraShutdownTimeout(int extraShutdownTimeout) Extra timeout in seconds to graceful shutdown Camel. When Camel is shutting down then Camel first shutdown all the routes (shutdownTimeout). Then additional services is shutdown (extraShutdownTimeout).
-