Annotation equivalent of <aop:scoped-proxy/> ?
I'm kind of new to AOP, and have been trying to figure out the annotation equivalent of the xml bean option <aop:scoped-proxy />.
I've looked around, and the closest I've been able to find is the following:
@Scope( value= "request", proxyMode=ScopedProxyMode.INTERFACES )
Whereas that seems very similar, I'm not suer if it is exactly the same or. In the xml option, not specifying the proxy-target-class, by default it does not proxy the target class directly. If true, then it a JDK proxy is created for interfaces and CGLIB proxy for any other class.
According to the docs of ScopedProxyMode, INTERFACES creates a JDK proxy for all interfaces, and TARGET_CLASS forces CGLIB proxy. Does that mean that INTERFACES is the equiavlent of proxy-target-class=false, and TARGET_CLASS is the same as proxy-target-class=true?
The other question, is in XML, if I specify <aop:scoped-proxy />, I can control the proxy'ing for all my scoped-proxy'ed beans with:
<bean class="org.springframework.aop.framework.autoproxy .DefaultAdvisorAutoProxyCreator" scope="singleton">
<property name="proxyTargetClass" value="false"/>
<property name="usePrefix" value="true" />
<property name="beanName" value="advisor" />
Does the same still hold true when using annotations? If I specify TARGET_CLASS or INTERFACES, does the above Advisor override that proxy definition?