Class AbstractResourceInjector

java.lang.Object
org.axonframework.modelling.saga.AbstractResourceInjector
All Implemented Interfaces:
ResourceInjector
Direct Known Subclasses:
ConfigurationResourceInjector, SimpleResourceInjector

public abstract class AbstractResourceInjector extends Object implements ResourceInjector
Abstract implementation of a ResourceInjector for sagas that injects field and method resources. Resources are provided by the concrete implementation.
Author:
Allard Buijze
  • Constructor Details

    • AbstractResourceInjector

      public AbstractResourceInjector()
  • Method Details

    • injectResources

      public void injectResources(Object saga)
      Description copied from interface: ResourceInjector
      Inject required resources into the given saga.
      Specified by:
      injectResources in interface ResourceInjector
      Parameters:
      saga - The saga to inject resources into
    • findResource

      protected abstract <R> Optional<R> findResource(Class<R> requiredType)
      Returns a resource of given requiredType or 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

      protected String[] 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, and
      • org.springframework.beans.factory.annotation.Autowired
      Returns:
      an array with fully qualified class names of annotations