Package net.shibboleth.shared.spring.config

# Class IdentifiedComponentManager<T extends IdentifiedComponent>

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.spring.config.IdentifiedComponentManager<T>

Type Parameters:
  `T` - descriptor type

All Implemented Interfaces:
  `Component`, `DestructableComponent`, `InitializableComponent`

public class IdentifiedComponentManager<T extends IdentifiedComponent> extends AbstractInitializableComponent
Class used for auto-wiring free-standing identified objects along with explicitly declared bean collections.

This class marries old-style "explicit" list-based configuration of a collection of objects with annotation-driven discovery of objects of the same type.

Specializations of this class are expected to fix the type and add an Autowired constructor to receive the free-standing objects.

Since:
  6.1.0

## Field Summary

Fields
Modifier and Type
Field
Description
`private Collection<T>`
`components`
Underlying collection.
`private Collection<T>`
`initialComponents`
Initial component list.
`private org.slf4j.Logger`
`log`
Class logger.

## Constructor Summary

Constructors
Constructor
Description
`IdentifiedComponentManager(Collection<T> freeObjects)`
Auto-wiring point for free-standing objects.

## Method Summary

Modifier and Type
Method
Description
`Collection<T>`
`getComponents()`
Gets the final collection of merged components.
`void`
`setComponents(Collection<T> additionalObjects)`
Sets additional non-autowired components to merge in.

### Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent

`checkComponentActive, checkSetterPreconditions, destroy, doDestroy, doInitialize, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitialized`

### Methods inherited from class java.lang.Object

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

## Field Details

### log

@Nonnull private org.slf4j.Logger log
Class logger.

### initialComponents

@Nonnull private Collection<T extends IdentifiedComponent> initialComponents
Initial component list.

### components

@Nonnull private Collection<T extends IdentifiedComponent> components
Underlying collection.

## Constructor Details

### IdentifiedComponentManager

public IdentifiedComponentManager(@Nullable Collection<T> freeObjects)
Auto-wiring point for free-standing objects.

Parameters:
  `freeObjects` - free-standing objects

## Method Details

### setComponents

public void setComponents(@Nullable Collection<T> additionalObjects)
Sets additional non-autowired components to merge in.

For now, this set is prepended to any auto-wired objects and any auto-wired objects are excluded if they have the same identifier as an explicitly injected object.

Parameters:
  `additionalObjects` - additional objects

### getComponents

@Nonnull public Collection<T> getComponents()
Gets the final collection of merged components.

Returns:
  merged components