Removed ConfigurationException.

This commit is contained in:
Mark Fisher
2008-10-10 01:52:35 +00:00
parent b68f7ca17a
commit bdb4a866c8
6 changed files with 23 additions and 72 deletions

View File

@@ -1,35 +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;
/**
* Exception that indicates an incorrectly configured integration component.
*
* @author Mark Fisher
*/
@SuppressWarnings("serial")
public class ConfigurationException extends RuntimeException {
public ConfigurationException(String description) {
super(description);
}
public ConfigurationException(String description, Throwable cause) {
super(description, cause);
}
}

View File

@@ -36,7 +36,6 @@ 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.ConfigurationException;
import org.springframework.integration.channel.ChannelRegistryAware;
import org.springframework.integration.channel.MessageChannel;
import org.springframework.integration.channel.MessagePublishingErrorHandler;
@@ -81,10 +80,8 @@ public class DefaultMessageBus implements MessageBus, ApplicationContextAware, A
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
Assert.notNull(applicationContext, "'applicationContext' must not be null");
if (applicationContext.getBeanNamesForType(this.getClass()).length > 1) {
throw new ConfigurationException("Only one instance of '" + this.getClass().getSimpleName()
+ "' is allowed per ApplicationContext.");
}
Assert.state(!(applicationContext.getBeanNamesForType(this.getClass()).length > 1),
"Only one instance of '" + this.getClass().getSimpleName() + "' is allowed per ApplicationContext.");
this.applicationContext = applicationContext;
}