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 protectedContainerDescriptor(String name)Constructor for a new descriptor
-
Method Summary
All Methods Instance Methods Concrete Methods 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 typevoidlock()Lock the descriptor.-
Methods inherited from class org.apache.sling.feature.scanner.Descriptor
aggregate, checkLocked, getCapabilities, getDynamicImportedPackages, getExportedPackages, getImportedPackages, getName, getRequirements, isLocked, toString
-
-
-
-
Constructor Detail
-
ContainerDescriptor
protected ContainerDescriptor(String name)
Constructor for a new descriptor- Parameters:
name- The name- Throws:
IllegalArgumentException- if name isnull
-
-
Method Detail
-
getBundleDescriptors
public final Set<BundleDescriptor> 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
public final 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().- Returns:
- The set of artifact descriptors (might be empty)
-
getDescriptors
public <T extends ArtifactDescriptor> Set<T> getDescriptors(Class<T> type)
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:DescriptorLock the descriptor. Once invoked no changes can be made to the descriptor.- Overrides:
lockin classDescriptor
-
-