INT-174 Added ConversionService support for routers.

This commit is contained in:
Mark Fisher
2010-03-11 22:51:49 +00:00
parent 71c4f264c5
commit 396b4e45b3
2 changed files with 11 additions and 2 deletions

View File

@@ -63,7 +63,7 @@ public abstract class AbstractChannelNameResolvingMessageRouter extends Abstract
} }
@Override @Override
public final void onInit() { public void onInit() {
Assert.notNull(this.getChannelResolver(), Assert.notNull(this.getChannelResolver(),
"either a ChannelResolver or BeanFactory is required"); "either a ChannelResolver or BeanFactory is required");
} }

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2009 the original author or authors. * Copyright 2002-2010 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.springframework.integration.core.Message; import org.springframework.integration.core.Message;
import org.springframework.integration.handler.AbstractMessageProcessor;
import org.springframework.integration.handler.MessageProcessor; import org.springframework.integration.handler.MessageProcessor;
import org.springframework.util.Assert; import org.springframework.util.Assert;
@@ -40,6 +41,14 @@ class AbstractMessageProcessingRouter extends AbstractChannelNameResolvingMessag
this.messageProcessor = messageProcessor; this.messageProcessor = messageProcessor;
} }
@Override
public final void onInit() {
super.onInit();
if (this.messageProcessor instanceof AbstractMessageProcessor) {
((AbstractMessageProcessor) this.messageProcessor).setConversionService(this.getConversionService());
}
}
@Override @Override
protected List<Object> getChannelIndicatorList(Message<?> message) { protected List<Object> getChannelIndicatorList(Message<?> message) {
Object result = this.messageProcessor.processMessage(message); Object result = this.messageProcessor.processMessage(message);