INT-682, added no-arg method support for handlers, removed assertion for no-arg handler methods in HandlerMethodUtils and StaticHandlerMethodResolver, fixed test cases

This commit is contained in:
Oleg Zhurakousky
2009-06-25 02:32:34 +00:00
parent b6d2f17e2b
commit 42723d0918
5 changed files with 11 additions and 11 deletions

View File

@@ -30,6 +30,7 @@ import org.springframework.integration.annotation.Headers;
* Utility methods for common behavior related to Message-handling methods.
*
* @author Mark Fisher
* @author Oleg Zhurakousky
*/
abstract class HandlerMethodUtils {
@@ -47,9 +48,6 @@ abstract class HandlerMethodUtils {
return false;
}
Class<?>[] parameterTypes = method.getParameterTypes();
if (parameterTypes.length == 0) {
return false;
}
if (parameterTypes.length > 1) {
// at most one parameter can be lacking @Header or @Headers
boolean foundPayloadParam = false;

View File

@@ -27,6 +27,7 @@ import org.springframework.util.Assert;
* or otherwise resolvable in advance based on static metadata.
*
* @author Mark Fisher
* @author Oleg Zhurakousky
*/
public class StaticHandlerMethodResolver implements HandlerMethodResolver {
@@ -35,8 +36,6 @@ public class StaticHandlerMethodResolver implements HandlerMethodResolver {
public StaticHandlerMethodResolver(Method method) {
Assert.notNull(method, "method must not be null");
Assert.notEmpty(method.getParameterTypes(),
"Message-handling method [" + method + "] must accept at least one parameter.");
Assert.isTrue(HandlerMethodUtils.isValidHandlerMethod(method),
"Invalid Message-handling method [" + method + "]");
this.method = method;