Class AbstractWorker

    • Constructor Summary

      Constructors 
      Constructor Description
      AbstractWorker()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void activate​(java.lang.String name)
      Initializes the worker and starts the worker thread
      void deactivate()
      Stops the worker thread
      protected abstract void forever()
      This method is called in a loop forever until the Thread gets interrupted.
      protected abstract int getCycleTime()
      Gets the cycleTime of this worker in [ms].
      void triggerNextRun()
      Allows the next execution of the forever() method.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractWorker

        public AbstractWorker()
    • Method Detail

      • activate

        public void activate​(java.lang.String name)
        Initializes the worker and starts the worker thread
        Parameters:
        name -
      • deactivate

        public void deactivate()
        Stops the worker thread
      • forever

        protected abstract void forever()
                                 throws java.lang.Throwable
        This method is called in a loop forever until the Thread gets interrupted.
        Throws:
        java.lang.Throwable
      • getCycleTime

        protected abstract int getCycleTime()
        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
        Returns:
      • triggerNextRun

        public void triggerNextRun()
        Allows the next execution of the forever() method.