/** * Apply existing advices loaded into the NCubeManager, to the passed in n-cube. This allows * advices to be added first, and then let them be applied 'on demand' as an n-cube is loaded * later. * * @param appId ApplicationID * @param ncube NCube to which all matching advices will be applied. */ private static void applyAdvices(ApplicationID appId, NCube ncube) { final Map<String, Advice> appAdvices = advices.get(appId); if (MapUtilities.isEmpty(appAdvices)) { return; } for (Map.Entry<String, Advice> entry : appAdvices.entrySet()) { final Advice advice = entry.getValue(); final String wildcard = entry.getKey().replace(advice.getName() + '/', ""); final String regex = StringUtilities.wildcardToRegexString(wildcard); final Axis axis = ncube.getAxis("method"); addAdviceToMatchedCube(advice, regex, ncube, axis); } }