Package org.apache.camel.main
Class DefaultMainShutdownStrategy
java.lang.Object
org.apache.camel.main.SimpleMainShutdownStrategy
org.apache.camel.main.DefaultMainShutdownStrategy
- All Implemented Interfaces:
MainShutdownStrategy
Implementation of
MainShutdownStrategy
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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
await()
Waiting for Camel Main to complete.boolean
Waiting for Camel Main to complete (with timeout).void
Disable the hangup support.void
Hangup support is enabled by default.Methods inherited from class org.apache.camel.main.SimpleMainShutdownStrategy
addShutdownListener, getExtraShutdownTimeout, isRunAllowed, restartAwait, setExtraShutdownTimeout, shutdown
-
Field Details
-
LOG
protected static final org.slf4j.Logger LOG
-
-
Constructor Details
-
DefaultMainShutdownStrategy
-
-
Method Details
-
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
Description copied from interface:MainShutdownStrategy
Waiting for Camel Main to complete.- Specified by:
await
in interfaceMainShutdownStrategy
- Overrides:
await
in classSimpleMainShutdownStrategy
- Throws:
InterruptedException
-
await
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
-