Package org.openremote.container.timer
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 -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected TimerService.Clock
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 -
Method Summary
Modifier and TypeMethodDescriptiongetClock()
long
getNow()
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 ofContainerService.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 ofContainerService.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.toString()
-
Field Details
-
TIMER_CLOCK_TYPE
- See Also:
-
TIMER_CLOCK_TYPE_DEFAULT
-
PRIORITY
public static final int PRIORITY- See Also:
-
clock
-
-
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 interfaceorg.openremote.model.ContainerService
-
init
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 ofContainerService.getPriority()
.- Specified by:
init
in interfaceorg.openremote.model.ContainerService
- Throws:
Exception
-
start
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 ofContainerService.getPriority()
.- Specified by:
start
in interfaceorg.openremote.model.ContainerService
- Throws:
Exception
-
stop
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 interfaceorg.openremote.model.ContainerService
- Throws:
Exception
-
getClock
-
getCurrentTimeMillis
public long getCurrentTimeMillis()- Specified by:
getCurrentTimeMillis
in interfaceorg.openremote.model.rules.RulesClock
-
getNow
- Specified by:
getNow
in interfaceorg.openremote.model.rules.RulesClock
-
toString
-