This thread is related to the problem that I am facing here regarding the need for access to the protected methods of the recommended class . I am using Spring 3.0.6 and have created a Spring profiling aspect that I apply to a significant number of beans using the JDK proxy.
However, due to the need to access protected methods in one specific bean, I would like to recommend it using CGLIB. All other beans I would like to continue to use JDK Proxies.
I use a combination of annotations and xml configuration, but this particular aspect is defined in the XML configuration.
I know that there is a <aop:scoped-proxy>
, but from what I can say, it applies to all aspects.
Is there any way to determine for one aspect the use of CGLIB instead?
<aop:config> <aop:aspect id="Profiler" ref="lendingSimulationServiceProfilerInterceptor"> <aop:around method="infoProfiler" pointcut="execution(* com.cws.cs.lendingsimulationservice.service.LendingSimulationServiceImpl.calculate*(..))" /> <aop:around method="infoProfiler" pointcut="execution(* com.cws.cs.lendingsimulationservice.process.LendingSimulationProcessImpl.calculate(..))" /> <aop:around method="infoProfiler" pointcut="execution(* com.blaze.BlazeEngine.invokeService(..))" /> <aop:around method="traceProfiler" pointcut="execution(* com.calculator.dao.impl.LendingSimulationDaoImpl.*(..))" /> <aop:around method="traceProfiler" pointcut="execution(* com.cws.cs.lendingsimulationservice.util.pool.JAXBPoolImpl.*(..))" /> </aop:aspect> </aop:config>
I tried to split the configuration into two parts, and for one configuration specify target-class="true"
and another target-class="false"
, but it seems that CGLIB will apply to everyone at this point.
Is there any way to do this?
Thanks,
Eric
source share