use of org.eclipse.smarthome.automation.handler.RuleEngineCallback in project smarthome by eclipse.
the class RuleEngine method register.
/**
* This method register the Rule to start working. This is the final step of initialization process where triggers
* received {@link RuleEngineCallback}s object and starts to notify the rule engine when they are triggered. After
* activating all triggers the rule goes into IDLE state
*
* @param rule an initialized rule which has to starts tracking the triggers.
*/
private void register(RuntimeRule rule) {
RuleEngineCallback reCallback = getRuleEngineCallback(rule);
for (Iterator<Trigger> it = rule.getTriggers().iterator(); it.hasNext(); ) {
RuntimeTrigger t = (RuntimeTrigger) it.next();
TriggerHandler triggerHandler = t.getModuleHandler();
triggerHandler.setRuleEngineCallback(reCallback);
}
}
Aggregations