public interface ShutdownPrepared
Service
to prepare for shutdown.
Important: Implementators of this interface must be a Service
as well.
This allows Processor
s to prepare for shutdown, such as when
CamelContext
or a Route
is shutting down.
The Processor
could be a stateful EIP such as the
AggregateProcessor
, allowing it to do custom work
to prepare for shutdown.Modifier and Type | Method and Description |
---|---|
void |
prepareShutdown(boolean forced)
Prepares for shutdown.
|
void prepareShutdown(boolean forced)
ShutdownStrategy
supports preparing for shutdown using two steps.
First a regular preparation, where the given forced parameter will be false.
And if the shutdown times out, then the ShutdownStrategy
performs a more aggressive
shutdown, calling this method a second time with true for the given forced parameter.
For example by graceful stopping any threads or the likes.
For forced shutdown, then the service is expected to aggressively shutdown any child services, such
as thread pools etc. This is the last chance it has to perform such duties.forced
- true is forcing a more aggressive shutdown, false is for preparing to shutdown.Apache Camel