X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fconfig%2Fconfig-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fconfig%2Fspi%2FModuleFactory.java;fp=opendaylight%2Fconfig%2Fconfig-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fconfig%2Fspi%2FModuleFactory.java;h=37dcd65d0afd47d72e678602b53fa509e28cad3f;hp=1a8c140c63870544bb8f8df5b5c4b10968e6c5db;hb=c65916d075142dd937cb67e5128a87c05616b834;hpb=a7fa4e6badc5d5d3f402bedb72edebbf5c12bd2b diff --git a/opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/spi/ModuleFactory.java b/opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/spi/ModuleFactory.java index 1a8c140c63..37dcd65d0a 100644 --- a/opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/spi/ModuleFactory.java +++ b/opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/spi/ModuleFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. + * Copyright (c) 2013, 2017 Cisco Systems, Inc. and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, @@ -19,15 +19,16 @@ import org.osgi.framework.BundleContext; * needs to be exported into the OSGi Service Registry. Such an instance * provides metadata describing services which can be published from it. * + *

* Each {@link Module} can optionally be instantiated with a - * {@link javax.management.DynamicMBean} which represents the configuration of the currently - * running instance. + * {@link javax.management.DynamicMBean} which represents the configuration of + * the currently running instance. */ public interface ModuleFactory { /** - * Returns the human-friendly implementation name. This value needs to be - * unique within all implementations of all interfaces returned by + * Returns the human-friendly implementation name. This value needs to be unique + * within all implementations of all interfaces returned by * getImplementedInterfaces(). * * @return human-friendly implementation name @@ -42,24 +43,25 @@ public interface ModuleFactory { * @param dependencyResolver * This resolver will return actual config mbean based on its * ObjectName. - * @param bundleContext Reference to OSGi bundleContext that can be used to - * acquire OSGi services, startup configuration and other - * OSGi related information. + * @param bundleContext + * Reference to OSGi bundleContext that can be used to acquire OSGi + * services, startup configuration and other OSGi related + * information. * * @return newly created module * */ - Module createModule(String instanceName, - DependencyResolver dependencyResolver, BundleContext bundleContext); + Module createModule(String instanceName, DependencyResolver dependencyResolver, BundleContext bundleContext); /** * Create a new Module instance. The returned object is expected to use the * dependencyResolver provided when resolving ObjectNames to actual Module - * instances. A reference to an abstract view of the previous configuration - * is also provided in the form of a {@link javax.management.DynamicMBean}. Implementations - * should use the MBeanInfo interface to understand the structure of the - * configuration information. + * instances. A reference to an abstract view of the previous configuration is + * also provided in the form of a {@link javax.management.DynamicMBean}. + * Implementations should use the MBeanInfo interface to understand the + * structure of the configuration information. * + *

* Structural information impacts hot-swap operations in that in order to * perform such a swap the newly loaded code needs to understand the * previously-running instance configuration layout and how to map it onto @@ -70,49 +72,49 @@ public interface ModuleFactory { * ObjectName. * @param old * existing module from platform MBeanServer that is being - * reconfigured. Implementations should inspect its attributes - * using {@link javax.management.DynamicMBean#getAttribute(String)} and set those - * attributes on newly created module. If reconfiguration of live - * instances is supported, this live instance can be retreived + * reconfigured. Implementations should inspect its attributes using + * {@link javax.management.DynamicMBean#getAttribute(String)} and set + * those attributes on newly created module. If reconfiguration of + * live instances is supported, this live instance can be retreived * using * {@link org.opendaylight.controller.config.api.DynamicMBeanWithInstance#getInstance()} * . It is possible that casting this old instance throws - * {@link ClassCastException} when OSGi bundle is being updated. - * In this case, implementation should revert to creating new - * instance. - * @param bundleContext Reference to OSGi bundleContext that can be used to - * acquire OSGi services, startup configuration and other - * OSGi related information. + * {@link ClassCastException} when OSGi bundle is being updated. In + * this case, implementation should revert to creating new instance. + * @param bundleContext + * Reference to OSGi bundleContext that can be used to acquire OSGi + * services, startup configuration and other OSGi related + * information. * * @return newly created module * @throws Exception * if it is not possible to recover configuration from old. This - * leaves server in a running state but no configuration - * transaction can be created. + * leaves server in a running state but no configuration transaction + * can be created. */ - Module createModule(String instanceName, DependencyResolver dependencyResolver, - DynamicMBeanWithInstance old, BundleContext bundleContext) throws Exception; + Module createModule(String instanceName, DependencyResolver dependencyResolver, DynamicMBeanWithInstance old, + BundleContext bundleContext) throws Exception; - boolean isModuleImplementingServiceInterface( - Class serviceInterface); + boolean isModuleImplementingServiceInterface(Class serviceInterface); Set> getImplementedServiceIntefaces(); /** - * Called when ModuleFactory is registered to config manager. - * Useful for populating the registry with pre-existing state. Since - * the method is called for each ModuleFactory separately and transaction - * is committed automatically, returned modules MUST be valid and commitable - * without any manual intervention. + * Called when ModuleFactory is registered to config manager. Useful for + * populating the registry with pre-existing state. Since the method is called + * for each ModuleFactory separately and transaction is committed automatically, + * returned modules MUST be valid and commitable without any manual + * intervention. * - * @param dependencyResolverFactory factory for getting dependency resolvers for each module. - * @param bundleContext Reference to OSGi bundleContext that can be used to - * acquire OSGi services, startup configuration and other - * OSGi related information. + * @param dependencyResolverFactory + * factory for getting dependency resolvers for each module. + * @param bundleContext + * Reference to OSGi bundleContext that can be used to acquire OSGi + * services, startup configuration and other OSGi related + * information. * * @return set of default modules. Null is not allowed. */ Set getDefaultModules(DependencyResolverFactory dependencyResolverFactory, BundleContext bundleContext); - }