X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fnorthbound%2Fbundlescanner%2Fimplementation%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnorthbound%2Fbundlescanner%2Finternal%2FBundleInfo.java;h=9cb1cb52ed36e0e8d2de80b84cc59620eb9f5430;hp=a10893110cac02ca76d2e43b5c09472ee1fda7e5;hb=9845fed57093178ff55d3c8c13b7f218feabd458;hpb=bd396fa9b759466b8e9cd9b0ac64ee99406f72e7 diff --git a/opendaylight/northbound/bundlescanner/implementation/src/main/java/org/opendaylight/controller/northbound/bundlescanner/internal/BundleInfo.java b/opendaylight/northbound/bundlescanner/implementation/src/main/java/org/opendaylight/controller/northbound/bundlescanner/internal/BundleInfo.java index a10893110c..9cb1cb52ed 100644 --- a/opendaylight/northbound/bundlescanner/implementation/src/main/java/org/opendaylight/controller/northbound/bundlescanner/internal/BundleInfo.java +++ b/opendaylight/northbound/bundlescanner/implementation/src/main/java/org/opendaylight/controller/northbound/bundlescanner/internal/BundleInfo.java @@ -62,14 +62,14 @@ import org.slf4j.LoggerFactory; return bundle.getBundleId(); } - public List> getAnnotatedClasses(Pattern pattern) { + public List> getAnnotatedClasses(Pattern pattern, Set excludes) { List result = new ArrayList(); for (Map.Entry> entry : annotatedClasses.entrySet()) { if (matches(pattern, entry.getValue())) { result.add(entry.getKey()); } } - return BundleScanner.loadClasses(bundle, result); + return BundleScanner.loadClasses(result, bundle, excludes); } private boolean matches(Pattern pattern, Set values) { @@ -81,13 +81,24 @@ import org.slf4j.LoggerFactory; return false; } + /** + * Get classes with annotations matching a pattern + * + * @param allbundles - all bundles + * @param pattern - annotation pattern to match + * @param initBundle - the bundle which initiated this call + * @param excludes - set of class names to be excluded + * + * @return list of annotated classes matching the pattern + */ public List> getAnnotatedClasses( Collection allbundles, - Pattern pattern) + Pattern pattern, Bundle initBundle, + Set excludes) { - List> classes = getAnnotatedClasses(pattern); + List> classes = getAnnotatedClasses(pattern, excludes); processAnnotatedClassesInternal(this, allbundles, pattern, - new HashSet(), classes); + new HashSet(), classes, initBundle, excludes); return classes; } @@ -115,17 +126,19 @@ import org.slf4j.LoggerFactory; Collection bundlesToScan, Pattern pattern, Collection visited, - List> classes) + List> classes, + Bundle initBundle, Set excludes) { for (BundleInfo other : bundlesToScan) { if (other.getId() == target.getId()) continue; if (target.isDependantOn(other)) { if (!visited.contains(other)) { - classes.addAll(BundleScanner.loadClasses(other.getBundle(), - other.getExportedAnnotatedClasses(pattern))); + classes.addAll(BundleScanner.loadClasses( + other.getExportedAnnotatedClasses(pattern), + initBundle, excludes)); visited.add(other); processAnnotatedClassesInternal(other, bundlesToScan, - pattern, visited, classes); + pattern, visited, classes, initBundle, excludes); } } }