提交 34d397ef 编写于 作者: J Juergen Hoeller

Restored original detectHandlerMethods call chain for backwards compatibility...

Restored original detectHandlerMethods call chain for backwards compatibility with custom subclasses (such as in Spring Integration)
上级 32e5f57e
......@@ -104,9 +104,8 @@ public abstract class AbstractHandlerMethodMapping<T> extends AbstractHandlerMap
getApplicationContext().getBeanNamesForType(Object.class));
for (String beanName : beanNames) {
Class<?> candidateType = getApplicationContext().getType(beanName);
if (isHandler(candidateType)){
detectHandlerMethods(beanName, candidateType);
if (isHandler(getApplicationContext().getType(beanName))){
detectHandlerMethods(beanName);
}
}
handlerMethodsInitialized(getHandlerMethods());
......@@ -121,20 +120,12 @@ public abstract class AbstractHandlerMethodMapping<T> extends AbstractHandlerMap
/**
* Look for handler methods in a handler.
* <p>Delegates to {@link #detectHandlerMethods(Object, Class)} for actual processing.
* @param handler the bean name of a handler or a handler instance
*/
protected void detectHandlerMethods(final Object handler) {
Class<?> handlerType =
(handler instanceof String ? getApplicationContext().getType((String) handler) : handler.getClass());
detectHandlerMethods(handler, handlerType);
}
/**
* Look for handler methods in a handler, against a pre-resolved type.
* @param handler the bean name of a handler or a handler instance
*/
protected void detectHandlerMethods(Object handler, Class<?> handlerType) {
final Class<?> userType = ClassUtils.getUserClass(handlerType);
Set<Method> methods = HandlerMethodSelector.selectMethods(userType, new MethodFilter() {
@Override
......@@ -342,9 +333,8 @@ public abstract class AbstractHandlerMethodMapping<T> extends AbstractHandlerMap
/**
* A thin wrapper around a matched HandlerMethod and its matched mapping for
* the purpose of comparing the best match with a comparator in the context
* of the current request.
* A thin wrapper around a matched HandlerMethod and its mapping, for the purpose of
* comparing the best match with a comparator in the context of the current request.
*/
private class Match {
......@@ -352,7 +342,7 @@ public abstract class AbstractHandlerMethodMapping<T> extends AbstractHandlerMap
private final HandlerMethod handlerMethod;
private Match(T mapping, HandlerMethod handlerMethod) {
public Match(T mapping, HandlerMethod handlerMethod) {
this.mapping = mapping;
this.handlerMethod = handlerMethod;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册