第一种解决方案:
@Autowired
ApplicationContext applicationContext;
FridayService bean = applicationContext.getBean(FridayService.class);
通过ApplicationContext获取本类代理对象,然后使用代理对象调用本类的方法。
第二种方案:
AopContext.currentProxy()
通过切面获取代理对象
第一种解决方案:
@Autowired
ApplicationContext applicationContext;
FridayService bean = applicationContext.getBean(FridayService.class);
通过ApplicationContext获取本类代理对象,然后使用代理对象调用本类的方法。
第二种方案:
AopContext.currentProxy()
通过切面获取代理对象