Module org.nasdanika.graph
Package org.nasdanika.graph.processor
Class ReflectiveProcessorFactoryProvider<P,H,E>
java.lang.Object
org.nasdanika.common.Reflector
org.nasdanika.graph.processor.ReflectiveProcessorFactoryProvider<P,H,E>
- Type Parameters:
P
-T
-R
-U
-S
-
Supplier
of a ProcessorFactory
which reflecitvely creates processors and wires hanlders and endpoints using annotations.- Author:
- Pavel
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected class
protected class
Records don't work with non-static types.Nested classes/interfaces inherited from class org.nasdanika.common.Reflector
org.nasdanika.common.Reflector.AnnotatedElementRecord, org.nasdanika.common.Reflector.Factories, org.nasdanika.common.Reflector.Factory
-
Field Summary
Fields inherited from class org.nasdanika.common.Reflector
evalCache, expressionParserThreadLocal
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected int
protected P
createProcessor
(ProcessorConfig config, boolean parallel, BiConsumer<Element, BiConsumer<ProcessorInfo<P>, org.nasdanika.common.ProgressMonitor>> infoProvider, Consumer<CompletionStage<?>> endpointWiringStageConsumer, org.nasdanika.common.ProgressMonitor progressMonitor) getFactory
(Object... registryTargets) protected boolean
matchFactoryMethod
(ProcessorConfig elementProcessorConfig, Method method) protected boolean
matchIncomingEndpoint
(AnnotatedElement endpointMember, Connection incomingConnection) Matches processor field or method and incoming connection.protected boolean
matchIncomingHandler
(AnnotatedElement handlerMember, Connection incomingConnection) Matches processor field or method and incoming connection.protected boolean
matchOutgoingEndpoint
(AnnotatedElement endpointMember, Connection outgoingConnection) Matches processor field or method and outgoing connection.protected boolean
matchOutgoingHandler
(AnnotatedElement handlerMember, Connection outgoingConnection) Matches processor field or method and outgoing connection.protected void
wireChildProcessors
(Stream<org.nasdanika.common.Reflector.AnnotatedElementRecord> processorAnnotatedElementRecords, Map<Element, ProcessorConfig> childProcessorConfigs, BiConsumer<Element, BiConsumer<ProcessorInfo<P>, org.nasdanika.common.ProgressMonitor>> infoProvider) protected Stream<org.nasdanika.graph.processor.ReflectiveProcessorFactoryProvider.EndpointWireRecord>
wireIncomingEndpoint
(Stream<org.nasdanika.common.Reflector.AnnotatedElementRecord> processorAnnotatedElementRecords, Map<Connection, CompletionStage<E>> incomingEndpoints, org.nasdanika.common.ProgressMonitor progressMonitor) protected void
wireIncomingEndpoints
(Stream<org.nasdanika.common.Reflector.AnnotatedElementRecord> processorAnnotatedElementRecords, Map<Connection, CompletionStage<E>> incomingEndpoints) protected Collection<Connection>
wireIncomingHandler
(Stream<org.nasdanika.common.Reflector.AnnotatedElementRecord> processorAnnotatedElementRecords, Map<Connection, Consumer<H>> incomingHandlerConsumers) protected void
wireIncomingHandlerConsumers
(Stream<org.nasdanika.common.Reflector.AnnotatedElementRecord> processorAnnotatedElementRecords, Map<Connection, Consumer<H>> incomingHandlerConsumers) protected Stream<org.nasdanika.graph.processor.ReflectiveProcessorFactoryProvider.EndpointWireRecord>
wireOutgoingEndpoint
(Stream<org.nasdanika.common.Reflector.AnnotatedElementRecord> processorAnnotatedElementRecords, Map<Connection, CompletionStage<E>> outgoingEndpoints, org.nasdanika.common.ProgressMonitor progressMonitor) protected void
wireOutgoingEndpoints
(Stream<org.nasdanika.common.Reflector.AnnotatedElementRecord> processorAnnotatedElementRecords, Map<Connection, CompletionStage<E>> outgoingEndpoints) protected Collection<Connection>
wireOutgoingHandler
(Stream<org.nasdanika.common.Reflector.AnnotatedElementRecord> processorAnnotatedElementRecords, Map<Connection, Consumer<H>> outgoingHandlerConsumers) protected void
wireOutgoingHandlerConsumers
(Stream<org.nasdanika.common.Reflector.AnnotatedElementRecord> processorAnnotatedElementRecords, Map<Connection, Consumer<H>> outgoingHandlerConsumers) protected void
wireParentProcessor
(Stream<org.nasdanika.common.Reflector.AnnotatedElementRecord> processorAnnotatedElementRecords, Consumer<Consumer<ProcessorInfo<P>>> parentProcessorInfoProvider) protected void
wireProcessorElement
(Stream<org.nasdanika.common.Reflector.AnnotatedElementRecord> processorAnnotatedElementRecords, Element element) protected void
wireRegistry
(Stream<org.nasdanika.common.Reflector.AnnotatedElementRecord> processorAnnotatedElementRecords, Collection<ProcessorConfig> registry, BiConsumer<Element, BiConsumer<ProcessorInfo<P>, org.nasdanika.common.ProgressMonitor>> infoProvider) protected void
wireRegistryEntry
(Stream<org.nasdanika.common.Reflector.AnnotatedElementRecord> processorAnnotatedElementRecords, Collection<ProcessorConfig> registry, BiConsumer<Element, BiConsumer<ProcessorInfo<P>, org.nasdanika.common.ProgressMonitor>> infoProvider) wireSourceEndpoint
(Stream<org.nasdanika.common.Reflector.AnnotatedElementRecord> processorAnnotatedElementRecords) protected void
wireSourceHandler
(Stream<org.nasdanika.common.Reflector.AnnotatedElementRecord> processorAnnotatedElementRecords, ConnectionProcessorConfig<H, E> connectionProcessorConfig) wireTargetEndpoint
(Stream<org.nasdanika.common.Reflector.AnnotatedElementRecord> processorAnnotatedElementRecords) protected void
wireTargetHandler
(Stream<org.nasdanika.common.Reflector.AnnotatedElementRecord> processorAnnotatedElementRecords, ConnectionProcessorConfig<H, E> connectionProcessorConfig) Methods inherited from class org.nasdanika.common.Reflector
canGet, canSet, compareMethods, evaluatePredicate, get, getAnnotatedElementRecords, getAnnotatedElementRecords, getEvaluationContext, getExpressionParser, getFieldValue, getTargetPredicate, invoke, invokeMethod, isValueSupplier, matchPredicate, mustGet, mustSet, onEvaluationException, set, setFieldValue
-
Constructor Details
-
ReflectiveProcessorFactoryProvider
-
-
Method Details
-
getFactory
-
createProcessor
protected P createProcessor(ProcessorConfig config, boolean parallel, BiConsumer<Element, BiConsumer<ProcessorInfo<P>, org.nasdanika.common.ProgressMonitor>> infoProvider, Consumer<CompletionStage<?>> endpointWiringStageConsumer, org.nasdanika.common.ProgressMonitor progressMonitor) -
compareProcessorMethods
-
wireRegistryEntry
protected void wireRegistryEntry(Stream<org.nasdanika.common.Reflector.AnnotatedElementRecord> processorAnnotatedElementRecords, Collection<ProcessorConfig> registry, BiConsumer<Element, BiConsumer<ProcessorInfo<P>, org.nasdanika.common.ProgressMonitor>> infoProvider) -
wireRegistry
protected void wireRegistry(Stream<org.nasdanika.common.Reflector.AnnotatedElementRecord> processorAnnotatedElementRecords, Collection<ProcessorConfig> registry, BiConsumer<Element, BiConsumer<ProcessorInfo<P>, org.nasdanika.common.ProgressMonitor>> infoProvider) -
wireProcessorElement
protected void wireProcessorElement(Stream<org.nasdanika.common.Reflector.AnnotatedElementRecord> processorAnnotatedElementRecords, Element element) -
wireParentProcessor
protected void wireParentProcessor(Stream<org.nasdanika.common.Reflector.AnnotatedElementRecord> processorAnnotatedElementRecords, Consumer<Consumer<ProcessorInfo<P>>> parentProcessorInfoProvider) -
wireChildProcessors
protected void wireChildProcessors(Stream<org.nasdanika.common.Reflector.AnnotatedElementRecord> processorAnnotatedElementRecords, Map<Element, ProcessorConfig> childProcessorConfigs, BiConsumer<Element, BiConsumer<ProcessorInfo<P>, org.nasdanika.common.ProgressMonitor>> infoProvider) -
matchIncomingHandler
protected boolean matchIncomingHandler(AnnotatedElement handlerMember, Connection incomingConnection) Matches processor field or method and incoming connection.- Returns:
-
wireIncomingHandler
protected Collection<Connection> wireIncomingHandler(Stream<org.nasdanika.common.Reflector.AnnotatedElementRecord> processorAnnotatedElementRecords, Map<Connection, Consumer<H>> incomingHandlerConsumers) - Parameters:
processor
-incomingHandlerConsumers
-parallel
-- Returns:
- Wired connections
-
wireIncomingHandlerConsumers
protected void wireIncomingHandlerConsumers(Stream<org.nasdanika.common.Reflector.AnnotatedElementRecord> processorAnnotatedElementRecords, Map<Connection, Consumer<H>> incomingHandlerConsumers) -
matchIncomingEndpoint
protected boolean matchIncomingEndpoint(AnnotatedElement endpointMember, Connection incomingConnection) Matches processor field or method and incoming connection.- Returns:
-
wireIncomingEndpoint
protected Stream<org.nasdanika.graph.processor.ReflectiveProcessorFactoryProvider.EndpointWireRecord> wireIncomingEndpoint(Stream<org.nasdanika.common.Reflector.AnnotatedElementRecord> processorAnnotatedElementRecords, Map<Connection, CompletionStage<E>> incomingEndpoints, org.nasdanika.common.ProgressMonitor progressMonitor) - Parameters:
processor
-incomingEndpoints
-progressMonitor
-- Returns:
- Wired incoming endpoints for collection of failures
-
wireIncomingEndpoints
protected void wireIncomingEndpoints(Stream<org.nasdanika.common.Reflector.AnnotatedElementRecord> processorAnnotatedElementRecords, Map<Connection, CompletionStage<E>> incomingEndpoints) -
matchOutgoingHandler
protected boolean matchOutgoingHandler(AnnotatedElement handlerMember, Connection outgoingConnection) Matches processor field or method and outgoing connection.- Returns:
-
wireOutgoingHandler
protected Collection<Connection> wireOutgoingHandler(Stream<org.nasdanika.common.Reflector.AnnotatedElementRecord> processorAnnotatedElementRecords, Map<Connection, Consumer<H>> outgoingHandlerConsumers) - Parameters:
processor
-outgoingHandlerConsumers
-parallel
-- Returns:
- Wired connections
-
wireOutgoingHandlerConsumers
protected void wireOutgoingHandlerConsumers(Stream<org.nasdanika.common.Reflector.AnnotatedElementRecord> processorAnnotatedElementRecords, Map<Connection, Consumer<H>> outgoingHandlerConsumers) -
matchOutgoingEndpoint
protected boolean matchOutgoingEndpoint(AnnotatedElement endpointMember, Connection outgoingConnection) Matches processor field or method and outgoing connection.- Returns:
-
wireOutgoingEndpoint
protected Stream<org.nasdanika.graph.processor.ReflectiveProcessorFactoryProvider.EndpointWireRecord> wireOutgoingEndpoint(Stream<org.nasdanika.common.Reflector.AnnotatedElementRecord> processorAnnotatedElementRecords, Map<Connection, CompletionStage<E>> outgoingEndpoints, org.nasdanika.common.ProgressMonitor progressMonitor) -
wireOutgoingEndpoints
protected void wireOutgoingEndpoints(Stream<org.nasdanika.common.Reflector.AnnotatedElementRecord> processorAnnotatedElementRecords, Map<Connection, CompletionStage<E>> outgoingEndpoints) -
wireTargetHandler
protected void wireTargetHandler(Stream<org.nasdanika.common.Reflector.AnnotatedElementRecord> processorAnnotatedElementRecords, ConnectionProcessorConfig<H, E> connectionProcessorConfig) -
wireTargetEndpoint
protected Consumer<E> wireTargetEndpoint(Stream<org.nasdanika.common.Reflector.AnnotatedElementRecord> processorAnnotatedElementRecords) -
wireSourceHandler
protected void wireSourceHandler(Stream<org.nasdanika.common.Reflector.AnnotatedElementRecord> processorAnnotatedElementRecords, ConnectionProcessorConfig<H, E> connectionProcessorConfig) -
wireSourceEndpoint
protected Consumer<E> wireSourceEndpoint(Stream<org.nasdanika.common.Reflector.AnnotatedElementRecord> processorAnnotatedElementRecords) -
matchFactoryMethod
-