org.axonframework.saga.spring
Class SpringResourceInjector

java.lang.Object
  extended by org.axonframework.saga.spring.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 Summary
SpringResourceInjector()
           
 
Method Summary
 void injectResources(Saga saga)
          Inject required resources into the given saga.
 void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpringResourceInjector

public SpringResourceInjector()
Method Detail

injectResources

public void injectResources(Saga 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


Copyright © 2010-2016. All Rights Reserved.