Skip to content

Commit ff5215f

Browse files
author
Robin Duda
committed
rename internal classes for shorter logging class-contexts.
1 parent 999a5d5 commit ff5215f

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

core/main/java/com/codingchili/core/context/ShutdownHookHandler.java renamed to core/main/java/com/codingchili/core/context/ShutdownHook.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
/**
1717
* Registered as a shutdown hook for the JVM and is used to clean up the context.
1818
*/
19-
public class ShutdownHookHandler extends Thread {
20-
private static final Map<Vertx, ShutdownHookHandler> contexts = new HashMap<>();
19+
public class ShutdownHook extends Thread {
20+
private static final Map<Vertx, ShutdownHook> contexts = new HashMap<>();
2121
private SystemContext context;
2222
private Logger logger;
2323

@@ -32,7 +32,7 @@ static synchronized void register(SystemContext context) {
3232
if (contexts.containsKey(context.vertx)) {
3333
// context already registered - no action.
3434
} else {
35-
ShutdownHookHandler hook = new ShutdownHookHandler(context);
35+
ShutdownHook hook = new ShutdownHook(context);
3636
contexts.put(context.vertx, hook);
3737
Runtime.getRuntime().addShutdownHook(hook);
3838
}
@@ -45,7 +45,7 @@ static synchronized void register(SystemContext context) {
4545
* @param context the context to unregister shutdown hooks for.
4646
*/
4747
static synchronized void unregister(SystemContext context) {
48-
ShutdownHookHandler handler = contexts.remove(context.vertx);
48+
ShutdownHook handler = contexts.remove(context.vertx);
4949

5050
if (handler != null) {
5151
Runtime.getRuntime().removeShutdownHook(handler);
@@ -65,7 +65,7 @@ private static synchronized void removeAll() {
6565
/**
6666
* @param context the context that is to be shut down on JVM exit.
6767
*/
68-
public ShutdownHookHandler(SystemContext context) {
68+
public ShutdownHook(SystemContext context) {
6969
this.context = context;
7070
this.logger = new RemoteLogger(context, getClass());
7171
}

core/main/java/com/codingchili/core/context/SystemContext.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ private SystemContext(Vertx vertx) {
6161
this.logger = new RemoteLogger(this, SystemContext.class);
6262

6363
// add a shutdown hook for gracefully shutting down the context.
64-
ShutdownHookHandler.register(this);
64+
ShutdownHook.register(this);
6565

6666
initialize();
6767
}

core/test/java/com/codingchili/core/context/ShutdownHookHandlerTest.java renamed to core/test/java/com/codingchili/core/context/ShutdownHookTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* Tests for the shutdown hook handler.
1717
*/
1818
@RunWith(VertxUnitRunner.class)
19-
public class ShutdownHookHandlerTest {
19+
public class ShutdownHookTest {
2020
private SystemContext context;
2121

2222
@Before
@@ -125,7 +125,7 @@ public void stop(Future<Void> stop) {
125125
* Simulate the JVM shutdown hook.
126126
*/
127127
private void shutdown() {
128-
new ShutdownHookHandler(context).start();
128+
new ShutdownHook(context).start();
129129
}
130130

131131
private void untilVertxClosed(Async async) {

0 commit comments

Comments
 (0)