Aug 17th, 2006, 03:17 PM
I want to set a Thread Local variable via an AOP interceptor, but I don't know how to use Spring facilities for Thread Local variables.
I tried to declare a bean of org.springframework.aop.target.ThreadLocalTargetSo urce class but with no sucess.
Does anyone have an example of how to set a value in the Thread context, so the next methods in the chain could read the value?
In the documentation I saw:
<bean id="threadlocalTargetSource" class="org.springframework.aop.target.ThreadLocalT argetSource">
<property name="targetBeanName" value="businessObjectTarget"/>
Do I have to declare a dependency between my business object and the threadlocalTargetSource ? My business object is actually a ProxyFactoryBean.
Thanks for your help.
Aug 17th, 2006, 03:53 PM
You shouldn't have to declare anymore of a dependency than you have now.
But keep in mind that businessObjectTarget has to be a non-singleton.