From fc51ac521609e0a1a3168f0a0bb707e60dbd28ee Mon Sep 17 00:00:00 2001 From: Mark Fisher Date: Thu, 2 Jul 2009 23:05:59 +0000 Subject: [PATCH] Removed unused fields and methods. --- .../dispatcher/AbstractDispatcher.java | 26 ++++--------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/org.springframework.integration/src/main/java/org/springframework/integration/dispatcher/AbstractDispatcher.java b/org.springframework.integration/src/main/java/org/springframework/integration/dispatcher/AbstractDispatcher.java index 3a961aea5d..f898f24174 100644 --- a/org.springframework.integration/src/main/java/org/springframework/integration/dispatcher/AbstractDispatcher.java +++ b/org.springframework.integration/src/main/java/org/springframework/integration/dispatcher/AbstractDispatcher.java @@ -25,12 +25,12 @@ import java.util.Set; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.core.OrderComparator; -import org.springframework.core.Ordered; import org.springframework.core.task.TaskExecutor; import org.springframework.integration.core.Message; import org.springframework.integration.message.MessageHandler; import org.springframework.integration.message.MessageRejectedException; import org.springframework.util.Assert; +import org.springframework.util.StringUtils; /** * Base class for {@link MessageDispatcher} implementations. @@ -51,26 +51,13 @@ public abstract class AbstractDispatcher implements MessageDispatcher { protected final Log logger = LogFactory.getLog(this.getClass()); - private volatile Set handlers = new OrderedAwareLinkedHashSet(); - - @SuppressWarnings("unchecked") - private volatile Comparator comparator = new OrderComparator(); + private final Set handlers = new OrderedAwareLinkedHashSet(); private volatile TaskExecutor taskExecutor; private final Object handlerListMonitor = new Object(); - /** - * Provide a {@link Comparator} that will determine the sorting order of - * the handler list. If no comparator is configured, the default will be - * an instance of {@link OrderComparator}. - */ - public void setComparator(Comparator comparator) { - Assert.notNull(comparator, "comparator must not be null"); - this.comparator = comparator; - } - /** * Specify a {@link TaskExecutor} for invoking the handlers. If none is * provided, the invocation will occur in the thread that runs this polling @@ -84,6 +71,7 @@ public abstract class AbstractDispatcher implements MessageDispatcher { return this.taskExecutor; } + @SuppressWarnings("unchecked") protected List getHandlers() { return Collections.unmodifiableList(new ArrayList(this.handlers)); } @@ -98,13 +86,9 @@ public abstract class AbstractDispatcher implements MessageDispatcher { } } - private boolean hasOrder(MessageHandler handler) { - return handler instanceof Ordered - && ((Ordered) handler).getOrder() < Ordered.LOWEST_PRECEDENCE; - } - public String toString() { - return this.getClass().getSimpleName() + " with handlers: " + this.handlers; + String handlerList = StringUtils.collectionToCommaDelimitedString(this.handlers); + return this.getClass().getSimpleName() + " with handlers: " + handlerList; } /**