Package org.eclipse.osgi.container
Class ModuleRevisionBuilder
java.lang.Object
org.eclipse.osgi.container.ModuleRevisionBuilder
A builder for creating module 
ModuleRevision objects. A builder can
 only be used by the module container to build
 revisions when
 installing or
 updating a module.
 
 The builder provides the instructions to the container for creating a
 ModuleRevision. They are not thread-safe; in the absence of external
 synchronization, they do not support concurrent access by multiple threads.
- Since:
- 3.10
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classProvides information about a capability or requirement
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidAdds a capability to this builder using the specified namespace, directives and attributesvoidAdds a requirement to this builder using the specified namespace, directives and attributesReturns a snapshot of the capabilities for this buildergetCapabilities(String namespace) Returns a snapshot of the capabilities in the given namespace for this builderlonggetId()Returns the module id for this builder.Returns a snapshot of the requirements for this buildergetRequirements(String namespace) Returns a snapshot of the requirements in the given namespace for this builderReturns the symbolic name for this builder.intgetTypes()Returns the module type for this builder.Returns the module version for this builder.voidsetId(long id) Sets the module ID for the builder.voidsetSymbolicName(String symbolicName) Sets the symbolic name for the buildervoidsetTypes(int types) Sets the module types for the builder.voidsetVersion(Version version) Sets the module version for the builder.
- 
Constructor Details- 
ModuleRevisionBuilderpublic ModuleRevisionBuilder()Constructs a new module builder
 
- 
- 
Method Details- 
setSymbolicNameSets the symbolic name for the builder- Parameters:
- symbolicName- the symbolic name
 
- 
setVersionSets the module version for the builder.- Parameters:
- version- the version
 
- 
setTypespublic void setTypes(int types) Sets the module types for the builder.- Parameters:
- types- the module types
 
- 
setIdpublic void setId(long id) Sets the module ID for the builder.This module ID will be used if this builder is used to installa module. If the ID is not set then a module ID will be generated by the module container at install time. If a module already exists with the specified ID then an error will occur when attempting to install a new module with this builder.Note that the system module with location Constants.SYSTEM_BUNDLE_LOCATIONalways gets module ID of zero. The builder for the system module is not asked to provide the module ID for the system module at install time.- Parameters:
- id- the module ID to use. Must be >= 1.
- Since:
- 3.13
 
- 
addCapabilitypublic void addCapability(String namespace, Map<String, String> directives, Map<String, Object> attributes) Adds a capability to this builder using the specified namespace, directives and attributes- Parameters:
- namespace- the namespace of the capability
- directives- the directives of the capability
- attributes- the attributes of the capability
 
- 
getCapabilitiesReturns a snapshot of the capabilities for this builder- Returns:
- the capabilities
 
- 
getCapabilitiesReturns a snapshot of the capabilities in the given namespace for this builder- Parameters:
- namespace- The namespace of the capabilities to return or null to return the capabilities from all namespaces.
- Returns:
- the capabilities
- Since:
- 3.17
 
- 
addRequirementpublic void addRequirement(String namespace, Map<String, String> directives, Map<String, Object> attributes) Adds a requirement to this builder using the specified namespace, directives and attributes- Parameters:
- namespace- the namespace of the requirement
- directives- the directives of the requirement
- attributes- the attributes of the requirement
 
- 
getRequirementsReturns a snapshot of the requirements for this builder- Returns:
- the requirements
 
- 
getRequirementsReturns a snapshot of the requirements in the given namespace for this builder- Parameters:
- namespace- The namespace of the requirements to return or null to return the requirements from all namespaces.
- Returns:
- the requirements
- Since:
- 3.17
 
- 
getSymbolicNameReturns the symbolic name for this builder.- Returns:
- the symbolic name for this builder.
 
- 
getVersionReturns the module version for this builder.- Returns:
- the module version for this builder.
 
- 
getTypespublic int getTypes()Returns the module type for this builder.- Returns:
- the module type for this builder.
 
- 
getIdpublic long getId()Returns the module id for this builder. A value of -1 indicates that the module ID will be generated by the module container atinstalltime.- Returns:
- the module id for this builder.
- Since:
- 3.13
 
 
-