# 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
`final Set<ArtifactDescriptor>`
`getArtifactDescriptors()`
Return a set of artifact descriptors The requirements and capabilities of the returned artifacts are available as an aggregate from `Descriptor.getCapabilities()`, `Descriptor.getRequirements()`.
`final 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 type
`void`
`lock()`
Lock the descriptor.

### Methods inherited from class Descriptor

`aggregate, checkLocked, getCapabilities, getCapabilities, getDynamicImportedPackages, getExportedPackages, getExportedPackages, getImportedPackages, getName, getRequirements, isLocked, toString`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### ContainerDescriptor

protected ContainerDescriptor(String name)
Constructor for a new descriptor

Parameters:
  `name` - The name
Throws:
  `IllegalArgumentException` - if name is `null`

## Method Details

### 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 from `Descriptor.getCapabilities()`, `Descriptor.getRequirements()`, `Descriptor.getDynamicImportedPackages()` `Descriptor.getExportedPackages()` and `Descriptor.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 from `Descriptor.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: `Descriptor`
Lock the descriptor. Once invoked no changes can be made to the descriptor.

Overrides:
  `lock` in class `Descriptor`