Class OsgiValidateWorker
java.lang.Object
io.openems.common.worker.AbstractWorker
io.openems.edge.core.componentmanager.ComponentManagerWorker
io.openems.edge.core.componentmanager.OsgiValidateWorker
- All Implemented Interfaces:
org.osgi.service.cm.ConfigurationListener
This Worker constantly validates:.
- that all configured OpenEMS-Components are actually activated. Otherwise
it sets the
ComponentManager.ChannelId.CONFIG_NOT_ACTIVATED
channel. - that there is no duplicated Component-ID in the system. Otherwise it sets
the
ComponentManager.ChannelId.DUPLICATED_COMPONENT_ID
channel.
Next to the Warning/Fault channels details are also printed to console on debugLog.
-
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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
configurationEvent
(org.osgi.service.cm.ConfigurationEvent event) debugLog()
Gets some output that is suitable for a continuous Debug log.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].void
Allows the next execution of the forever() method.Methods inherited from class io.openems.common.worker.AbstractWorker
activate, activate, deactivate, modified, modified, setPriority
-
Constructor Details
-
OsgiValidateWorker
-
-
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
-
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
-
triggerNextRun
public void triggerNextRun()Description copied from class:AbstractWorker
Allows the next execution of the forever() method.- Overrides:
triggerNextRun
in classAbstractWorker
-
debugLog
Description copied from class:ComponentManagerWorker
Gets some output that is suitable for a continuous Debug log. Returns 'null' by default which causes no output.- Overrides:
debugLog
in classComponentManagerWorker
- Returns:
- the debug log output
-