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 | 3f93e39fbb780f19ce34ea407e0534eea7c1af30 (patch) | |
tree | a3fdebc4cb9f144cd142ccf1f2847a1069323afc /vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/JVppProvider.groovy | |
parent | 85547046fd9da77e4716f8cff49252ced16eafc3 (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() |