util.setAspectManagerProperty(binding, "manager");
result.add(binding);
if (interceptors.size() > 0)
{
AbstractListMetaData almd = new AbstractListMetaData();
int i = 0;
for (BaseInterceptorData interceptor : interceptors)
{
AbstractBeanMetaData bmd = new AbstractBeanMetaData(interceptor.getBeanClassName());
String intName = name + "$" + i++;
bmd.setName(intName);
util.setAspectManagerProperty(bmd, "manager");
BeanMetaDataUtil.DependencyBuilder builder = new BeanMetaDataUtil.DependencyBuilder(bmd, "binding", name).setState("Instantiated");
BeanMetaDataUtil.setDependencyProperty(builder);
if (interceptor instanceof AdviceData)
{
BeanMetaDataUtil.DependencyBuilder db = new BeanMetaDataUtil.DependencyBuilder(bmd, "aspect", interceptor.getRefName());
BeanMetaDataUtil.setDependencyProperty(db);
if (((AdviceData)interceptor).getAdviceMethod() != null)
{
BeanMetaDataUtil.setSimpleProperty(bmd, "aspectMethod", ((AdviceData)interceptor).getAdviceMethod());
}
BeanMetaDataUtil.setSimpleProperty(bmd, "type", ((AdviceData)interceptor).getType());
}
else
{
BeanMetaDataUtil.DependencyBuilder db = new BeanMetaDataUtil.DependencyBuilder(bmd, "stack", interceptor.getRefName());
BeanMetaDataUtil.setDependencyProperty(db);
}
result.add(bmd);
almd.add(new AbstractInjectionValueMetaData(intName));
BeanMetaDataUtil.setSimpleProperty(binding, "advices", almd);
}
}
return result;