Package org.openremote.model
Interface ContainerService
- All Known Subinterfaces:
HealthStatusProvider
,KeyStoreService
public interface ContainerService
The
Container
is a registry of services, the order of services in a container is important and is determined
by the getPriority()
value; when starting the Container
using the auto service discovery mechanism.
If the container is started with an explicit list of services then the insertion order is used.
Service startup lifecycle:
init(org.openremote.model.Container)
in registry insertion orderstart(org.openremote.model.Container)
in registry insertion order
Service shutdown lifecycle:
stop(org.openremote.model.Container)
in reverse registry order
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
-
Method Summary
Modifier and TypeMethodDescriptiondefault 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
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 ofgetPriority()
.void
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 ofgetPriority()
.void
When the container is shutting down, it stops all services in the reverse order they were started.
-
Field Details
-
DEFAULT_PRIORITY
static final int DEFAULT_PRIORITY- See Also:
-
HIGH_PRIORITY
static final int HIGH_PRIORITY- See Also:
-
MED_PRIORITY
static final int MED_PRIORITY- See Also:
-
LOW_PRIORITY
static final int LOW_PRIORITY- See Also:
-
-
Method Details
-
getPriority
default int getPriority()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. -
init
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 ofgetPriority()
.- Throws:
Exception
-
start
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 ofgetPriority()
.- Throws:
Exception
-
stop
When the container is shutting down, it stops all services in the reverse order they were started.- Throws:
Exception
-