Package org.apache.camel.main
Interface MainShutdownStrategy
-
- All Known Implementing Classes:
DefaultMainShutdownStrategy,SimpleMainShutdownStrategy
public interface MainShutdownStrategyGraceful shutdown when using Camel Main.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceMainShutdownStrategy.ShutdownEventListenerEvent listener when shutting down.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddShutdownListener(MainShutdownStrategy.ShutdownEventListener listener)Adds a shutdown listenervoidawait()Waiting for Camel Main to complete.booleanawait(long timeout, TimeUnit unit)Waiting for Camel Main to complete (with timeout).booleanisRunAllowed()Returns true if the application is allowed to run.voidrestartAwait()This is used for restarting await with timeout.booleanshutdown()Return true if the shutdown has been initiated by the caller.
-
-
-
Method Detail
-
addShutdownListener
void addShutdownListener(MainShutdownStrategy.ShutdownEventListener listener)
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
void await() throws InterruptedExceptionWaiting for Camel Main to complete.- Throws:
InterruptedException
-
await
boolean await(long timeout, TimeUnit unit) throws InterruptedExceptionWaiting 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.
-
-