Removed the MessageBus interface. The ApplicationContextMessageBus now implements Lifecycle directly. The MessageEndpoint interface had no additional methods after the removal of registerEndpoint().

This commit is contained in:
Mark Fisher
2008-10-31 23:44:22 +00:00
parent dae343a07f
commit 898f67aec2
8 changed files with 19 additions and 47 deletions

View File

@@ -50,7 +50,7 @@ import org.springframework.util.Assert;
* @author Mark Fisher
* @author Marius Bogoevici
*/
public class ApplicationContextMessageBus implements MessageBus, ChannelResolver, ApplicationContextAware, ApplicationListener, DisposableBean {
public class ApplicationContextMessageBus implements Lifecycle, ChannelResolver, ApplicationContextAware, ApplicationListener, DisposableBean {
public static final String ERROR_CHANNEL_BEAN_NAME = "errorChannel";

View File

@@ -1,28 +0,0 @@
/*
* Copyright 2002-2008 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.integration.bus;
import org.springframework.context.Lifecycle;
/**
* The message bus interface.
*
* @author Mark Fisher
*/
public interface MessageBus extends Lifecycle {
}

View File

@@ -34,7 +34,6 @@ import org.springframework.context.event.SimpleApplicationEventMulticaster;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.core.task.TaskExecutor;
import org.springframework.integration.bus.ApplicationContextMessageBus;
import org.springframework.integration.bus.MessageBus;
import org.springframework.integration.channel.MessagePublishingErrorHandler;
import org.springframework.integration.channel.QueueChannel;
import org.springframework.integration.config.annotation.MessagingAnnotationPostProcessor;
@@ -68,7 +67,7 @@ public class MessageBusParser extends AbstractSimpleBeanDefinitionParser {
protected String resolveId(Element element, AbstractBeanDefinition definition, ParserContext parserContext)
throws BeanDefinitionStoreException {
Assert.state(!parserContext.getRegistry().containsBeanDefinition(MESSAGE_BUS_BEAN_NAME),
"Only one instance of '" + MessageBus.class.getSimpleName() + "' is allowed per ApplicationContext.");
"Only one Message Bus is allowed per ApplicationContext.");
return MESSAGE_BUS_BEAN_NAME;
}