}
} else {
//method level bindings
//first find the right method
final NamedMethodMetaData methodData = binding.getMethod();
final ClassReflectionIndex<?> classIndex = index.getClassIndex(componentClass);
Method resolvedMethod = null;
if (methodData.getMethodParams() == null) {
final Collection<Method> methods = classIndex.getAllMethods(methodData.getMethodName());
if (methods.isEmpty()) {
throw MESSAGES.failToFindMethodInEjbJarXml(componentClass.getName(),methodData.getMethodName());
} else if (methods.size() > 1) {
throw MESSAGES.multipleMethodReferencedInEjbJarXml(methodData.getMethodName(),componentClass.getName());
}
resolvedMethod = methods.iterator().next();
} else {
final Collection<Method> methods = classIndex.getAllMethods(methodData.getMethodName(), methodData.getMethodParams().size());
for (final Method method : methods) {
boolean match = true;
for (int i = 0; i < method.getParameterTypes().length; ++i) {
if (!method.getParameterTypes()[i].getName().equals(methodData.getMethodParams().get(i))) {
match = false;
break;
}
}
if (match) {
resolvedMethod = method;
break;
}
}
if (resolvedMethod == null) {
throw MESSAGES.failToFindMethodWithParameterTypes(componentClass.getName(), methodData.getMethodName(), methodData.getMethodParams());
}
}
List<InterceptorBindingMetaData> list = methodInterceptors.get(resolvedMethod);
if (list == null) {
methodInterceptors.put(resolvedMethod, list = new ArrayList<InterceptorBindingMetaData>());