Intercepting Specific Methods
Hello.
In our application we need to intercept some methods to include information in a Thread Local variable.
Our sequence diagram:
Controller -> DAO -> Queries -> Data Source
I need to intercept some methods of the Controller layer because, depending on the method, the application should use one data source or another (actually there is more than 10), and this behaviour is dynamic, ie, it depends on parameters provided when calling the methods, so I can not use the Spring XML for this purpose.
I would like something like this (the interceptor tag is just my imagination):
<bean id="myController" singleton="false"
class="MyController">
<interceptor method="doSomething" class="MyInterceptorClass"/>
</bean>
Is there something in Spring I can use for this?
Thanks