Package aQute.bnd.osgi.resource
Class ResourceBuilder
java.lang.Object
aQute.bnd.osgi.resource.ResourceBuilder
- Direct Known Subclasses:
SyntheticBuilder
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddCapabilities(List<org.osgi.resource.Capability> capabilities) addCapability(CapReqBuilder builder) addCapability(org.osgi.resource.Capability capability) voidaddContentCapability(URI uri, String sha256, long length, String mime) voidvoidvoidaddExportPackage(String name, Attrs attrs) voidaddExportPackage(String name, Attrs attrs, String bundle_symbolic_name, org.osgi.framework.Version bundle_version) voidaddExportPackages(Parameters exports) Add Exported PackagesvoidaddExportPackages(Parameters exports, String bundle_symbolic_name, org.osgi.framework.Version bundle_version) voidaddExportServices(Parameters exportServices) booleanvoidaddFragmentHost(String bsn, Attrs attrs) voidAdd simple class name hashes to the exported packages.org.osgi.resource.RequirementaddImportPackage(String name, Attrs attrs) voidaddImportPackages(Parameters imports) Add imported packagesvoidaddImportServices(Parameters importServices) booleanaddManifest(Domain manifest) Parse the manifest and turn them into requirements invalid input: '&' capabilitiesList<org.osgi.resource.Capability> addProvideCapabilities(Parameters capabilities) List<org.osgi.resource.Capability> addProvideCapabilities(String clauses) org.osgi.resource.CapabilityaddProvideCapability(String namespace, Attrs attrs) voidaddRequireBundle(String bsn, Attrs attrs) voidaddRequireBundle(String bsn, VersionRange range) voidaddRequireBundles(Parameters requireBundle) Add the Require-Bundle headervoidaddRequireCapabilities(Parameters required) voidaddRequireCapability(String namespace, String name, Attrs attrs) addRequirement(CapReqBuilder builder) voidaddRequirement(List<org.osgi.resource.Requirement> requirements) addRequirement(org.osgi.resource.Requirement requirement) voidaddRequirements(List<org.osgi.resource.Requirement> requires) addResource(org.osgi.resource.Resource source) voidaddWorkspaceNamespace(String name) A repository that implements theWorkspaceRepositoryMarkerin the resolver must add a WORKSPACE_NAMESPACE capability to make its clear the resources are from the workspace.org.osgi.resource.Resourcebuild()protected org.osgi.resource.CapabilitybuildCapability(CapReqBuilder builder) protected org.osgi.resource.RequirementbuildRequirement(CapReqBuilder builder) voidcopyCapabilities(Set<String> ignoreNamespaces, org.osgi.resource.Resource r) List<org.osgi.resource.Capability> findCapabilities(String ns, String filter) Map<org.osgi.resource.Capability, org.osgi.resource.Capability> from(org.osgi.resource.Resource bundle) List<org.osgi.resource.Capability> getNativeCode(String header) Caclulate the requirement from a native code headeraQute.service.reporter.ReporterList<org.osgi.resource.Requirement> static Supplier<org.osgi.resource.Resource> Create a deferred resource builder so that any expensive actions are deferred until the supplier is called to get the resource.toString()
-
Constructor Details
-
ResourceBuilder
public ResourceBuilder() -
ResourceBuilder
public ResourceBuilder(org.osgi.resource.Resource source)
-
-
Method Details
-
addResource
-
addCapability
-
addCapability
-
buildCapability
-
addRequirement
-
addRequirement
-
buildRequirement
-
build
public org.osgi.resource.Resource build() -
getCapabilities
-
getRequirements
-
addManifest
Parse the manifest and turn them into requirements invalid input: '&' capabilities- Parameters:
manifest- The manifest to parse
-
addExportServices
-
addImportServices
-
getNativeCode
Caclulate the requirement from a native code header- Parameters:
header- the Bundle-NativeCode header or null- Returns:
- a Requirement Builder set to the requirements according tot he core spec
-
addRequireBundles
Add the Require-Bundle header -
addRequireBundle
-
addRequireBundle
-
addFragmentHost
-
addRequireCapabilities
-
addRequireCapability
-
addProvideCapabilities
-
addProvideCapabilities
-
addProvideCapability
-
addExportPackages
Add Exported Packages -
addExportPackages
public void addExportPackages(Parameters exports, String bundle_symbolic_name, org.osgi.framework.Version bundle_version) -
addEE
-
addExportPackage
-
addExportPackage
-
addImportPackages
Add imported packages -
addImportPackage
-
addExecutionEnvironment
-
addAllExecutionEnvironments
-
copyCapabilities
-
addCapabilities
-
addRequirement
-
addRequirements
-
findCapabilities
-
from
public Map<org.osgi.resource.Capability,org.osgi.resource.Capability> from(org.osgi.resource.Resource bundle) -
getReporter
public aQute.service.reporter.Reporter getReporter() -
addContentCapability
-
addFile
- Throws:
Exception
-
addHashes
Add simple class name hashes to the exported packages. This should not be called before any package capabilities are set since we only hash class names in exports. So no exports, no hash.- Throws:
IOException
-
safeResourceBuilder
-
addWorkspaceNamespace
A repository that implements theWorkspaceRepositoryMarkerin the resolver must add a WORKSPACE_NAMESPACE capability to make its clear the resources are from the workspace. Ideally this would not be necessary but we're having two workspace repositories. One for Bndtools where the repository is interactive, the other is for resolving in Gradle, etc.- Parameters:
name- the project name
-
toString
-
memoize
public static Supplier<org.osgi.resource.Resource> memoize(Jar jar, URI uri, String projectName) throws Exception Create a deferred resource builder so that any expensive actions are deferred until the supplier is called to get the resource.- Parameters:
jar- a Jar, preferably with checksum calculated, or nulluri- the uri to use or null (will use file uri as default)projectName- if in a workspace, the project name or otherwise null- Returns:
- a memo for creating the corresponding resource
- Throws:
Exception
-