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 TypeMethodDescriptionvoid
addStartupCondition
(StartupCondition startupCondition) Adds a customStartupCondition
check to be performed.void
addStartupConditions
(String classNames) A list of custom class names (FQN) forStartupCondition
classes.void
Checks allStartupCondition
whether they are satisfied.int
Interval in millis between checking startup conditionsWhat action, to do on timeout.Lists all theStartupCondition
.int
Total timeout in millis when performing startup checks.boolean
To enable or disable startup checksvoid
setEnabled
(boolean enabled) To enable or disable startup checksvoid
setInterval
(int interval) Interval in millis between checking startup conditionsvoid
setOnTimeout
(String onTimeout) What action, to do on timeout.void
setTimeout
(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 customStartupCondition
check to be performed. -
addStartupConditions
A list of custom class names (FQN) forStartupCondition
classes. Multiple classes can be separated by comma. -
getStartupConditions
List<StartupCondition> getStartupConditions()Lists all theStartupCondition
. -
checkStartupConditions
Checks allStartupCondition
whether they are satisfied. If everything is okay, then this method returns, otherwise if a condition is failing then an exception is thrown.- Throws:
Exception
-