/** * Uses the parsed {@link ChainManager} to build a Map * representing the current snapshot of the active enhancement chains. * * @param chainManager The chain manager used to build the snapshot * @return the map with the names as key and an Entry with the {@link ServiceReference} * and the {@link Chain} instance as value. */ public static Map<String,Map.Entry<ServiceReference,Chain>> buildChainsMap(ChainManager chainManager) { Map<String,Map.Entry<ServiceReference,Chain>> chains = new HashMap<String,Map.Entry<ServiceReference,Chain>>(); for(String chainName : chainManager.getActiveChainNames()){ ServiceReference chainRef = chainManager.getReference(chainName); if(chainRef != null){ Chain chain = chainManager.getChain(chainRef); if(chain != null){ Map<ServiceReference,Chain> m = Collections.singletonMap(chainRef, chain); chains.put(chainName, m.entrySet().iterator().next()); } } } return chains; } /**
/** * Uses the parsed {@link ChainManager} to build a Map * representing the current snapshot of the active enhancement chains. * * @param chainManager The chain manager used to build the snapshot * @return the map with the names as key and an Entry with the {@link ServiceReference} * and the {@link Chain} instance as value. */ public static Map<String,Map.Entry<ServiceReference,Chain>> buildChainsMap(ChainManager chainManager) { Map<String,Map.Entry<ServiceReference,Chain>> chains = new HashMap<String,Map.Entry<ServiceReference,Chain>>(); for(String chainName : chainManager.getActiveChainNames()){ ServiceReference chainRef = chainManager.getReference(chainName); if(chainRef != null){ Chain chain = chainManager.getChain(chainRef); if(chain != null){ Map<ServiceReference,Chain> m = Collections.singletonMap(chainRef, chain); chains.put(chainName, m.entrySet().iterator().next()); } } } return chains; } /**