diff --git a/vertx/src/main/java/com/microsoft/gctoolkit/vertx/VertxChannel.java b/vertx/src/main/java/com/microsoft/gctoolkit/vertx/VertxChannel.java index 659e0969..0417189c 100644 --- a/vertx/src/main/java/com/microsoft/gctoolkit/vertx/VertxChannel.java +++ b/vertx/src/main/java/com/microsoft/gctoolkit/vertx/VertxChannel.java @@ -4,9 +4,18 @@ import com.microsoft.gctoolkit.vertx.io.JVMEventCodec; import io.vertx.core.Vertx; +import java.util.logging.Level; +import java.util.logging.Logger; + public class VertxChannel { - private Vertx vertx; + protected static final Logger LOGGER = Logger.getLogger(VertxChannel.class.getName()); + + // + // Note well! This cannot be a static final field. + // UnifiedJavaVirtualMachineConfigurationTest hangs if it is. + // + private final Vertx vertx; { //Disable unused Vert.x functionality @@ -23,4 +32,14 @@ protected Vertx vertx() { return vertx; } + public void close() { + vertx().close(result -> { + if (result.succeeded()) { + LOGGER.log(Level.FINE, "Vertx: closed"); + } else { + LOGGER.log(Level.FINE, "Vertx: close failed", result.cause()); + } + }); + } + } diff --git a/vertx/src/main/java/com/microsoft/gctoolkit/vertx/VertxDataSourceChannel.java b/vertx/src/main/java/com/microsoft/gctoolkit/vertx/VertxDataSourceChannel.java index 6605d0ec..71d63c97 100644 --- a/vertx/src/main/java/com/microsoft/gctoolkit/vertx/VertxDataSourceChannel.java +++ b/vertx/src/main/java/com/microsoft/gctoolkit/vertx/VertxDataSourceChannel.java @@ -35,5 +35,7 @@ public void publish(ChannelName channel, String message) { } @Override - public void close() {} + public void close() { + super.close(); + } } diff --git a/vertx/src/main/java/com/microsoft/gctoolkit/vertx/VertxJVMEventChannel.java b/vertx/src/main/java/com/microsoft/gctoolkit/vertx/VertxJVMEventChannel.java index bcd0df88..0ee61ee2 100644 --- a/vertx/src/main/java/com/microsoft/gctoolkit/vertx/VertxJVMEventChannel.java +++ b/vertx/src/main/java/com/microsoft/gctoolkit/vertx/VertxJVMEventChannel.java @@ -15,7 +15,6 @@ public class VertxJVMEventChannel extends VertxChannel implements JVMEventChannel { - private static final Logger LOGGER = Logger.getLogger(VertxJVMEventChannel.class.getName()); final private DeliveryOptions options = new DeliveryOptions().setCodecName(JVMEventCodec.NAME); public VertxJVMEventChannel() {} @@ -47,5 +46,7 @@ public void publish(ChannelName channel, JVMEvent message) { } @Override - public void close() {} + public void close() { + super.close(); + } }