ModuleLoader moduleLoader = Module.getBootModuleLoader();
moduleLoader.loadModule(modid);
} catch (ModuleLoadException ex) {
continue;
}
DefaultResourceBuilder builder = new DefaultResourceBuilder();
Capability icap = builder.addIdentityCapability(symbolicName, version);
icap.getAttributes().put(IdentityNamespace.CAPABILITY_TYPE_ATTRIBUTE, IdentityNamespace.TYPE_ABSTRACT);
result.add(builder.getResource().getIdentityCapability());
}
}
// Add the main module
if (result.isEmpty()) {
ModuleIdentifier modid = ModuleIdentifier.fromString(symbolicName);
try {
ModuleLoader moduleLoader = Module.getBootModuleLoader();
moduleLoader.loadModule(modid);
DefaultResourceBuilder builder = new DefaultResourceBuilder();
Capability icap = builder.addIdentityCapability(symbolicName, Version.emptyVersion);
icap.getAttributes().put(IdentityNamespace.CAPABILITY_TYPE_ATTRIBUTE, IdentityNamespace.TYPE_ABSTRACT);
result.add(builder.getResource().getIdentityCapability());
} catch (ModuleLoadException ex) {
// ignore
}
}
return Collections.unmodifiableSet(result);