Package org.axonframework.spring.saga
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidinjectResources(Object saga) Inject required resources into the givensaga.voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext)
-
Constructor Details
-
SpringResourceInjector
public SpringResourceInjector()
-
-
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
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException - Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Throws:
org.springframework.beans.BeansException
-