Search in sources :

Example 1 with DynamicMBeanWithInstance

use of org.opendaylight.controller.config.api.DynamicMBeanWithInstance in project controller by opendaylight.

the class ClassBasedModuleFactory method constructModule.

private Module constructModule(final String instanceName, final DependencyResolver dependencyResolver, final DynamicMBeanWithInstance old) throws InstantiationException, IllegalAccessException, InvocationTargetException {
    Preconditions.checkNotNull(dependencyResolver);
    ModuleIdentifier moduleIdentifier = new ModuleIdentifier(implementationName, instanceName);
    Constructor<? extends Module> declaredConstructor;
    try {
        declaredConstructor = configBeanClass.getDeclaredConstructor(DynamicMBeanWithInstance.class, ModuleIdentifier.class);
    } catch (final NoSuchMethodException e) {
        throw new IllegalStateException("Did not find constructor with parameters (DynamicMBeanWithInstance) in " + configBeanClass, e);
    }
    Preconditions.checkState(declaredConstructor != null);
    return declaredConstructor.newInstance(old, moduleIdentifier);
}
Also used : ModuleIdentifier(org.opendaylight.controller.config.api.ModuleIdentifier) DynamicMBeanWithInstance(org.opendaylight.controller.config.api.DynamicMBeanWithInstance)

Aggregations

DynamicMBeanWithInstance (org.opendaylight.controller.config.api.DynamicMBeanWithInstance)1 ModuleIdentifier (org.opendaylight.controller.config.api.ModuleIdentifier)1