...
The diagram below demonstrates how the thread safe configuration modification can be implemented.
The special class TaskExecutor is responsible for starting/stopping and running the work thread where the changes can be made.
The change can be submitted as a Callable which is invoked from the dispatcher thread to invoke do the change (set attribute, create child, change state).
3 standard Callable implementations are displayed on diagram to perform the configuration changes. They should cover the majority of the existing use cases to change the configuration. In case when a new configuration change is required we can implement a special Callable which can be submitted into TaskExecutor to perform the change.
TaskExecutor provides 2 methods to submit the work as Callable:
- sumitsubmit
- submitAndWait
The first method submits the task and returns the Future and second blocks until the change is applied.
On the sequence diagrams below the blocking method is used to submit the change.
Gliffy Diagram | ||||
---|---|---|---|---|
|