Package org.apache.camel.main
Class SimpleMainShutdownStrategy
- java.lang.Object
-
- org.apache.camel.main.SimpleMainShutdownStrategy
-
- All Implemented Interfaces:
MainShutdownStrategy
- Direct Known Subclasses:
DefaultMainShutdownStrategy
public class SimpleMainShutdownStrategy extends Object implements MainShutdownStrategy
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.camel.main.MainShutdownStrategy
MainShutdownStrategy.ShutdownEventListener
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.slf4j.Logger
LOG
-
Constructor Summary
Constructors Constructor Description SimpleMainShutdownStrategy()
-
Method Summary
All Methods Instance Methods Concrete 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
-
isRunAllowed
public boolean isRunAllowed()
- Specified by:
isRunAllowed
in interfaceMainShutdownStrategy
- Returns:
- true if the application is allowed to run.
-
addShutdownListener
public void addShutdownListener(MainShutdownStrategy.ShutdownEventListener listener)
- Specified by:
addShutdownListener
in interfaceMainShutdownStrategy
-
shutdown
public boolean shutdown()
- Specified by:
shutdown
in interfaceMainShutdownStrategy
- Returns:
- true if the shutdown has been initiated by the caller.
-
await
public void await() throws InterruptedException
Description copied from interface:MainShutdownStrategy
Wait for main to complete.- Specified by:
await
in interfaceMainShutdownStrategy
- Throws:
InterruptedException
-
await
public void await(long timeout, TimeUnit unit) throws InterruptedException
Description copied from interface:MainShutdownStrategy
Wait for main to complete.- Specified by:
await
in interfaceMainShutdownStrategy
- Parameters:
timeout
- the maximum time to waitunit
- the time unit of thetimeout
argument- Throws:
InterruptedException
-
-