}
private void findBeansXml(Bundle mainBundle, PackageAdmin packageAdmin)
throws Exception
{
BundleResourceFinder brfXmlJar = new BundleResourceFinder(packageAdmin, mainBundle, "", META_INF_BEANS_XML);
BundleResourceFinder.ResourceFinderCallback rfCallback = new BundleResourceFinder.ResourceFinderCallback()
{
public void foundInDirectory(Bundle bundle, String basePath, URL url) throws Exception
{
logger.info("adding the following beans.xml URL: " + url);
beanXMLs.add(url);
}
public void foundInJar(Bundle bundle, String jarName, ZipEntry entry, InputStream in) throws Exception
{
URL jarURL = bundle.getEntry(jarName);
URL beansUrl = new URL("jar:" + jarURL.toString() + "!/" + entry.getName());
logger.info("adding the following beans.xml URL: " + beansUrl);
beanXMLs.add(beansUrl);
beanArchiveJarNames.add(jarName);
}
};
brfXmlJar.find(rfCallback);
// TODO I found no other way to find WEB-INF/beanx.xml directly
Enumeration<URL> urls = mainBundle.findEntries("", "beans.xml", true);
boolean webBeansXmlFound = false;
while(urls != null && urls.hasMoreElements())