From 787307bb0c66313d28c66fb34faef9ed52f7828a Mon Sep 17 00:00:00 2001 From: Mark Fisher Date: Sun, 16 Dec 2007 18:29:06 +0000 Subject: [PATCH] refactored common logic into abstract base class for annotation-based handler creators --- .../DefaultAnnotationHandlerCreator.java | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/annotation/DefaultAnnotationHandlerCreator.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/annotation/DefaultAnnotationHandlerCreator.java index a921fbb0b5..b4b3551135 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/annotation/DefaultAnnotationHandlerCreator.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/annotation/DefaultAnnotationHandlerCreator.java @@ -19,7 +19,6 @@ package org.springframework.integration.handler.annotation; import java.lang.annotation.Annotation; import java.lang.reflect.Method; -import org.springframework.core.annotation.AnnotationUtils; import org.springframework.core.annotation.Order; import org.springframework.integration.handler.MessageHandler; import org.springframework.integration.handler.DefaultMessageHandlerAdapter; @@ -32,18 +31,10 @@ import org.springframework.integration.handler.DefaultMessageHandlerAdapter; * * @author Mark Fisher */ -public class DefaultAnnotationHandlerCreator implements AnnotationHandlerCreator { +public class DefaultAnnotationHandlerCreator extends AbstractAnnotationHandlerCreator { - public MessageHandler createHandler(Object object, Method method, Annotation annotation) { - DefaultMessageHandlerAdapter adapter = new DefaultMessageHandlerAdapter(); - adapter.setObject(object); - adapter.setMethod(method.getName()); - Order orderAnnotation = (Order) AnnotationUtils.getAnnotation(method, Order.class); - if (orderAnnotation != null) { - adapter.setOrder(orderAnnotation.value()); - } - adapter.afterPropertiesSet(); - return adapter; + public MessageHandler doCreateHandler(Object object, Method method, Annotation annotation) { + return new DefaultMessageHandlerAdapter(); } }