Changing the configuration from multiple threads.
Using UI it is possible to change the broker configuration from multiple browsers at the same time.
The one way of making it thread safe is to introduce a single thread where all the changes can be applied.
The diagram below demonstrates how the thread safe configuration modification can be implemented.
The special class ModelUpdater 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 the change (set attribute, create child, change state).
3 standard Callable implementations are displayed on diagram to perform the configuration changes. The 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 ModelUpdater to perform the change.
ModelUpdater provides 2 methods to submit the work as Callable:
- sumit
- submitAndWait
The first submit 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.
![Configuration Change Event Model 2](/confluence/download/attachments/30752777/Configuration%20Change%20Event%20Model%202.png?version=2&modificationDate=1360328235000&api=v2)