diff --git a/bundles/org.openhab.core.model.rule/src/org/openhab/core/model/rule/jvmmodel/RulesRefresher.java b/bundles/org.openhab.core.model.rule/src/org/openhab/core/model/rule/jvmmodel/RulesRefresher.java index 2b9eb26bd0e08..941cf799b8390 100644 --- a/bundles/org.openhab.core.model.rule/src/org/openhab/core/model/rule/jvmmodel/RulesRefresher.java +++ b/bundles/org.openhab.core.model.rule/src/org/openhab/core/model/rule/jvmmodel/RulesRefresher.java @@ -77,11 +77,13 @@ public class RulesRefresher implements ReadyTracker { private final ItemRegistryChangeListener itemRegistryChangeListener = new ItemRegistryChangeListener() { @Override public void added(Item element) { + logger.debug("Item \"{}\" added => rules are going to be refreshed", element.getName()); scheduleRuleRefresh(); } @Override public void removed(Item element) { + logger.debug("Item \"{}\" removed => rules are going to be refreshed", element.getName()); scheduleRuleRefresh(); } @@ -91,6 +93,7 @@ public void updated(Item oldElement, Item element) { @Override public void allItemsChanged(Collection oldItemNames) { + logger.debug("All items changed => rules are going to be refreshed"); scheduleRuleRefresh(); } }; @@ -98,11 +101,13 @@ public void allItemsChanged(Collection oldItemNames) { private final ThingRegistryChangeListener thingRegistryChangeListener = new ThingRegistryChangeListener() { @Override public void added(Thing element) { + logger.debug("Thing \"{}\" added => rules are going to be refreshed", element.getUID().getAsString()); scheduleRuleRefresh(); } @Override public void removed(Thing element) { + logger.debug("Thing \"{}\" removed => rules are going to be refreshed", element.getUID().getAsString()); scheduleRuleRefresh(); } @@ -130,12 +135,14 @@ protected void activate() { @Reference(cardinality = ReferenceCardinality.MULTIPLE, policy = ReferencePolicy.DYNAMIC) protected void addActionService(ActionService actionService) { if (started) { + logger.debug("Script action added => rules are going to be refreshed"); scheduleRuleRefresh(); } } protected void removeActionService(ActionService actionService) { if (started) { + logger.debug("Script action removed => rules are going to be refreshed"); scheduleRuleRefresh(); } } @@ -143,12 +150,14 @@ protected void removeActionService(ActionService actionService) { @Reference(cardinality = ReferenceCardinality.MULTIPLE, policy = ReferencePolicy.DYNAMIC) protected void addThingActions(ThingActions thingActions) { if (started) { + logger.debug("Thing automation action added => rules are going to be refreshed"); scheduleRuleRefresh(); } } protected void removeThingActions(ThingActions thingActions) { if (started) { + logger.debug("Thing automation action removed => rules are going to be refreshed"); scheduleRuleRefresh(); } } diff --git a/bundles/org.openhab.core.model.script/src/org/openhab/core/model/script/jvmmodel/ScriptItemRefresher.java b/bundles/org.openhab.core.model.script/src/org/openhab/core/model/script/jvmmodel/ScriptItemRefresher.java index 5d947fcb95f77..e409277dfdce8 100644 --- a/bundles/org.openhab.core.model.script/src/org/openhab/core/model/script/jvmmodel/ScriptItemRefresher.java +++ b/bundles/org.openhab.core.model.script/src/org/openhab/core/model/script/jvmmodel/ScriptItemRefresher.java @@ -74,20 +74,24 @@ public void unsetItemRegistry(ItemRegistry itemRegistry) { @Reference(cardinality = ReferenceCardinality.MULTIPLE, policy = ReferencePolicy.DYNAMIC) protected void addActionService(ActionService actionService) { + logger.debug("Script action added => scripts are going to be refreshed"); scheduleScriptRefresh(); } protected void removeActionService(ActionService actionService) { + logger.debug("Script action removed => scripts are going to be refreshed"); scheduleScriptRefresh(); } @Override public void added(Item element) { + logger.debug("Item \"{}\" added => scripts are going to be refreshed", element.getName()); scheduleScriptRefresh(); } @Override public void removed(Item element) { + logger.debug("Item \"{}\" removed => scripts are going to be refreshed", element.getName()); scheduleScriptRefresh(); } @@ -98,6 +102,7 @@ public void updated(Item oldElement, Item element) { @Override public void allItemsChanged(Collection oldItemNames) { + logger.debug("All items changed => scripts are going to be refreshed"); scheduleScriptRefresh(); }