Package org.axonframework.modelling.saga
Class AbstractResourceInjector
java.lang.Object
org.axonframework.modelling.saga.AbstractResourceInjector
- All Implemented Interfaces:
ResourceInjector
- Direct Known Subclasses:
ConfigurationResourceInjector,SimpleResourceInjector
Abstract implementation of a
ResourceInjector for sagas that injects field and method resources. Resources
are provided by the concrete implementation.- Author:
- Allard Buijze
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract <R> Optional<R> findResource(Class<R> requiredType) Returns a resource of givenrequiredTypeor an empty Optional if the resource is not registered with the injector.protected String[]Provides an array with fully qualified class names of the annotation that indicate an injection point for a resource.voidinjectResources(Object saga) Inject required resources into the givensaga.
-
Constructor Details
-
AbstractResourceInjector
public AbstractResourceInjector()
-
-
Method Details
-
injectResources
Description copied from interface:ResourceInjectorInject required resources into the givensaga.- Specified by:
injectResourcesin interfaceResourceInjector- Parameters:
saga- The saga to inject resources into
-
findResource
Returns a resource of givenrequiredTypeor an empty Optional if the resource is not registered with the injector.- Type Parameters:
R- the resource type- Parameters:
requiredType- the class of the resource to find- Returns:
- an Optional that contains the resource if it was found
-
injectorAnnotationNames
Provides an array with fully qualified class names of the annotation that indicate an injection point for a resource. By default, these are:javax.inject.Inject, andorg.springframework.beans.factory.annotation.Autowired
- Returns:
- an array with fully qualified class names of annotations
-