diff options
author | Maros Marsalek <mmarsale@cisco.com> | 2016-08-19 12:20:33 +0200 |
---|---|---|
committer | Maros Marsalek <mmarsale@cisco.com> | 2016-08-19 12:50:00 +0200 |
commit | 31f01fcfadf8707aefe6bf3a09daf570ce248fc5 (patch) | |
tree | 6222e198d5f4ea5eb32ee0defdf7e5a29f0b45e0 /vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/JVppProvider.groovy | |
parent | 3341ac467cc08ac95f937945c7502ac4a019d805 (diff) |
HONEYCOMB-18 Fixing comments from reviews
Change-Id: Ic0565d601d13b5f50ec3c714a43600e32a7e456b
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
Diffstat (limited to 'vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/JVppProvider.groovy')
-rw-r--r-- | vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/JVppProvider.groovy | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/JVppProvider.groovy b/vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/JVppProvider.groovy index dfd0c44ae..51bf5be9e 100644 --- a/vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/JVppProvider.groovy +++ b/vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/JVppProvider.groovy @@ -25,6 +25,9 @@ import org.openvpp.jvpp.VppJNIConnection import org.openvpp.jvpp.future.FutureJVpp import org.openvpp.jvpp.future.FutureJVppFacade +/** + * This must be a singleton due to shutdown hook usage. + */ @Slf4j @ToString class JVppProvider extends ProviderTrait<FutureJVpp> { @@ -38,8 +41,8 @@ class JVppProvider extends ProviderTrait<FutureJVpp> { def jVpp = new JVppImpl(connection) // Closing JVpp connection with shutdown hook to erase the connection from VPP so HC will be able - // to connect next time - // TODO is there a safer way than a shutdown hook ? + // to connect next time. If JVM is force closed, this will not be executed and VPP connection + // with name from config will stay open and prevent next startup of HC to success Runtime.addShutdownHook { log.info("Disconnecting from VPP") jVpp.close() |