Class TimerService

java.lang.Object
org.openremote.container.timer.TimerService
All Implemented Interfaces:
org.openremote.model.ContainerService, org.openremote.model.rules.RulesClock

public class TimerService extends Object implements org.openremote.model.ContainerService, org.openremote.model.rules.RulesClock
Wall real clock timer or pseudo clock time (for testing).
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
     
    static final int
     
    static final String
     
    static final String
     

    Fields inherited from interface org.openremote.model.ContainerService

    DEFAULT_PRIORITY, HIGH_PRIORITY, LOW_PRIORITY, MED_PRIORITY
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
    long
     
     
    int
    Gets the priority of this service which is used to determine initialization order when services are auto discovered; services with a lower priority are initialized and started first.
    void
    init(org.openremote.model.Container container)
    All services are initialized in the order they have been added to the container (if container started with explicit list of services) otherwise they are initialized in order of ContainerService.getPriority().
    void
    start(org.openremote.model.Container container)
    After initialization, services are started in the order they have been added to the container (if container started with explicit list of services) otherwise they are started in order of ContainerService.getPriority().
    void
    stop(org.openremote.model.Container container)
    When the container is shutting down, it stops all services in the reverse order they were started.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • TimerService

      public TimerService()
  • Method Details

    • getPriority

      public int getPriority()
      Description copied from interface: org.openremote.model.ContainerService
      Gets the priority of this service which is used to determine initialization order when services are auto discovered; services with a lower priority are initialized and started first.
      Specified by:
      getPriority in interface org.openremote.model.ContainerService
    • init

      public void init(org.openremote.model.Container container) throws Exception
      Description copied from interface: org.openremote.model.ContainerService
      All services are initialized in the order they have been added to the container (if container started with explicit list of services) otherwise they are initialized in order of ContainerService.getPriority().
      Specified by:
      init in interface org.openremote.model.ContainerService
      Throws:
      Exception
    • start

      public void start(org.openremote.model.Container container) throws Exception
      Description copied from interface: org.openremote.model.ContainerService
      After initialization, services are started in the order they have been added to the container (if container started with explicit list of services) otherwise they are started in order of ContainerService.getPriority().
      Specified by:
      start in interface org.openremote.model.ContainerService
      Throws:
      Exception
    • stop

      public void stop(org.openremote.model.Container container) throws Exception
      Description copied from interface: org.openremote.model.ContainerService
      When the container is shutting down, it stops all services in the reverse order they were started.
      Specified by:
      stop in interface org.openremote.model.ContainerService
      Throws:
      Exception
    • getClock

      public TimerService.Clock getClock()
    • getCurrentTimeMillis

      public long getCurrentTimeMillis()
      Specified by:
      getCurrentTimeMillis in interface org.openremote.model.rules.RulesClock
    • getNow

      public Instant getNow()
      Specified by:
      getNow in interface org.openremote.model.rules.RulesClock
    • toString

      public String toString()
      Overrides:
      toString in class Object