Service Implementations
The OpenJAUS SDK provides a number of service implementations that can be used to quickly build a JAUS Component. The Core (AS5710A) service implementations (Transport, Events, AccessContol, Management, Liveness, Discovery) are built into the base Components and are included automatically depending on which base Component is used. Additional service implementations must be manually added to the Component.
There are two styles of service implementations provided:
- Inheritance based implementations
- Delegate based implementations
Inheritance based implementations (Older)
The older and more common service implementation style is the inheritance based implementation. It is anticipated that all service implementations will eventually be migrated to the delegate based implementation style (see below).
This style of service implementation requires the derived Component class to inherit from the service implementation class to implement the service behavior. In addition, the derived class should call the configure
, start
, and stop
methods of the service implementation to ensure that it is correctly configured, started, and/or stopped. Some service implementations may also require the derived Component class to override and implement some additional methods to handle service specific behavior.
Inheritance based service implementations end with Impl
in the class name. For example, the HealthReporter
inheritance based service implementation is named HealthReporterImpl
.
Example:
Delegate based implementations (Newer)
The newer and preferred service implementation style is the delegate based implementation. Not all service implementations are supported using this style (especially older implementations), however, it is anticipated that all future service implementations will follow this style.
This style of service implementation requires the derived Component class to create an instance of the service implementation and implement all the service interface methods by calling into the service implementation delegate. In addition, the derived Component class may need to call the configure
, start
, and/or stop
methods of the service implementation to ensure that it is correctly configured, started, and/or stopped. Some service implementations may also require the Component class to register functions / callbacks to handle service specific behavior.
Delegate based service implementations end with Delegate
in the class name. For example, the DigitalResourceDiscovery
delegate based service implementation is named DigitalResourceDiscoveryDelegate
.
Example: