Class ScriptItemRefresher

java.lang.Object
org.openhab.core.model.script.jvmmodel.ScriptItemRefresher
All Implemented Interfaces:
RegistryChangeListener<Item>, ItemRegistryChangeListener

public class ScriptItemRefresher extends Object implements 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 Details

    • ScriptItemRefresher

      public ScriptItemRefresher()
  • Method Details

    • setModelRepository

      public void setModelRepository(ModelRepository modelRepository)
    • unsetModelRepository

      public void unsetModelRepository(ModelRepository modelRepository)
    • setItemRegistry

      public void setItemRegistry(ItemRegistry itemRegistry)
    • unsetItemRegistry

      public void unsetItemRegistry(ItemRegistry itemRegistry)
    • addActionService

      protected void addActionService(ActionService actionService)
    • removeActionService

      protected void removeActionService(ActionService actionService)
    • added

      public void added(Item element)
      Description copied from interface: RegistryChangeListener
      Notifies the listener that a single element has been added.
      Specified by:
      added in interface RegistryChangeListener<Item>
      Parameters:
      element - the element that has been added
    • removed

      public void removed(Item element)
      Description copied from interface: RegistryChangeListener
      Notifies the listener that a single element has been removed.
      Specified by:
      removed in interface RegistryChangeListener<Item>
      Parameters:
      element - the element that has been removed
    • updated

      public void updated(Item oldElement, Item element)
      Description copied from interface: RegistryChangeListener
      Notifies the listener that a single element has been updated.
      Specified by:
      updated in interface RegistryChangeListener<Item>
      Parameters:
      oldElement - the element that has been updated
      element - the new element
    • allItemsChanged

      public void allItemsChanged(Collection<String> oldItemNames)
      Description copied from interface: ItemRegistryChangeListener
      Notifies the listener that all items in the registry have changed and thus should be reloaded.
      Specified by:
      allItemsChanged in interface ItemRegistryChangeListener
      Parameters:
      oldItemNames - a collection of all previous item names, so that references can be removed