WebFlow action bean needs AOP
In my Project i use Spring WebFlow.
I have a bean defined in one of my flow.xml files
Code:
<bean id="customerActions" class="com.system.actions.CustomerAction" >
<property name="webService" ref="customerWebService"/>
<property name="agentService" ref="agentClient"/>
</bean>
Customer Action extends MultiAction class from webflow.
Now i have a SecurityAspect class annotiated as AspectJ
Code:
@Aspect
public class SecurityAspect {
private SecuritySession session;
@Before("@annotation(com.system.lib.Security)")
public void checkSecurity(JoinPoint jp) throws Throwable{
String userid = session.getUserid();
if (userid == null) {
throw new SecurityException("User credentials must be present before attempting to invoke the method: "+ getMethod(jp).getName() );
}
}
}
My CustomerAction contains annotation that should be intercepted by this SecurityAspect.
However that is not the case, the aspect is never executed.
I don't understand why this bean is omitted, it is spring managed.
Is it possible that webflow has its own spring managed context and my SecurityAspect lives in a separate managed context?
If someone has an opinion or knowledge on this please share.