Removed 'getErrorChannel' method from MessageBus.

This commit is contained in:
Mark Fisher
2008-10-11 17:27:07 +00:00
parent 5a536586e1
commit f143ae5857
3 changed files with 9 additions and 10 deletions

View File

@@ -35,6 +35,7 @@ import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.context.Lifecycle;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.integration.channel.ChannelRegistry;
import org.springframework.integration.channel.ChannelRegistryAware;
import org.springframework.integration.channel.MessageChannel;
import org.springframework.integration.channel.MessagePublishingErrorHandler;
@@ -118,10 +119,6 @@ public class DefaultMessageBus implements MessageBus, ApplicationContextAware, A
}
}
public MessageChannel getErrorChannel() {
return this.lookupChannel(ERROR_CHANNEL_NAME);
}
public MessageChannel lookupChannel(String channelName) {
Assert.notNull(this.applicationContext, "ApplicationContext must not be null");
if (this.applicationContext.containsBean(channelName)) {
@@ -239,7 +236,8 @@ public class DefaultMessageBus implements MessageBus, ApplicationContextAware, A
gateway.start();
}
if (this.taskScheduler instanceof SimpleTaskScheduler) {
((SimpleTaskScheduler) this.taskScheduler).setErrorHandler(new MessagePublishingErrorHandler(this.getErrorChannel()));
((SimpleTaskScheduler) this.taskScheduler).setErrorHandler(
new MessagePublishingErrorHandler(this.lookupChannel(ChannelRegistry.ERROR_CHANNEL_NAME)));
}
this.taskScheduler.start();
}

View File

@@ -18,7 +18,6 @@ package org.springframework.integration.bus;
import org.springframework.context.Lifecycle;
import org.springframework.integration.channel.ChannelRegistry;
import org.springframework.integration.channel.MessageChannel;
import org.springframework.integration.endpoint.MessageEndpoint;
/**
@@ -28,8 +27,6 @@ import org.springframework.integration.endpoint.MessageEndpoint;
*/
public interface MessageBus extends ChannelRegistry, Lifecycle {
MessageChannel getErrorChannel();
void registerEndpoint(MessageEndpoint endpoint);
}