@@ -31,6 +31,9 @@ public static void init(ConfigurationService configuration) {
31
31
instance = new ExecutorServiceManager (
32
32
new InstrumentedExecutorService (configuration .getExecutorService ()),
33
33
configuration .getTerminationTimeoutSeconds ());
34
+ log .debug ("Initialized ExecutorServiceManager executor: {}, timeout: {}" ,
35
+ configuration .getExecutorService ().getClass (),
36
+ configuration .getTerminationTimeoutSeconds ());
34
37
} else {
35
38
log .debug ("Already started, reusing already setup instance!" );
36
39
}
@@ -47,6 +50,7 @@ public static void stop() {
47
50
48
51
public static void useTestInstance () {
49
52
if (instance == null ) {
53
+ log .debug ("Using test instance" );
50
54
instance = new ExecutorServiceManager (
51
55
new InstrumentedExecutorService (Executors .newFixedThreadPool (5 )), 1 );
52
56
}
@@ -55,7 +59,7 @@ public static void useTestInstance() {
55
59
public static ExecutorServiceManager instance () {
56
60
if (instance == null ) {
57
61
throw new IllegalStateException (
58
- "ExecutorServiceManager hasn't been started. Call start method before using!" );
62
+ "ExecutorServiceManager hasn't been started. Call init method before using!" );
59
63
}
60
64
return instance ;
61
65
}
@@ -81,6 +85,9 @@ private static class InstrumentedExecutorService implements ExecutorService {
81
85
private final ExecutorService executor ;
82
86
83
87
private InstrumentedExecutorService (ExecutorService executor ) {
88
+ if (executor == null ) {
89
+ throw new NullPointerException ();
90
+ }
84
91
this .executor = executor ;
85
92
debug = Utils .debugThreadPool ();
86
93
}
0 commit comments