Class VetoCamelContextStartException

java.lang.Object
java.lang.Throwable
java.lang.Exception
org.apache.camel.VetoCamelContextStartException
All Implemented Interfaces:
Serializable

public class VetoCamelContextStartException extends Exception
Thrown by a LifecycleStrategy to abort the startup of a CamelContext.

Any LifecycleStrategy registered with the context can veto startup by throwing this exception from its onContextStarting callback. Whether the exception propagates out of CamelContextLifecycle.start() is controlled by isRethrowException(): when true (the default) the exception is re-thrown and the application sees a startup failure; when false the veto is silent and the context is simply not started.

See Also:
  • Constructor Details

    • VetoCamelContextStartException

      public VetoCamelContextStartException(String message, CamelContext context)
      Parameters:
      message - the detail message
      context - the CamelContext whose start is being vetoed
    • VetoCamelContextStartException

      public VetoCamelContextStartException(String message, CamelContext context, boolean rethrowException)
      Parameters:
      message - the detail message
      context - the CamelContext whose start is being vetoed
      rethrowException - whether to rethrow this exception when starting CamelContext
    • VetoCamelContextStartException

      public VetoCamelContextStartException(String message, Throwable cause, CamelContext context)
      Parameters:
      message - the detail message
      cause - the cause of the veto
      context - the CamelContext whose start is being vetoed
    • VetoCamelContextStartException

      public VetoCamelContextStartException(String message, Throwable cause, CamelContext context, boolean rethrowException)
      Parameters:
      message - the detail message
      cause - the cause of the veto
      context - the CamelContext whose start is being vetoed
      rethrowException - whether to rethrow this exception when starting CamelContext
  • Method Details

    • getContext

      public CamelContext getContext()
    • isRethrowException

      public boolean isRethrowException()
      Whether to rethrow this exception when starting CamelContext, to cause an exception to be thrown from the start method.

      This option is default true.