type
Service
src
const mixin Service
Services are used to publish functionality in a VM for use by other software components. The service registry for the VM is keyed by public types each service implements.
The following table illustrates the service lifecycle:
Method isInstalled isRunning ----------- ----------- ---------- constructed false false install true false start true true stop true false uninstall false false
While the service is installed, it may be looked up in the registry via find
and findAll
. The running state is used to invoke the onStart
and onStop
callbacks which gives the service a chance to setup/shutdown its actors and associated resources.
methods
equals |
Services are required to implement equality by reference. |
---|---|
find |
Find an installed service by type. |
findAll |
Find all services installed for the given type. |
hash |
Services are required to implement equality by reference. |
install |
Install this service into the VM's service registry. |
isInstalled |
Is the service in the installed state. |
isRunning |
Is the service in the running state. |
list |
List all the installed services. |
onStart |
Callback when service transitions into running state. |
onStop |
Callback when service transitions out of the running state. |
start |
Start this service. |
stop |
Stop this service. |
uninstall |
Uninstall this service from the VM's service registry. |