Package org.axonframework.spring.saga
Class SpringResourceInjector
java.lang.Object
org.axonframework.spring.saga.SpringResourceInjector
- All Implemented Interfaces:
org.axonframework.modelling.saga.ResourceInjector,org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware
public class SpringResourceInjector
extends Object
implements org.axonframework.modelling.saga.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) voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext)
-
Constructor Details
-
SpringResourceInjector
public SpringResourceInjector()
-
-
Method Details
-
injectResources
- Specified by:
injectResourcesin interfaceorg.axonframework.modelling.saga.ResourceInjector
-
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
-