spring aop切面中获取代理bean的名字以及bean

434 阅读1分钟
//切面中搞:
Map<String , Object> map = (Map)ApplicationContextHelper.getBean(proceedingJoinPoint.getTarget().getClass());
ExcelDistributedReadIntf intf = null;
String beanid = "";
for (String key : map.keySet()) {
    beanid = key;
    intf = (ExcelDistributedReadIntf)map.get(key);
}