summaryrefslogtreecommitdiffstats
path: root/vpp-common/minimal-distribution
diff options
context:
space:
mode:
Diffstat (limited to 'vpp-common/minimal-distribution')
-rw-r--r--vpp-common/minimal-distribution/pom.xml8
-rw-r--r--vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/ContextsReaderFactoryProvider.groovy3
-rw-r--r--vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/JVppProvider.groovy7
-rw-r--r--vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/VppCommonModule.groovy2
4 files changed, 10 insertions, 10 deletions
diff --git a/vpp-common/minimal-distribution/pom.xml b/vpp-common/minimal-distribution/pom.xml
index 4500a633d..4efe12b54 100644
--- a/vpp-common/minimal-distribution/pom.xml
+++ b/vpp-common/minimal-distribution/pom.xml
@@ -29,6 +29,7 @@
<properties>
<main.class>io.fd.honeycomb.vpp.distro.Main</main.class>
+ <honeycomb.min.distro.version>1.0.0-SNAPSHOT</honeycomb.min.distro.version>
</properties>
<build>
@@ -75,7 +76,7 @@
<dependency>
<groupId>io.fd.honeycomb</groupId>
<artifactId>minimal-distribution</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>${honeycomb.min.distro.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
@@ -88,11 +89,6 @@
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>vpp-jvpp-cfg</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
<groupId>io.fd.vpp</groupId>
<artifactId>jvpp</artifactId>
<version>16.09-SNAPSHOT</version>
diff --git a/vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/ContextsReaderFactoryProvider.groovy b/vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/ContextsReaderFactoryProvider.groovy
index 5016d4e19..e056f38f8 100644
--- a/vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/ContextsReaderFactoryProvider.groovy
+++ b/vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/ContextsReaderFactoryProvider.groovy
@@ -21,6 +21,7 @@ import com.google.inject.name.Named
import groovy.transform.ToString
import groovy.util.logging.Slf4j
import io.fd.honeycomb.infra.distro.ProviderTrait
+import io.fd.honeycomb.infra.distro.data.context.ContextPipelineModule
import io.fd.honeycomb.translate.read.ReaderFactory
import org.opendaylight.controller.md.sal.binding.api.DataBroker
import io.fd.honeycomb.vpp.context.ContextsReaderFactory
@@ -33,7 +34,7 @@ import io.fd.honeycomb.vpp.context.ContextsReaderFactory
class ContextsReaderFactoryProvider extends ProviderTrait<ReaderFactory> {
@Inject
- @Named("honeycomb-context")
+ @Named(ContextPipelineModule.HONEYCOMB_CONTEXT)
DataBroker contextDataBroker
def create() { new ContextsReaderFactory(contextDataBroker) }
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()
diff --git a/vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/VppCommonModule.groovy b/vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/VppCommonModule.groovy
index 4c2573ca1..68261c34d 100644
--- a/vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/VppCommonModule.groovy
+++ b/vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/VppCommonModule.groovy
@@ -34,7 +34,7 @@ public final class VppCommonModule extends AbstractModule {
bind(FutureJVpp).toProvider(JVppProvider).in(Singleton)
- // Naming contexts reader exposing context storage over REST/NETCONF
+ // Naming contexts reader exposing context storage over REST/HONEYCOMB_NETCONF
Multibinder.newSetBinder(binder(), ReaderFactory.class).with {
addBinding().toProvider(ContextsReaderFactoryProvider).in(Singleton)
}