- public Module createModule(String instanceName, DependencyResolver dependencyResolver, BundleContext bundleContext) {
- throw new UnsupportedOperationException("Only default instance supported");
- }
-
- @Override
- public Module createModule(String instanceName, DependencyResolver dependencyResolver,
- DynamicMBeanWithInstance old, BundleContext bundleContext) throws Exception {
- RuntimeMappingModule module = (RuntimeMappingModule) super.createModule(instanceName, dependencyResolver, old, bundleContext);
+ public RuntimeMappingModule instantiateModule(String instanceName, DependencyResolver dependencyResolver, RuntimeMappingModule oldModule, AutoCloseable oldInstance, BundleContext bundleContext) {
+ checkArgument(SINGLETON_NAME.equals(instanceName),"Illegal instance name '" + instanceName + "', only allowed name is " + SINGLETON_NAME);
+ RuntimeMappingModule module = super.instantiateModule(instanceName, dependencyResolver, oldModule, oldInstance, bundleContext);
+ // FIXME bundle context should not be passed around