Package io.openems.edge.core.appmanager
Class AppValidateWorker
java.lang.Object
io.openems.common.worker.AbstractWorker
io.openems.edge.core.appmanager.AppValidateWorker
- All Implemented Interfaces:
org.osgi.service.cm.ConfigurationListener
public class AppValidateWorker
extends AbstractWorker
implements org.osgi.service.cm.ConfigurationListener
This Worker constantly validates:.
- that all enabled OpenEMS Apps are properly configured, including required OpenEMS Components, IP addresses, Scheduler settings, etc.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionMap from App to defect details.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) void
Stops the worker thread.protected String
debugLog()
Called by parent debugLog.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
setConfig
(AppValidateWorker.Config config) void
Allows the next execution of the forever() method.protected void
Validates all Apps.Methods inherited from class io.openems.common.worker.AbstractWorker
activate, activate, modified, modified
-
Field Details
-
defectiveApps
Map from App to defect details.
-
-
Constructor Details
-
AppValidateWorker
public AppValidateWorker()
-
-
Method Details
-
deactivate
public void deactivate()Description copied from class:AbstractWorker
Stops the worker thread.- Overrides:
deactivate
in classAbstractWorker
-
configurationEvent
public void configurationEvent(org.osgi.service.cm.ConfigurationEvent event) - Specified by:
configurationEvent
in interfaceorg.osgi.service.cm.ConfigurationListener
-
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
-
triggerNextRun
public void triggerNextRun()Description copied from class:AbstractWorker
Allows the next execution of the forever() method.- Overrides:
triggerNextRun
in classAbstractWorker
-
setConfig
-
debugLog
Called by parent debugLog.- Returns:
- a debug log String or null
-
validateApps
protected void validateApps()Validates all Apps.'protected' so that it can be used in a JUnit test.
-