/** * Uses the parsed {@link EnhancementEngineManager} to build a Map * representing the current snapshot of the active enhancement engines. * * @param engineManager The engine manager used to build the snapshot * @return the map with the names as key and an Entry with the {@link ServiceReference} * and the {@link EnhancementEngine} instance as value. */ public static Map<String, Entry<ServiceReference,EnhancementEngine>> buildEnginesMap(EnhancementEngineManager engineManager) { Map<String, Entry<ServiceReference,EnhancementEngine>> engines = new HashMap<String,Map.Entry<ServiceReference,EnhancementEngine>>(); for(String engineName : engineManager.getActiveEngineNames()){ ServiceReference engineRef = engineManager.getReference(engineName); if(engineRef != null){ EnhancementEngine engine = engineManager.getEngine(engineRef); if(engine != null){ Map<ServiceReference,EnhancementEngine> m = Collections.singletonMap(engineRef, engine); engines.put(engineName, m.entrySet().iterator().next()); } } } return engines; } /**
/** * Uses the parsed {@link EnhancementEngineManager} to build a Map * representing the current snapshot of the active enhancement engines. * * @param engineManager The engine manager used to build the snapshot * @return the map with the names as key and an Entry with the {@link ServiceReference} * and the {@link EnhancementEngine} instance as value. */ public static Map<String, Entry<ServiceReference,EnhancementEngine>> buildEnginesMap(EnhancementEngineManager engineManager) { Map<String, Entry<ServiceReference,EnhancementEngine>> engines = new HashMap<String,Map.Entry<ServiceReference,EnhancementEngine>>(); for(String engineName : engineManager.getActiveEngineNames()){ ServiceReference engineRef = engineManager.getReference(engineName); if(engineRef != null){ EnhancementEngine engine = engineManager.getEngine(engineRef); if(engine != null){ Map<ServiceReference,EnhancementEngine> m = Collections.singletonMap(engineRef, engine); engines.put(engineName, m.entrySet().iterator().next()); } } } return engines; } /**