{
Element interceptorElement = (Element) children2.item(j);
String tag2 = interceptorElement.getTagName();
if (tag2.equals("interceptor"))
{
InterceptorFactory factory = deployInterceptor(interceptorElement);
interceptors.add(factory);
}
else if (tag2.equals("interceptor-ref"))
{
String iname = interceptorElement.getAttribute("name");
if (iname == null) throw new RuntimeException("interceptor-ref has null name attribute");
InterceptorFactory factory = manager.getInterceptorFactory(iname);
if (factory == null) throw new RuntimeException("unable to resolve interceptor-ref: " + iname);
interceptors.add(factory);
}
else if (tag2.equals("stack-ref"))
{
String name = interceptorElement.getAttribute("name");
AdviceStack stack = manager.getAdviceStack(name);
if (stack == null) throw new Exception("there is no <stack> defined for name: " + name);
interceptors.addAll(stack.getInterceptorFactories());
}
else if (tag2.equals("advice") || tag2.equals("before") || tag2.equals("after") || tag2.equals("throwing"))
{
InterceptorFactory factory = deployAdvice(interceptorElement);
interceptors.add(factory);
}
}
}
return interceptors;