if (imports == null || ! imports.contains("org.apache.felix.ipojo.configuration")) {
// TODO Check dynamic imports to verify if the package is not imported lazily.
return;
}
BundleWiring wiring = bundle.adapt(BundleWiring.class);
if (wiring == null) {
// Invalid state.
m_logger.log(Log.ERROR, "The bundle " + bundle.getBundleId() + " (" + bundle.getSymbolicName() + ") " +
"cannot be adapted to BundleWiring, state: " + bundle.getState());
return;
}
// Only lookup for local classes, parent classes will be analyzed on demand.
Collection<String> resources = wiring.listResources("/", "*.class",
BundleWiring.FINDENTRIES_RECURSE + BundleWiring.LISTRESOURCES_LOCAL);
if (resources == null) {
m_logger.log(Log.ERROR, "The bundle " + bundle.getBundleId() + " (" + bundle.getSymbolicName() + ") " +
" does not have any classes to be analyzed");
return;
}
m_logger.log(Log.DEBUG, resources.size() + " classes found");
handleResources(bundle, resources, wiring.getClassLoader());
}