Class ScriptItemRefresher
java.lang.Object
org.openhab.core.model.script.jvmmodel.ScriptItemRefresher
- All Implemented Interfaces:
RegistryChangeListener<Item>,ItemRegistryChangeListener
The
ScriptItemRefresher is responsible for reloading script resources every time an item is added or removed.- Author:
- Oliver Libutzki - Initial contribution, Kai Kreuzer - added delayed execution
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddActionService(ActionService actionService) voidNotifies the listener that a single element has been added.voidallItemsChanged(Collection<String> oldItemNames) Notifies the listener that all items in the registry have changed and thus should be reloaded.protected voidremoveActionService(ActionService actionService) voidNotifies the listener that a single element has been removed.voidsetItemRegistry(ItemRegistry itemRegistry) voidsetModelRepository(ModelRepository modelRepository) voidunsetItemRegistry(ItemRegistry itemRegistry) voidunsetModelRepository(ModelRepository modelRepository) voidNotifies the listener that a single element has been updated.
-
Constructor Details
-
ScriptItemRefresher
public ScriptItemRefresher()
-
-
Method Details
-
setModelRepository
-
unsetModelRepository
-
setItemRegistry
-
unsetItemRegistry
-
addActionService
-
removeActionService
-
added
Description copied from interface:RegistryChangeListenerNotifies the listener that a single element has been added.- Specified by:
addedin interfaceRegistryChangeListener<Item>- Parameters:
element- the element that has been added
-
removed
Description copied from interface:RegistryChangeListenerNotifies the listener that a single element has been removed.- Specified by:
removedin interfaceRegistryChangeListener<Item>- Parameters:
element- the element that has been removed
-
updated
Description copied from interface:RegistryChangeListenerNotifies the listener that a single element has been updated.- Specified by:
updatedin interfaceRegistryChangeListener<Item>- Parameters:
oldElement- the element that has been updatedelement- the new element
-
allItemsChanged
Description copied from interface:ItemRegistryChangeListenerNotifies the listener that all items in the registry have changed and thus should be reloaded.- Specified by:
allItemsChangedin interfaceItemRegistryChangeListener- Parameters:
oldItemNames- a collection of all previous item names, so that references can be removed
-