Package org.apache.camel.spi
Interface StartupConditionStrategy
- All Superinterfaces:
AutoCloseable,Service,StaticService
Strategy for performing checks on startup that can validate whether Camel can be started, or wait for some conditions
to be satisfied, before Camel can continue to startup.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddStartupCondition(StartupCondition startupCondition) Adds a customStartupConditioncheck to be performed.voidaddStartupConditions(String classNames) A list of custom class names (FQN) forStartupConditionclasses.voidChecks allStartupConditionwhether they are satisfied.intInterval in millis between checking startup conditionsWhat action, to do on timeout.Lists all theStartupCondition.intTotal timeout in millis when performing startup checks.booleanTo enable or disable startup checksvoidsetEnabled(boolean enabled) To enable or disable startup checksvoidsetInterval(int interval) Interval in millis between checking startup conditionsvoidsetOnTimeout(String onTimeout) What action, to do on timeout.voidsetTimeout(int timeout) Total timeout in millis when performing startup checks.
-
Method Details
-
isEnabled
boolean isEnabled()To enable or disable startup checks -
setEnabled
void setEnabled(boolean enabled) To enable or disable startup checks -
setInterval
void setInterval(int interval) Interval in millis between checking startup conditions -
getInterval
int getInterval()Interval in millis between checking startup conditions -
setTimeout
void setTimeout(int timeout) Total timeout in millis when performing startup checks. -
getTimeout
int getTimeout()Total timeout in millis when performing startup checks. -
getOnTimeout
String getOnTimeout()What action, to do on timeout. fail = do not startup, and throw an exception causing camel to fail stop = do not startup, and stop camel ignore = log a WARN and continue to startup -
setOnTimeout
What action, to do on timeout. fail = do not startup, and throw an exception causing camel to fail stop = do not startup, and stop camel ignore = log a WARN and continue to startup -
addStartupCondition
Adds a customStartupConditioncheck to be performed. -
addStartupConditions
A list of custom class names (FQN) forStartupConditionclasses. Multiple classes can be separated by comma. -
getStartupConditions
List<StartupCondition> getStartupConditions()Lists all theStartupCondition. -
checkStartupConditions
Checks allStartupConditionwhether they are satisfied. If everything is okay, then this method returns, otherwise if a condition is failing then an exception is thrown.- Throws:
Exception
-