Package org.apache.camel
Interface CamelContextLifecycle
-
- All Superinterfaces:
AutoCloseable
- All Known Subinterfaces:
CamelContext
,CatalogCamelContext
,ExtendedCamelContext
public interface CamelContextLifecycle extends AutoCloseable
Lifecycle API forCamelContext
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
build()
Builds the CamelContext.void
close()
Closes (Shutdown) the CamelContext, which means it cannot be started again.ServiceStatus
getStatus()
Get the status of this CamelContextvoid
init()
Initializes the CamelContext.boolean
isRunAllowed()
Helper methods so the CamelContext knows if it should keep running.boolean
isStarted()
Whether the CamelContext is startedboolean
isStarting()
Whether the CamelContext is startingboolean
isStopped()
Whether the CamelContext is stoppedboolean
isStopping()
Whether the CamelContext is stoppingboolean
isSuspended()
Whether the CamelContext is suspendedboolean
isSuspending()
Whether the CamelContext is suspendingvoid
resume()
Resumes the CamelContext.void
shutdown()
Shutdown the CamelContext, which means it cannot be started again.void
start()
Starts theCamelContext
(important: the start method is not blocked, see more details in theMain
documentation for running Camel Standalone).void
stop()
Stop and shutdown theCamelContext
(will stop all routes/components/endpoints etc and clear internal state/cache).void
suspend()
Suspends the CamelContext.
-
-
-
Method Detail
-
start
void start()
Starts theCamelContext
(important: the start method is not blocked, see more details in theMain
documentation for running Camel Standalone). See more details at the class-level javadoc atCamelContext
.- Throws:
RuntimeCamelException
- is thrown if starting failed
-
stop
void stop()
Stop and shutdown theCamelContext
(will stop all routes/components/endpoints etc and clear internal state/cache). See more details at the class-level javadoc atCamelContext
.- Throws:
RuntimeCamelException
- is thrown if stopping failed
-
isStarted
boolean isStarted()
Whether the CamelContext is started- Returns:
- true if this CamelContext has been started
-
isStarting
boolean isStarting()
Whether the CamelContext is starting- Returns:
- true if this CamelContext is being started
-
isStopping
boolean isStopping()
Whether the CamelContext is stopping- Returns:
- true if this CamelContext is in the process of stopping
-
isStopped
boolean isStopped()
Whether the CamelContext is stopped- Returns:
- true if this CamelContext is stopped
-
isSuspending
boolean isSuspending()
Whether the CamelContext is suspending- Returns:
- true if this CamelContext is in the process of suspending
-
isSuspended
boolean isSuspended()
Whether the CamelContext is suspended- Returns:
- true if this CamelContext is suspended
-
isRunAllowed
boolean isRunAllowed()
Helper methods so the CamelContext knows if it should keep running. Returns false if the CamelContext is being stopped or is stopped.- Returns:
- true if the CamelContext should continue to run.
-
build
void build()
Builds the CamelContext. This phase is intended for frameworks or runtimes that are capable of performing build-time optimizations such as with camel-quarkus.
-
init
void init()
Initializes the CamelContext.
-
suspend
void suspend()
Suspends the CamelContext.
-
resume
void resume()
Resumes the CamelContext.
-
shutdown
void shutdown()
Shutdown the CamelContext, which means it cannot be started again. See more details at the class-level javadoc atCamelContext
.
-
close
void close() throws Exception
Closes (Shutdown) the CamelContext, which means it cannot be started again.- Specified by:
close
in interfaceAutoCloseable
- Throws:
Exception
- is thrown if shutdown failed
-
getStatus
ServiceStatus getStatus()
Get the status of this CamelContext- Returns:
- the status
-
-