{
Addon mappedAddon = moduleCache.getAddon(id);
if (mappedAddon != null && mappedAddon.getId().equals(found))
{
Builder builder = ModuleSpec.build(id);
builder.addDependency(DependencySpec.createModuleDependencySpec(SystemClasspathSpec.ID));
builder.addDependency(DependencySpec.createModuleDependencySpec(XPathJDKClasspathSpec.ID));
builder.addDependency(DependencySpec.createModuleDependencySpec(JAXBJDKClasspathSpec.ID));
builder.addDependency(DependencySpec.createModuleDependencySpec(CORBAClasspathSpec.ID));
builder.addDependency(DependencySpec.createModuleDependencySpec(SunMiscClasspathSpec.ID));
builder.addDependency(DependencySpec.createModuleDependencySpec(SunJDKClasspathSpec.ID));
ClassLoader parent = ClassLoader.getSystemClassLoader().getParent();
if (parent != null)
{
// META-INF/services from JDK should be visible
builder.addDependency(DependencySpec.createClassLoaderDependencySpec(PathFilters.acceptAll(),
PathFilters.acceptAll(), parent, Collections.singleton("META-INF/services")));
}
builder.addDependency(DependencySpec.createModuleDependencySpec(XATransactionJDKClasspathSpec.ID));
builder.addDependency(DependencySpec.createModuleDependencySpec(PathFilters.acceptAll(),
PathFilters.rejectAll(), null, FurnaceContainerSpec.ID, false));
try
{
addContainerDependencies(views, repository, found, builder);
}
catch (ContainerException e)
{
logger.warning(e.getMessage());
return null;
}
builder.addDependency(DependencySpec.createLocalDependencySpec(PathFilters.acceptAll(),
PathFilters.acceptAll()));
try
{
addAddonDependencies(views, repository, found, builder);
}
catch (ContainerException e)
{
logger.warning(e.getMessage());
return null;
}
addLocalResources(repository, found, builder, id);
return builder.create();
}
}
}
}
return null;