ApiMethod sourceMethod,
ApiClass sourceClass)
throws ConfigException
{
ApiMethod method = null;
ApiClass beanClass = getEJBClassWrapper();
method = getMethod(beanClass, methodName, param);
if (method == null && sourceMethod != null) {
throw error(L.l("{0}: '{1}' expected to match {2}.{3}",
beanClass.getName(),
getFullMethodName(methodName, param),
sourceMethod.getDeclaringClass().getSimpleName(),
getFullMethodName(sourceMethod)));
}
else if (method == null) {
throw error(L.l("{0}: '{1}' expected",
beanClass.getName(),
getFullMethodName(methodName, param)));
}
/*
else if (Modifier.isAbstract(method.getModifiers()) &&
getBeanManagedPersistence()) {
throw error(L.l("{0}: '{1}' must not be abstract",
beanClass.getName(),
getFullMethodName(methodName, param)));
}
*/
else if (! method.isPublic()) {
throw error(L.l("{0}: '{1}' must be public",
beanClass.getName(),
getFullMethodName(methodName, param)));
}
if (method.isStatic()) {
throw error(L.l("{0}: '{1}' must not be static",
beanClass.getName(),
getFullMethodName(methodName, param)));
}
if (method.isFinal()) {
throw error(L.l("{0}: '{1}' must not be final.",
beanClass.getName(),
getFullMethodName(methodName, param),
beanClass.getName()));
}
return method;
}