The Greengrass nucleus component provides functionality for device side orchestration of deployments and lifecycle management for execution of Greengrass components and applications. This includes features such as starting, stopping, and monitoring execution of components and apps, interprocess communication server for communication between components, component installation and configuration management. It manages the model that describes the software running on the device. The model is a dependency graph of services. Services have three primary aspects:
A service may have processes, threads, code, network connections, ... But not necessarily. Some have all of these, some have only one.
You can think of the nucleus as a mash-up of make
, a super-lightweight publish/subscribe system, and a small
hierarchic key-value data store. The various services have continuously varying states that the nucleus monitors and manages.
A dependent service is not started until its dependencies are started, and if they become unstable, the dependent service is notified.
The internal interconnections are handled via dependency injection. Restarts are managed automatically.
When configuration changes, all users of them are notified. Everything adapts continuously.
context.java
which contains a Map of known objects, and the ability to get (and magically create) objects from the
Context. When an object is created by the framework, it does dependency injection. If the created object
participates in the Lifecycle framework, its lifecycle is initiated. This feeds the Lifecycle dependency graph.GreengrassService
, which contains most of the state transition logic. GenericExternalService
is a
subclass that implements a service whose behavior is defined by commands and scripts. Either of these classes may be
subclassed to provide services whose behavior is defined by code running within Greengrass.