}
private void findBeanClasses(Bundle mainBundle, PackageAdmin packageAdmin)
{
BundleClassFinder bundleClassFinder =
new BundleAssignableClassFinder(packageAdmin, mainBundle,
new Class<?>[]{Object.class},
new ClassDiscoveryFilter()
{
public boolean directoryDiscoveryRequired(String directory)
{
return true;
}
public boolean jarFileDiscoveryRequired(String jarUrl)
{
boolean isValidBeanArchive = beanArchiveJarNames.contains(jarUrl);
return isValidBeanArchive;
}
public boolean packageDiscoveryRequired(String packageName)
{
return true;
}
public boolean rangeDiscoveryRequired(DiscoveryRange discoveryRange)
{
return discoveryRange.equals(DiscoveryRange.BUNDLE_CLASSPATH);
}
});
Set<String> acceptedClassNames = bundleClassFinder.find();
for (String clsName : acceptedClassNames)
{
try
{
Class<?> cls = mainBundle.loadClass(clsName);