summaryrefslogtreecommitdiffstats
path: root/infra/bgp-distribution/src/main/java
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2017-05-31 10:39:24 +0200
committerMarek Gradzki <mgradzki@cisco.com>2017-05-31 10:39:55 +0200
commitcecb372cc2b664cc7f7b56aeb4cf6f90f7ea9b5c (patch)
tree025466fb178f11a0e2e86ada3b444e77c2a3b603 /infra/bgp-distribution/src/main/java
parent685bffccd16d58fc5c1dd5c118ee74aa39effa68 (diff)
Provide RIB/BGPExtensionConsumerContext as singletons
Whitout specifying it explicitly Guice might create more instances Change-Id: Ia3cf56e54d59fa49488ab93a26a9db44cec51e8d Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'infra/bgp-distribution/src/main/java')
-rw-r--r--infra/bgp-distribution/src/main/java/io/fd/honeycomb/infra/bgp/BgpExtensionsModule.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/infra/bgp-distribution/src/main/java/io/fd/honeycomb/infra/bgp/BgpExtensionsModule.java b/infra/bgp-distribution/src/main/java/io/fd/honeycomb/infra/bgp/BgpExtensionsModule.java
index 461fb8918..650f637e5 100644
--- a/infra/bgp-distribution/src/main/java/io/fd/honeycomb/infra/bgp/BgpExtensionsModule.java
+++ b/infra/bgp-distribution/src/main/java/io/fd/honeycomb/infra/bgp/BgpExtensionsModule.java
@@ -17,6 +17,7 @@
package io.fd.honeycomb.infra.bgp;
import com.google.inject.AbstractModule;
+import com.google.inject.Singleton;
import com.google.inject.multibindings.Multibinder;
import org.opendaylight.protocol.bgp.parser.spi.BGPExtensionConsumerContext;
import org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderActivator;
@@ -46,7 +47,8 @@ public final class BgpExtensionsModule extends AbstractModule {
ribExtensionBinder.addBinding().to(org.opendaylight.protocol.bgp.linkstate.impl.RIBActivator.class);
ribExtensionBinder.addBinding().to(org.opendaylight.protocol.bgp.l3vpn.ipv4.RibIpv4Activator.class);
ribExtensionBinder.addBinding().to(org.opendaylight.protocol.bgp.l3vpn.ipv6.RibIpv6Activator.class);
- bind(RIBExtensionConsumerContext.class).toProvider(RIBExtensionConsumerContextProvider.class);
+ bind(RIBExtensionConsumerContext.class).toProvider(RIBExtensionConsumerContextProvider.class)
+ .in(Singleton.class);
}
private void configureBGPExtensions() {
@@ -59,6 +61,7 @@ public final class BgpExtensionsModule extends AbstractModule {
bgpExtensionBinder.addBinding().to(org.opendaylight.protocol.bgp.linkstate.impl.BGPActivator.class);
bgpExtensionBinder.addBinding().to(org.opendaylight.protocol.bgp.l3vpn.ipv4.BgpIpv4Activator.class);
bgpExtensionBinder.addBinding().to(org.opendaylight.protocol.bgp.l3vpn.ipv6.BgpIpv6Activator.class);
- bind(BGPExtensionConsumerContext.class).toProvider(BGPExtensionConsumerContextProvider.class);
+ bind(BGPExtensionConsumerContext.class).toProvider(BGPExtensionConsumerContextProvider.class)
+ .in(Singleton.class);
}
}