Injecting dependencies to AspectJ aspects | programming addicted
However, if we want to use AspectJ weaving in a Spring-based application we often need to configure AspectJ aspects, i.e. inject necessary dependencies to them. I'm going to talk about that here.Let's define a simple test-case that illustrates the problem. Suppose, we have a 'retry' aspect that intercepts particular remote method calls and retries them if necessary. We want to restrict number of retry attempts, i.e. configure that parameter via spring (this is a real-life use-case - I encountered that standard RMI calls sometimes fail with ambiguous I/O exception under SunOS without any clear reason and such an aspect really helped to get the application working).
Read full article from Injecting dependencies to AspectJ aspects | programming addicted
No comments:
Post a Comment