if (s != null)
{
scope = ScopeUtil.parse(s);
if (scope == null) throw new RuntimeException("Illegal scope attribute value: " + s);
}
AspectDefinition def = manager.getAspectDefinition(name);
// if interceptor definition already exists, then just check to see if scopes are the same
// todo deprecate <interceptor> within an advice stack
if (def != null)
{
if (scope == null) scope = Scope.PER_VM;
if (scope != def.getScope()) throw new RuntimeException("multiple definitions of <interceptor> " + name + " with different scopes is illegal");
}
else
{
AspectFactory aspectFactory;
if (clazz != null)
{
aspectFactory = new GenericAspectFactory(clazz, element);
((AspectFactoryWithClassLoader)aspectFactory).setClassLoader(cl);
}
else
{
aspectFactory = new AspectFactoryDelegator(factory1, element);
((AspectFactoryWithClassLoader)aspectFactory).setClassLoader(cl);
}
def = new AspectDefinition(name, scope, aspectFactory);
manager.addAspectDefinition(def);
}
InterceptorFactory factory = manager.getInterceptorFactory(name);
if (factory == null)
{