Restore setDefaultChannel to MessagingTemplate
Synonym for the Spring setDefaultDestination for backward compatibility.
This commit is contained in:
@@ -18,6 +18,7 @@ package org.springframework.integration.core;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.factory.BeanFactory;
|
||||
import org.springframework.integration.support.channel.BeanFactoryChannelResolver;
|
||||
import org.springframework.messaging.MessageChannel;
|
||||
import org.springframework.messaging.core.GenericMessagingTemplate;
|
||||
|
||||
/**
|
||||
@@ -27,9 +28,21 @@ import org.springframework.messaging.core.GenericMessagingTemplate;
|
||||
*/
|
||||
public class MessagingTemplate extends GenericMessagingTemplate {
|
||||
|
||||
/**
|
||||
* Overridden to set the destination resolver to a {@link BeanFactoryChannelResolver}.
|
||||
*/
|
||||
@Override
|
||||
public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
|
||||
super.setDestinationResolver(new BeanFactoryChannelResolver(beanFactory));
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes {@link #setDefaultDestination(MessageChannel)} - provided for
|
||||
* backward compatibility.
|
||||
* @param channel the channel to set.
|
||||
*/
|
||||
public void setDefaultChannel(MessageChannel channel) {
|
||||
super.setDefaultDestination(channel);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -34,6 +34,8 @@ import org.springframework.util.Assert;
|
||||
* <p>Will lookup Spring managed beans identified by bean name,
|
||||
* expecting them to be of type {@link MessageChannel}.
|
||||
*
|
||||
* Consults a {@link HeaderChannelRegistry}, if available, if the bean is not found.
|
||||
*
|
||||
* @author Mark Fisher
|
||||
* @author Gary Russell
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user