I have a service interface that has a method that looks like the following:
My Spring application context xml configuration file looks partially like:Code:package com.foo.svcs; public interface FooService { @PreAuthorize("ROLE_USER") @com.foo.svcs.CustomAnnotation public void doSomething(); }
I've found that when using the @annotation pointcut, my advice is not executed (even when removing the execution clause). However, if I do pointcut="bean(foo)" then my advice is executed. I am wondering if the proxies that are being created for the PrePost Spring Security annotation support are "hiding" my custom annotation on the service. Is that what's happening here, or is something else wrong?HTML Code:<bean id="foo" class="com.foo.svcs.FooServiceImpl" /> <sec:global-method-security pre-post-annotations="enabled" access-decision-manager-ref="serviceAccessDecisionManager"> <sec:expression-handler ref="expressionHandler"/> </sec:global-method-security> <aop:config> <aop:advisor pointcut="execution(* com.foo.svcs.*.*(..)) and @annotation(com.foo.svcs.CustomAnnotation)" advice-ref="aceCreator" /> </aop:config>


Reply With Quote
