public interface ModuleFactory
Module
instances. An instance of this interface
needs to be exported into the OSGi Service Registry. Such an instance
provides metadata describing services which can be published from it.
Each Module
can optionally be instantiated with a
DynamicMBean
which represents the configuration of
the currently running instance.
Modifier and Type | Method and Description |
---|---|
Module |
createModule(String instanceName,
DependencyResolver dependencyResolver,
org.osgi.framework.BundleContext bundleContext)
Create a new Module instance.
|
Module |
createModule(String instanceName,
DependencyResolver dependencyResolver,
DynamicMBeanWithInstance old,
org.osgi.framework.BundleContext bundleContext)
Create a new Module instance.
|
Set<? extends Module> |
getDefaultModules(DependencyResolverFactory dependencyResolverFactory,
org.osgi.framework.BundleContext bundleContext)
Called when ModuleFactory is registered to config manager.
|
String |
getImplementationName()
Returns the human-friendly implementation name.
|
Set<Class<? extends AbstractServiceInterface>> |
getImplementedServiceIntefaces() |
boolean |
isModuleImplementingServiceInterface(Class<? extends AbstractServiceInterface> serviceInterface) |
String getImplementationName()
Module createModule(String instanceName, DependencyResolver dependencyResolver, org.osgi.framework.BundleContext bundleContext)
dependencyResolver
- This resolver will return actual config mbean based on its
ObjectName.bundleContext
- Reference to OSGi bundleContext that can be used to acquire OSGi
services, startup configuration and other OSGi related
information.Module createModule(String instanceName, DependencyResolver dependencyResolver, DynamicMBeanWithInstance old, org.osgi.framework.BundleContext bundleContext) throws Exception
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 itself.
dependencyResolver
- This resolver will return actual config mbean based on its
ObjectName.old
- existing module from platform MBeanServer that is being
reconfigured. Implementations should inspect its attributes using
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
DynamicMBeanWithInstance.getInstance()
. It is possible that casting this old instance throws
ClassCastException
when OSGi bundle is being updated. In
this case, implementation should revert to creating new instance.bundleContext
- Reference to OSGi bundleContext that can be used to acquire OSGi
services, startup configuration and other OSGi related
information.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.boolean isModuleImplementingServiceInterface(Class<? extends AbstractServiceInterface> serviceInterface)
Set<Class<? extends AbstractServiceInterface>> getImplementedServiceIntefaces()
Set<? extends Module> getDefaultModules(DependencyResolverFactory dependencyResolverFactory, org.osgi.framework.BundleContext bundleContext)
dependencyResolverFactory
- factory for getting dependency resolvers for each module.bundleContext
- Reference to OSGi bundleContext that can be used to acquire OSGi
services, startup configuration and other OSGi related
information.Copyright © 2019 OpenDaylight. All rights reserved.