Interface CamelContextLifecycle

All Superinterfaces:
AutoCloseable
All Known Subinterfaces:
CamelContext, CatalogCamelContext

public interface CamelContextLifecycle extends AutoCloseable
Lifecycle API for CamelContext.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Builds the CamelContext.
    void
    Closes (Shutdown) the CamelContext, which means it cannot be started again.
    Get the status of this CamelContext
    void
    Initializes the CamelContext.
    boolean
    Helper methods so the CamelContext knows if it should keep running.
    boolean
    Whether the CamelContext is started
    boolean
    Whether the CamelContext is starting
    boolean
    Whether the CamelContext is stopped
    boolean
    Whether the CamelContext is stopping
    boolean
    Whether the CamelContext is suspended
    boolean
    Whether the CamelContext is suspending
    void
    Resumes the CamelContext.
    void
    Shutdown the CamelContext, which means it cannot be started again.
    void
    Starts the CamelContext (important: the start method is not blocked, see more details in the
    invalid reference
    Main
    documentation for running Camel Standalone).
    void
    Stop and shutdown the CamelContext (will stop all routes/components/endpoints etc and clear internal state/cache).
    void
    Suspends the CamelContext.
  • Method Details

    • start

      void start()
      Starts the CamelContext (important: the start method is not blocked, see more details in the
      invalid reference
      Main
      documentation for running Camel Standalone).

      See more details at the class-level javadoc at CamelContext.

      Throws:
      RuntimeCamelException - is thrown if starting failed
    • stop

      void stop()
      Stop and shutdown the CamelContext (will stop all routes/components/endpoints etc and clear internal state/cache).

      See more details at the class-level javadoc at CamelContext.

      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 at CamelContext.

    • close

      void close() throws Exception
      Closes (Shutdown) the CamelContext, which means it cannot be started again.
      Specified by:
      close in interface AutoCloseable
      Throws:
      Exception - is thrown if shutdown failed
    • getStatus

      ServiceStatus getStatus()
      Get the status of this CamelContext
      Returns:
      the status