use of org.eclipse.smarthome.automation.handler.ModuleHandler in project smarthome by eclipse.
the class CompositeModuleHandlerFactory method ungetHandler.
@SuppressWarnings({ "unchecked" })
@Override
public void ungetHandler(Module module, String childModulePrefix, ModuleHandler handler) {
ModuleHandler handlerOfModule = getHandlers().get(childModulePrefix + module.getId());
if (handlerOfModule instanceof AbstractCompositeModuleHandler) {
AbstractCompositeModuleHandler<Module, ?, ?> h = (AbstractCompositeModuleHandler<Module, ?, ?>) handlerOfModule;
Set<Module> modules = h.moduleHandlerMap.keySet();
if (modules != null) {
for (Module child : modules) {
ModuleHandler childHandler = h.moduleHandlerMap.get(child);
ModuleHandlerFactory mhf = ruleEngine.getModuleHandlerFactory(child.getTypeUID());
mhf.ungetHandler(child, childModulePrefix + ":" + module.getId(), childHandler);
}
}
}
String ruleId = getRuleId(childModulePrefix);
super.ungetHandler(module, ruleId, handler);
}
Aggregations