blob: 3c44ba2eaa606bc8d059a73514769eefabe070c0 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.container.protect;
import com.yahoo.protect.Process;
/**
* An injectable terminator of the Java VM.
* Components that encounter conditions where the VM should be terminated should
* request an instance of this injected. That makes termination testable
* as tests can create subclasses of this which register the termination request
* rather than terminating.
*
* @author bratseth
*/
public class ProcessTerminator {
/** Logs and dies without taking a thread dump */
public void logAndDie(String message) {
logAndDie(message, false);
}
/**
* Logs and dies
*
* @param dumpThreads if true the stack trace of all threads is dumped to the
* log with level info before shutting down
*/
public void logAndDie(String message, boolean dumpThreads) {
Process.logAndDie(message, dumpThreads);
}
}
|