Class SpringResourceInjector

java.lang.Object
org.axonframework.spring.saga.SpringResourceInjector
All Implemented Interfaces:
ResourceInjector, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware

public class SpringResourceInjector extends Object implements ResourceInjector, org.springframework.context.ApplicationContextAware
ResourceInjector implementation that injects Saga instances with resources available from the Spring Application context the injector is registered in.

Resources need to be annotated with a Spring-compatible auto-wiring annotation, such as @Autowired or JSR-250's Resource.

Note: make sure that the Spring context also declares <context:annotation-config /> or an AutowiredAnnotationBeanPostProcessor. See the Spring documentation for more information.

Since:
0.7
Author:
Allard Buijze
  • Constructor Details

    • SpringResourceInjector

      public SpringResourceInjector()
  • 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
    • setApplicationContext

      public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
      Specified by:
      setApplicationContext in interface org.springframework.context.ApplicationContextAware
      Throws:
      org.springframework.beans.BeansException