Interface Configurable
public interface Configurable
The configuration update process includes the following steps: a proposal
of a new configuration; verification of its correctness; approval of the proposal;
and application of the new configuration. The protocol of the proposal and approval steps
is determined by the installed supervisor service. The verification and application
of the parameters are implemented by the service with
verifyConfiguration(ExecutionContext, Configuration)
and applyConfiguration(ExecutionContext, Configuration)
methods.
Services may use the same configuration parameters as
in Service.initialize(ExecutionContext, Configuration)
, or different.
-
Method Summary
Modifier and Type Method Description void
applyConfiguration(ExecutionContext context, Configuration configuration)
Applies the given configuration to this service.void
verifyConfiguration(ExecutionContext context, Configuration configuration)
Verifies the correctness of the proposed configuration.
-
Method Details
-
verifyConfiguration
Verifies the correctness of the proposed configuration.This method is called when a new configuration is proposed. If the proposed configuration is correct, this method shall return with no changes to the service data. If it is not valid, this method shall throw an exception.
- Parameters:
context
- a read-only execution context object, providing access to the current database stateconfiguration
- a proposed configuration- Throws:
ExecutionException
- if the proposed configuration is not valid to prevent the configuration application
-
applyConfiguration
Applies the given configuration to this service. The configuration is guaranteed to be valid according toverifyConfiguration(ExecutionContext, Configuration)
.The implementation shall make any changes to the service persistent state to apply the new configuration, because the supervisor does not store them for later retrieval.
- Parameters:
context
- an execution context for this serviceconfiguration
- a new valid configuration
-