Reimplement restarting of scm-manager

SCM-Manager tries now to figure out which is the best strategy for the restart.
It chooses from one of the following strategies:

* PosixRestartStrategy which uses native LibC
* ExitRestartStrategy uses System.exit and relies on external mechanism to start again
* InjectionContextRestartStrategy destroys and re initializes the injection context
This commit is contained in:
Sebastian Sdorra
2020-02-12 12:13:10 +01:00
parent e30796b995
commit 56b8dbdb22
11 changed files with 412 additions and 8 deletions

View File

@@ -10,9 +10,11 @@ import sonia.scm.event.ShutdownEventBusEvent;
import java.util.concurrent.atomic.AtomicLong;
/**
* Restart strategy implementation which destroy the injection context and re initialize it.
* Restart strategy which tries to free, every resource used by the context, starts gc and re initializes the context.
*/
public class InjectionContextRestartStrategy implements RestartStrategy {
class InjectionContextRestartStrategy implements RestartStrategy {
static final String NAME = "context";
private static final String DISABLE_RESTART_PROPERTY = "sonia.scm.restart.disable";
private static final String WAIT_PROPERTY = "sonia.scm.restart.wait";