Class VetoCamelContextStartException
java.lang.Object
java.lang.Throwable
java.lang.Exception
org.apache.camel.VetoCamelContextStartException
- All Implemented Interfaces:
Serializable
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 Summary
ConstructorsConstructorDescriptionVetoCamelContextStartException(String message, Throwable cause, CamelContext context) VetoCamelContextStartException(String message, Throwable cause, CamelContext context, boolean rethrowException) VetoCamelContextStartException(String message, CamelContext context) VetoCamelContextStartException(String message, CamelContext context, boolean rethrowException) -
Method Summary
Modifier and TypeMethodDescriptionbooleanWhether to rethrow this exception when starting CamelContext, to cause an exception to be thrown from the start method.Methods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
VetoCamelContextStartException
- Parameters:
message- the detail messagecontext- the CamelContext whose start is being vetoed
-
VetoCamelContextStartException
public VetoCamelContextStartException(String message, CamelContext context, boolean rethrowException) - Parameters:
message- the detail messagecontext- the CamelContext whose start is being vetoedrethrowException- whether to rethrow this exception when starting CamelContext
-
VetoCamelContextStartException
- Parameters:
message- the detail messagecause- the cause of the vetocontext- the CamelContext whose start is being vetoed
-
VetoCamelContextStartException
public VetoCamelContextStartException(String message, Throwable cause, CamelContext context, boolean rethrowException) - Parameters:
message- the detail messagecause- the cause of the vetocontext- the CamelContext whose start is being vetoedrethrowException- whether to rethrow this exception when starting CamelContext
-
-
Method Details
-
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.
-