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 Classes Modifier and Type Interface Description static interface
MainShutdownStrategy.ShutdownEventListener
Event listener when shutting down.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addShutdownListener(MainShutdownStrategy.ShutdownEventListener listener)
void
await()
Wait for main to complete.void
await(long timeout, TimeUnit unit)
Wait for main to complete.boolean
isRunAllowed()
boolean
shutdown()
-
-
-
Method Detail
-
addShutdownListener
void addShutdownListener(MainShutdownStrategy.ShutdownEventListener listener)
-
isRunAllowed
boolean isRunAllowed()
- Returns:
- true if the application is allowed to run.
-
shutdown
boolean shutdown()
- Returns:
- true if the shutdown has been initiated by the caller.
-
await
void await() throws InterruptedException
Wait for main to complete.- Throws:
InterruptedException
-
await
void await(long timeout, TimeUnit unit) throws InterruptedException
Wait for main to complete.- Parameters:
timeout
- the maximum time to waitunit
- the time unit of thetimeout
argument- Throws:
InterruptedException
-
-