From 76ec4e831b2653426d8bc434dabe145d97efcc2a Mon Sep 17 00:00:00 2001 From: Marek Gradzki Date: Thu, 6 Jul 2017 12:55:17 +0200 Subject: HONEYCOMB-377: remove enabled flag for bgp Use module configuration to enable/disabe BGP. Also hides BgpExtensionModule module to the user (until HONEYCOMB-363 is fixed). Change-Id: I8294d080138a0bcf640420484b76c089aa332d93 Signed-off-by: Marek Gradzki --- .../java/io/fd/honeycomb/infra/bgp/BgpReadersModule.java | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'infra/northbound/bgp/src/main/java/io/fd/honeycomb/infra/bgp/BgpReadersModule.java') diff --git a/infra/northbound/bgp/src/main/java/io/fd/honeycomb/infra/bgp/BgpReadersModule.java b/infra/northbound/bgp/src/main/java/io/fd/honeycomb/infra/bgp/BgpReadersModule.java index 9f819614e..1dc1359c7 100644 --- a/infra/northbound/bgp/src/main/java/io/fd/honeycomb/infra/bgp/BgpReadersModule.java +++ b/infra/northbound/bgp/src/main/java/io/fd/honeycomb/infra/bgp/BgpReadersModule.java @@ -16,25 +16,17 @@ package io.fd.honeycomb.infra.bgp; +import com.google.inject.AbstractModule; import com.google.inject.Singleton; import com.google.inject.multibindings.Multibinder; -import io.fd.honeycomb.northbound.NorthboundAbstractModule; import io.fd.honeycomb.translate.read.ReaderFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class BgpReadersModule extends NorthboundAbstractModule { +public final class BgpReadersModule extends AbstractModule { private static final Logger LOG = LoggerFactory.getLogger(BgpReadersModule.class); - public BgpReadersModule() { - super(new BgpConfigurationModule(), BgpConfiguration.class); - } - protected void configure() { - if (!getConfiguration().isBgpEnabled()) { - LOG.debug("BGP disabled. Skipping initialization"); - return; - } LOG.debug("Initializing BgpReadersModule"); // This should be part of BgpModule, but that one is Private and Multibinders + private BASE_MODULES // do not work together, that's why there's a dedicated module here -- cgit 1.2.3-korg