Class AppSynchronizeWorker

java.lang.Object
io.openems.common.worker.AbstractWorker
io.openems.edge.core.appmanager.AppSynchronizeWorker

public class AppSynchronizeWorker extends AbstractWorker
  • Constructor Details

    • AppSynchronizeWorker

      protected AppSynchronizeWorker(AppManagerImpl parent)
  • Method Details

    • forever

      protected void forever() throws Throwable
      Description copied from class: AbstractWorker
      This method is called in a loop forever until the Thread gets interrupted.
      Specified by:
      forever in class AbstractWorker
      Throws:
      Throwable
    • syncAppsWithBackend

      public boolean syncAppsWithBackend() throws InterruptedException
      Synchronizes the apps with the backend.
      Returns:
      true if successful else false
      Throws:
      InterruptedException
    • getSynchronizationLock

      public final Object getSynchronizationLock()
      Gets the lock for synchronizing apps with the backend. Should be used when apps get installed/updated/removed.
      Returns:
      the lock
    • 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 class AbstractWorker
      Returns:
      the cycleTime
    • setValidBackendResponse

      public void setValidBackendResponse(boolean validBackendResponse)
      Sets if the last request was a valid response from the backend.
      Parameters:
      validBackendResponse - if the last response was valid
    • triggerNextRun

      public void triggerNextRun()
      Description copied from class: AbstractWorker
      Allows the next execution of the forever() method.
      Overrides:
      triggerNextRun in class AbstractWorker