Commit f66a966
Router factor out hotdeploy (#2466)
* refactor: delegate hot deployment logic to new `HotDeployer` interface and streamline related code in `Router`
* refactor: make `router` field in `DefaultHotDeployer` final for immutability
* fix: ensure proper cleanup and initialization of `hotDeployer` in `Router`
* refactor: enhance `Router` structure with streamlined initialization and reconfiguration logic
* refactor: improve thread synchronization in `DefaultHotDeployer` and add `getLock()` in `Router` for enhanced concurrency handling
* refactor: simplify `DefaultHotDeployer` by removing redundant `hotDeployingContexts` tracking and improve `Router` concurrency management
* refactor: replace `System.exit` calls with `StartupException` in `Router` and `RouterCLI` for cleaner error handling during startup
* refactor: remove redundant `errorNotice` logic and replace `System.exit` with `StartupException` in `RouterCLI` for cleaner error handling
* refactor: extract `tryToGetConfigurationFile` method in `RouterCLI` for cleaner and reusable configuration resolution logic
* refactor: improve error logging in `RouterCLI` and fix indentation for readability
* refactor: replace `StartupException` with `ExitException` for streamlined error handling and debugging in `Router` and `RouterCLI`
* refactor: relocate `ExitException` and rename method in `RouterCLI` for clarity and cohesion
* refactor: improve synchronization and streamline `DefaultHotDeployer` by replacing direct bean factory access with `Router.getRef`
* refactor: add synchronization to `DefaultHotDeployer.start` to prevent concurrent hot deployment initialization
* protect 'running' field by 'lock'
* added error, if Spring Context declares more than 1 router
* added comment
* refactor
* refactor: synchronize `DefaultHotDeployer.stop` and initialize `Router.hotDeployer` with `NullHotDeployer` to enhance thread safety and prevent NPEs
* refactor: simplify `Router.hotDeployer` initialization logic and clarify Javadoc for `setHotDeploy`
* refactor: streamline `Router.hotDeployer` initialization and enhance `HotDeployer` interface with `init` method
---------
Co-authored-by: Tobias Polley <mail@tobias-polley.de>1 parent fd4a13a commit f66a966
7 files changed
Lines changed: 346 additions & 265 deletions
File tree
- core/src/main/java/com/predic8/membrane/core
- cli
- router/hotdeploy
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
0 commit comments