List<Capability> capabilities = super.determineCapabilities();
if (capabilities != null)
return capabilities;
// We need to work it out
ClassLoadingMetaDataFactory factory = ClassLoadingMetaDataFactory.getInstance();
capabilities = new CopyOnWriteArrayList<Capability>();
// We have a module capability
Object version = getVersion();
Capability capability = factory.createModule(getName(), version);
capabilities.add(capability);
// Do we determine package capabilities
ClassFilter included = getIncluded();
ClassFilter excluded = getExcluded();
ClassFilter excludedExport = getExcludedExport();
ExportAll exportAll = getExportAll();
if (exportAll != null)
{
Set<String> exportedPackages = PackageVisitor.determineAllPackages(roots, excludedRoots, exportAll, included, excluded, excludedExport);
for (String packageName : exportedPackages)
{
capability = factory.createPackage(packageName, version);
capabilities.add(capability);
}
}
return capabilities;