@Override public synchronized void remove(Module module) { // It is overridden to make it synchronized as it is called from // BundleListener. super.remove(module); // Update cache. final URI location = module.getModuleDefinition().getLocations()[0]; cachedData.remove(location); cacheInvalidated = true; }
/** * Modules can notify their registry that they have changed (classes, * resources,etc...). Registries are requested to take appropriate action * to make the new module available. */ public void changed(Module service) { // house keeping... remove(service); ModuleDefinition info = service.getModuleDefinition(); Module newService = newModule(info); // store it add(newService); }
/** * Modules can notify their registry that they have changed (classes, * resources,etc...). Registries are requested to take appropriate action * to make the new module available. */ public void changed(Module service) { // house keeping... remove(service); ModuleDefinition info = service.getModuleDefinition(); Module newService = newModule(info); // store it add(newService); }
public void remove(Module module) { super.remove(module); if (!(module instanceof OSGiModuleImpl)) { return; } OSGiModuleImpl oModule = (OSGiModuleImpl) module; Bundle bundle = oModule.getBundle(); String bsn = bundle.getSymbolicName(); String version = bundle.getVersion().toString(); Set<ServiceLocator> locators = getAllServiceLocators(); for (ServiceLocator locator : locators) { if (!ServiceLocatorState.RUNNING.equals(locator.getState())) continue; ServiceLocatorUtilities.removeFilter(locator, new RemoveFilter(bsn, version)); } }