Package org.apache.sling.feature.scanner
Class ContainerDescriptor
java.lang.Object
org.apache.sling.feature.scanner.Descriptor
org.apache.sling.feature.scanner.ContainerDescriptor
- Direct Known Subclasses:
FeatureDescriptor
public abstract class ContainerDescriptor extends Descriptor
Information about a container (feature). This is the aggregated information.
Note that this implementation is not synchronized. If multiple threads access
a descriptor concurrently, and at least one of the threads modifies the
descriptor structurally, it must be synchronized externally. However, once a
descriptor is locked, it is safe to access it concurrently.
-
Constructor Summary
Constructors Modifier Constructor Description protected
ContainerDescriptor(String name)
Constructor for a new descriptor -
Method Summary
Modifier and Type Method Description Set<ArtifactDescriptor>
getArtifactDescriptors()
Return a set of artifact descriptors The requirements and capabilities of the returned artifacts are available as an aggregate fromDescriptor.getCapabilities()
,Descriptor.getRequirements()
.Set<BundleDescriptor>
getBundleDescriptors()
Return a set of bundle descriptors.<T extends ArtifactDescriptor>
Set<T>getDescriptors(Class<T> type)
Return a set of artifact descriptors of the given typevoid
lock()
Lock the descriptor.Methods inherited from class org.apache.sling.feature.scanner.Descriptor
aggregate, checkLocked, getCapabilities, getDynamicImportedPackages, getExportedPackages, getImportedPackages, getName, getRequirements, isLocked, toString
-
Constructor Details
-
ContainerDescriptor
Constructor for a new descriptor- Parameters:
name
- The name- Throws:
IllegalArgumentException
- if name isnull
-
-
Method Details
-
getBundleDescriptors
Return a set of bundle descriptors. The requirements and capabilities of the returned bundles are available as an aggregate fromDescriptor.getCapabilities()
,Descriptor.getRequirements()
,Descriptor.getDynamicImportedPackages()
Descriptor.getExportedPackages()
andDescriptor.getImportedPackages()
- Returns:
- The set of bundle descriptors (might be empty)
-
getArtifactDescriptors
Return a set of artifact descriptors The requirements and capabilities of the returned artifacts are available as an aggregate fromDescriptor.getCapabilities()
,Descriptor.getRequirements()
.- Returns:
- The set of artifact descriptors (might be empty)
-
getDescriptors
Return a set of artifact descriptors of the given type- Parameters:
type
- The descriptor type- Returns:
- The set of artifact descriptors matching the type (might be empty)
- Since:
- 2.3
-
lock
public void lock()Description copied from class:Descriptor
Lock the descriptor. Once invoked no changes can be made to the descriptor.- Overrides:
lock
in classDescriptor
-