Class EdgeConfigWorker
java.lang.Object
io.openems.common.worker.AbstractWorker
io.openems.edge.core.componentmanager.ComponentManagerWorker
io.openems.edge.core.componentmanager.EdgeConfigWorker
- All Implemented Interfaces:
org.osgi.service.cm.ConfigurationListener
This Worker constantly checks if
EdgeConfig
was updated, e.g. because
configuration properties changed or Channels changed. If an update was
recognized, an event is announced.-
Field Summary
Fields inherited from class io.openems.edge.core.componentmanager.ComponentManagerWorker
parent
Fields inherited from class io.openems.common.worker.AbstractWorker
ALWAYS_WAIT_FOR_TRIGGER_NEXT_RUN, DO_NOT_WAIT, thread
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
configurationEvent
(org.osgi.service.cm.ConfigurationEvent event) protected void
forever()
This method is called in a loop forever until the Thread gets interrupted.protected int
Gets the cycleTime of this worker in [ms].Gets the EdgeConfig object; updates the cache if necessary and publishes a CONFIG_UPDATE event on update.Methods inherited from class io.openems.edge.core.componentmanager.ComponentManagerWorker
debugLog
Methods inherited from class io.openems.common.worker.AbstractWorker
activate, deactivate, modified, triggerNextRun
-
Constructor Details
-
EdgeConfigWorker
-
-
Method Details
-
forever
protected void forever()Description copied from class:AbstractWorker
This method is called in a loop forever until the Thread gets interrupted.- Specified by:
forever
in classAbstractWorker
-
getEdgeConfig
Gets the EdgeConfig object; updates the cache if necessary and publishes a CONFIG_UPDATE event on update.- Returns:
- the
EdgeConfig
-
getCycleTime
protected int getCycleTime()Description copied from class:AbstractWorker
Gets the cycleTime of this worker in [ms].- > 0 sets the minimum execution time of one Cycle
- = 0 never wait between two consecutive executions of forever()
- < 0 causes the Cycle to sleep forever until 'triggerNextRun()' is called
- Specified by:
getCycleTime
in classAbstractWorker
- Returns:
- the cycleTime
-
configurationEvent
public void configurationEvent(org.osgi.service.cm.ConfigurationEvent event) - Specified by:
configurationEvent
in interfaceorg.osgi.service.cm.ConfigurationListener
- Overrides:
configurationEvent
in classComponentManagerWorker
-