Class ComponentCollector<F extends ComponentFactory>

Type Parameters:
F - the component factory type
All Implemented Interfaces:
Iterable<ComponentType>, Channel, ComponentType, Eligible, Manager, ServiceTrackerCustomizer<F,F>

public class ComponentCollector<F extends ComponentFactory> extends ComponentProvider implements ServiceTrackerCustomizer<F,F>
A component that collects all services from the OSGi service registry which implement the sub-interface of ComponentFactory specified when creating the collector.

The collector uses each service found to create one or more Components that are then attached to the component collector instance.

Effectively, the component collector leverages OSGi’s service layer to modify the component tree at run-time.

This class uses ComponentProvider.setFactories(ComponentFactory...) and ComponentProvider.setPinned(List) for its implementation. As it inherits from ComponentProvider, it automatically supports the provisioning of additional components through ConfigurationUpdate events. If this is not desired, invoke ComponentProvider.setComponentsEntry(String) with null as argument.