public class DoOperationManagedBean
{
private PrivateHelper privateHelper;
public DoOperationManagedBean() {
privateHelper = new PrivateHelper();
}
//Currently @Around is applied on the is method.
public void perform(List<SomeClass> list){
for(SomeClass sc: list) {
privateHelper.execute(sc);
}
}
private class PrivateHelper{
//want to apply @Around on this method
public void execute(SomeClass sc){
//Code to process sc.
}
}
}
我可以对Around
方法应用DoOperationManagedBean.perform
建议,因为DoOperationManagedBean
是Spring Managed Bean。
我需要将Around
建议应用于PrivateHelper.execute
方法。但由于我无法在private
之外实例化DoOperationManagedBean
类,因此我无法将其设为托管bean。
有没有办法在advice
上申请PrivateHelper.execute
?