Package org.apache.camel.main
Class DefaultMainShutdownStrategy
- java.lang.Object
-
- org.apache.camel.main.SimpleMainShutdownStrategy
-
- org.apache.camel.main.DefaultMainShutdownStrategy
-
- All Implemented Interfaces:
MainShutdownStrategy
public class DefaultMainShutdownStrategy extends SimpleMainShutdownStrategy
Implementation ofMainShutdownStrategy
that add a virtual machine shutdown hook to properly stop the main instance.
-
-
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 DefaultMainShutdownStrategy(BaseMainSupport main)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
await()
Waiting for Camel Main to complete.boolean
await(long timeout, TimeUnit unit)
Waiting for Camel Main to complete (with timeout).void
disableHangupSupport()
Disable the hangup support.void
enableHangupSupport()
Hangup support is enabled by default.-
Methods inherited from class org.apache.camel.main.SimpleMainShutdownStrategy
addShutdownListener, getExtraShutdownTimeout, isRunAllowed, restartAwait, setExtraShutdownTimeout, shutdown
-
-
-
-
Constructor Detail
-
DefaultMainShutdownStrategy
public DefaultMainShutdownStrategy(BaseMainSupport main)
-
-
Method Detail
-
disableHangupSupport
public void disableHangupSupport()
Disable the hangup support. No graceful stop by calling stop() on a Hangup signal.
-
enableHangupSupport
public void enableHangupSupport()
Hangup support is enabled by default.
-
await
public void await() throws InterruptedException
Description copied from interface:MainShutdownStrategy
Waiting for Camel Main to complete.- Specified by:
await
in interfaceMainShutdownStrategy
- Overrides:
await
in classSimpleMainShutdownStrategy
- Throws:
InterruptedException
-
await
public boolean await(long timeout, TimeUnit unit) throws InterruptedException
Description copied from interface:MainShutdownStrategy
Waiting for Camel Main to complete (with timeout).- Specified by:
await
in interfaceMainShutdownStrategy
- Overrides:
await
in classSimpleMainShutdownStrategy
- Parameters:
timeout
- the maximum time to waitunit
- the time unit of thetimeout
argument- Returns:
- true if Camel Main was completed before the timeout, false if timeout was triggered.
- Throws:
InterruptedException
-
-