Package org.jgrapes.core
Class ComponentCollector<F extends ComponentFactory>
java.lang.Object
org.jgrapes.core.internal.ComponentVertex
org.jgrapes.core.Component
org.jgrapes.core.ComponentCollector<F>
- Type Parameters:
F
- the component factory type
- All Implemented Interfaces:
Iterable<ComponentType>
,Channel
,ComponentType
,Eligible
,Manager
@Deprecated(since="1.3")
public class ComponentCollector<F extends ComponentFactory>
extends Component
Deprecated.
A component that collects all component factory services of
a given type and uses each to create one or more components
that are then attached to the component collector instance.
Effectively, the component collector leverages the mechanism provided by the service loader to determine the component tree that is built eventually at “link time”.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.jgrapes.core.Channel
Channel.Default
-
Field Summary
-
Constructor Summary
ConstructorDescriptionComponentCollector
(Class<F> factoryClass, Channel componentChannel) Deprecated.Utility constructor that uses each factory to create a single instance, using an empty map as properties.ComponentCollector
(Class<F> factoryClass, Channel componentChannel, Function<String, List<Map<Object, Object>>> matcher) Deprecated.Creates a new collector that collects the factories of the given type and uses each to create one or more instances with this component’s (the component collector’s) channel. -
Method Summary
Methods inherited from class org.jgrapes.core.Component
channel, component, defaultCriterion, isEligibleFor, setName
Methods inherited from class org.jgrapes.core.internal.ComponentVertex
activeEventPipeline, addHandler, attach, channelReplacements, children, componentPath, componentVertex, detach, fire, initComponentsHandlers, iterator, name, newEventPipeline, newEventPipeline, parent, registerAsGenerator, root, toString, unregisterAsGenerator
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
ComponentCollector
public ComponentCollector(Class<F> factoryClass, Channel componentChannel, Function<String, List<Map<Object, Object>>> matcher) Deprecated.Creates a new collector that collects the factories of the given type and uses each to create one or more instances with this component’s (the component collector’s) channel.Before instances are created, the
matcher
function is invoked with the name of the class of the component to be created as argument. The list of maps returned is used to create components, passing each element in the list as parameter toComponentFactory.create(Channel, Map)
.- Parameters:
factoryClass
- the factory classcomponentChannel
- this component’s channelmatcher
- the matcher function
-
ComponentCollector
Deprecated.Utility constructor that uses each factory to create a single instance, using an empty map as properties.- Parameters:
factoryClass
- the factory classcomponentChannel
- this component’s channel
-
ComponentCollector
.