In my new project, we need to program many existing projects to intercept some action method in order to add some extra work, mainly synchronize the modified data into another db. We just need an advice but tens of pointcut, maybe over 100, from different existing projects. I want to configure the action and method info in a xml file, and then apply them as pointcut through some way. The configuration info is like below, just temporary thought.
My question is that besides a customized advisor extending StaticMethodMatcherPointcutAdvisor and implementing the method match throung the way of , such as storing the action and method names in a List and determining by List.contains(), is there an other easy and efficient way ? Such as @aspectj and aspectj schema. At least I haven't found a good way, cause it's horrible to write a very long pointcut expression in the applicationContext.xml, there're too many methods and actions to write, and it's hard to read and maintain all these pointcut expression. It's better not to import other jar file beside spring library.
Now any method that is annotated with @MyAnnotation will match that pointcut expression. No more need of 100 pointcut expressions.
Here is my definition of that annotation
It works. If it doesn't need cglib and asm jar file it would be perfect. Our company' system is a little rigid, which means we can't easily add jar file to the existing web project. I'm very curious with that how webwork implements interceptor without cglib and asm. After all interceptor is same of aop.