X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fconfig%2Fconfig-manager%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fconfig%2Fmanager%2Fimpl%2FModuleInternalInfo.java;h=267e504f859fe3bd024bf5eb2d098fdb4904e935;hb=384479f0181763f3202f2f7ad681e90182bcc820;hp=fefc88651c4a6d54854b610361dda71208f68180;hpb=9fb64948564e252018f9b1e13e7cea2c92f991aa;p=controller.git diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ModuleInternalInfo.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ModuleInternalInfo.java index fefc88651c..267e504f85 100644 --- a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ModuleInternalInfo.java +++ b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ModuleInternalInfo.java @@ -8,19 +8,21 @@ package org.opendaylight.controller.config.manager.impl; import javax.annotation.Nullable; - import org.opendaylight.controller.config.api.ModuleIdentifier; +import org.opendaylight.controller.config.manager.impl.dependencyresolver.DestroyedModule; import org.opendaylight.controller.config.manager.impl.dynamicmbean.DynamicReadableWrapper; import org.opendaylight.controller.config.manager.impl.jmx.ModuleJMXRegistrator; import org.opendaylight.controller.config.manager.impl.jmx.RootRuntimeBeanRegistratorImpl; import org.opendaylight.controller.config.manager.impl.osgi.BeanToOsgiServiceManager.OsgiRegistration; -import org.opendaylight.protocol.concepts.NamedObject; +import org.opendaylight.controller.config.spi.ModuleFactory; +import org.opendaylight.yangtools.concepts.Identifiable; +import org.osgi.framework.BundleContext; /** * Provides metadata about Module from controller to registry. */ -public class ModuleInternalInfo implements NamedObject, - Comparable { +public class ModuleInternalInfo implements Comparable, + Identifiable{ private final ModuleIdentifier name; // this registrator is passed to runtime bean registrator and config @@ -35,27 +37,30 @@ public class ModuleInternalInfo implements NamedObject, private final OsgiRegistration osgiRegistration; private final ModuleJMXRegistrator moduleJMXRegistrator; private final int orderingIdx; + private final boolean isDefaultBean; + private final ModuleFactory moduleFactory; + private final BundleContext bundleContext; public ModuleInternalInfo(ModuleIdentifier name, @Nullable DynamicReadableWrapper readableModule, OsgiRegistration osgiRegistration, - RootRuntimeBeanRegistratorImpl runtimeBeanRegistrator, - ModuleJMXRegistrator moduleJMXRegistrator, int orderingIdx) { + @Nullable RootRuntimeBeanRegistratorImpl runtimeBeanRegistrator, + ModuleJMXRegistrator moduleJMXRegistrator, int orderingIdx, + boolean isDefaultBean, ModuleFactory moduleFactory, BundleContext bundleContext) { if (osgiRegistration == null) { throw new IllegalArgumentException( "Parameter 'osgiRegistration' is missing"); } - if (runtimeBeanRegistrator == null) { - throw new IllegalArgumentException( - "Parameter 'runtimeBeanRegistrator' is missing"); - } this.readableModule = readableModule; this.osgiRegistration = osgiRegistration; this.runtimeBeanRegistrator = runtimeBeanRegistrator; this.name = name; this.moduleJMXRegistrator = moduleJMXRegistrator; this.orderingIdx = orderingIdx; + this.isDefaultBean = isDefaultBean; + this.moduleFactory = moduleFactory; + this.bundleContext = bundleContext; } public DynamicReadableWrapper getReadableModule() { @@ -87,11 +92,6 @@ public class ModuleInternalInfo implements NamedObject, return osgiRegistration; } - @Override - public ModuleIdentifier getName() { - return name; - } - /** * Get index representing dependency ordering within a transaction. */ @@ -108,8 +108,25 @@ public class ModuleInternalInfo implements NamedObject, } public DestroyedModule toDestroyedModule() { - return new DestroyedModule(getName(), + return new DestroyedModule(getIdentifier(), getReadableModule().getInstance(), getModuleJMXRegistrator(), - getOsgiRegistration(), getOrderingIdx()); + getOsgiRegistration(), getOrderingIdx(), runtimeBeanRegistrator); + } + + @Override + public ModuleIdentifier getIdentifier() { + return name; + } + + public boolean isDefaultBean() { + return isDefaultBean; + } + + public ModuleFactory getModuleFactory() { + return moduleFactory; + } + + public BundleContext getBundleContext() { + return bundleContext; } }