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);
}
Aggregations