diff --git a/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/AbstractRemotingTargetAdapter.java b/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/AbstractRemotingTargetAdapter.java index dbfc0a0f6d..70c38a03fd 100644 --- a/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/AbstractRemotingTargetAdapter.java +++ b/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/AbstractRemotingTargetAdapter.java @@ -50,7 +50,7 @@ public abstract class AbstractRemotingTargetAdapter implements MessageHandler { return this.handlerProxy.handle(message); } catch (RemoteAccessException e) { - throw new MessageHandlingException("unable to handle message remotely", e); + throw new MessageHandlingException(message, "unable to handle message remotely", e); } } diff --git a/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/MessageHandlingSourceAdapter.java b/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/MessageHandlingSourceAdapter.java index 160d57eb5c..a938bbf069 100644 --- a/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/MessageHandlingSourceAdapter.java +++ b/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/MessageHandlingSourceAdapter.java @@ -20,7 +20,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.InitializingBean; -import org.springframework.integration.MessagingConfigurationException; +import org.springframework.integration.ConfigurationException; import org.springframework.integration.channel.MessageChannel; import org.springframework.integration.channel.RequestReplyTemplate; import org.springframework.integration.handler.MessageHandler; @@ -100,7 +100,7 @@ public class MessageHandlingSourceAdapter implements SourceAdapter, MessageHandl public final void afterPropertiesSet() throws Exception { if (this.channel == null) { - throw new MessagingConfigurationException("The 'channel' property of '" + this.getClass().getName() + throw new ConfigurationException("The 'channel' property of '" + this.getClass().getName() + "' must not be null."); } synchronized (this.lifecycleMonitor) { @@ -134,7 +134,7 @@ public class MessageHandlingSourceAdapter implements SourceAdapter, MessageHandl this.afterPropertiesSet(); } catch (Exception e) { - throw new MessagingConfigurationException("unable to initialize " + this.getClass().getName(), e); + throw new ConfigurationException("unable to initialize " + this.getClass().getName(), e); } } if (!this.expectReply) { diff --git a/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/MessageMappingException.java b/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/MessageMappingException.java index ae3022b09a..5656647782 100644 --- a/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/MessageMappingException.java +++ b/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/MessageMappingException.java @@ -31,8 +31,8 @@ public class MessageMappingException extends MessageHandlingException { super(failedMessage, description); } - public MessageMappingException(String description, Throwable cause) { - super(description, cause); + public MessageMappingException(Message failedMessage, String description, Throwable cause) { + super(failedMessage, description, cause); } } diff --git a/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/config/AbstractRequestReplySourceAdapterParser.java b/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/config/AbstractRequestReplySourceAdapterParser.java index 741f84f484..f98d3553f4 100644 --- a/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/config/AbstractRequestReplySourceAdapterParser.java +++ b/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/config/AbstractRequestReplySourceAdapterParser.java @@ -23,7 +23,7 @@ import org.springframework.beans.factory.support.AbstractBeanDefinition; import org.springframework.beans.factory.support.BeanDefinitionBuilder; import org.springframework.beans.factory.xml.AbstractSimpleBeanDefinitionParser; import org.springframework.beans.factory.xml.ParserContext; -import org.springframework.integration.MessagingConfigurationException; +import org.springframework.integration.ConfigurationException; import org.springframework.util.StringUtils; /** @@ -57,7 +57,7 @@ public abstract class AbstractRequestReplySourceAdapterParser extends AbstractSi protected void postProcess(BeanDefinitionBuilder builder, Element element) { String channelRef = element.getAttribute("channel"); if (!StringUtils.hasText(channelRef)) { - throw new MessagingConfigurationException("a 'channel' reference is required"); + throw new ConfigurationException("a 'channel' reference is required"); } builder.addPropertyReference("channel", channelRef); builder.addPropertyValue("expectReply", element.getAttribute("expect-reply").equals("true")); diff --git a/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/file/AbstractFileMapper.java b/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/file/AbstractFileMapper.java index bad06e5111..e04d836752 100644 --- a/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/file/AbstractFileMapper.java +++ b/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/file/AbstractFileMapper.java @@ -27,6 +27,7 @@ import org.springframework.integration.message.AbstractMessageMapper; import org.springframework.integration.message.GenericMessage; import org.springframework.integration.message.Message; import org.springframework.integration.message.MessageHandlingException; +import org.springframework.integration.message.MessagingException; import org.springframework.util.Assert; import org.springframework.util.FileCopyUtils; @@ -66,7 +67,7 @@ public abstract class AbstractFileMapper extends AbstractMessageMapper extends AbstractMessageMapper { files = this.directory.listFiles(); } if (files == null) { - throw new MessageHandlingException("Problem occurred while polling for files. " + + throw new MessagingException("Problem occurred while polling for files. " + "Is '" + directory.getAbsolutePath() + "' a directory?"); } List results = new ArrayList(); diff --git a/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/ftp/FtpSourceAdapter.java b/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/ftp/FtpSourceAdapter.java index cde6a2f789..25088a1cf0 100644 --- a/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/ftp/FtpSourceAdapter.java +++ b/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/ftp/FtpSourceAdapter.java @@ -33,7 +33,7 @@ import org.springframework.integration.adapter.PollableSource; import org.springframework.integration.adapter.PollingSourceAdapter; import org.springframework.integration.adapter.file.ByteArrayFileMapper; import org.springframework.integration.adapter.file.TextFileMapper; -import org.springframework.integration.message.MessageHandlingException; +import org.springframework.integration.message.MessagingException; import org.springframework.util.Assert; import org.springframework.util.StringUtils; @@ -129,10 +129,10 @@ public class FtpSourceAdapter extends PollingSourceAdapter implements Poll LinkedList localFileList = new LinkedList(); this.client.connect(this.host, this.port); if (!StringUtils.hasText(this.username)) { - throw new MessageHandlingException("username is required"); + throw new MessagingException("username is required"); } if (!this.client.login(this.username, this.password)) { - throw new MessageHandlingException("Login failed. Please check the username and password."); + throw new MessagingException("Login failed. Please check the username and password."); } if (logger.isDebugEnabled()) { logger.debug("login successful"); @@ -140,7 +140,7 @@ public class FtpSourceAdapter extends PollingSourceAdapter implements Poll this.client.setFileType(FTP.IMAGE_FILE_TYPE); if (!this.remoteWorkingDirectory.equals(this.client.printWorkingDirectory()) && !this.client.changeWorkingDirectory(this.remoteWorkingDirectory)) { - throw new MessageHandlingException("Could not change directory to '" + + throw new MessagingException("Could not change directory to '" + remoteWorkingDirectory + "'. Please check the path."); } if (logger.isDebugEnabled()) { @@ -176,9 +176,9 @@ public class FtpSourceAdapter extends PollingSourceAdapter implements Poll } } catch (IOException ioe) { - throw new MessageHandlingException("Error when disconnecting from ftp.", ioe); + throw new MessagingException("Error when disconnecting from ftp.", ioe); } - throw new MessageHandlingException("Error while polling for messages.", e); + throw new MessagingException("Error while polling for messages.", e); } } diff --git a/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/httpinvoker/HttpInvokerSourceAdapter.java b/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/httpinvoker/HttpInvokerSourceAdapter.java index 51b0ad4bca..be0d776a51 100644 --- a/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/httpinvoker/HttpInvokerSourceAdapter.java +++ b/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/httpinvoker/HttpInvokerSourceAdapter.java @@ -25,7 +25,7 @@ import javax.servlet.http.HttpServletResponse; import org.springframework.integration.adapter.MessageHandlingSourceAdapter; import org.springframework.integration.channel.MessageChannel; import org.springframework.integration.handler.MessageHandler; -import org.springframework.integration.message.MessageHandlingException; +import org.springframework.integration.message.MessagingException; import org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter; import org.springframework.web.HttpRequestHandler; @@ -85,7 +85,7 @@ public class HttpInvokerSourceAdapter extends MessageHandlingSourceAdapter imple public void handleRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { if (this.exporter == null) { - throw new MessageHandlingException("adapter has not been initialized"); + throw new MessagingException("adapter has not been initialized"); } this.exporter.handleRequest(request, response); } diff --git a/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/httpinvoker/config/HttpInvokerTargetAdapterParser.java b/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/httpinvoker/config/HttpInvokerTargetAdapterParser.java index 3aab1af293..2ba7ca0791 100644 --- a/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/httpinvoker/config/HttpInvokerTargetAdapterParser.java +++ b/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/httpinvoker/config/HttpInvokerTargetAdapterParser.java @@ -23,7 +23,7 @@ import org.springframework.beans.factory.support.BeanDefinitionBuilder; import org.springframework.beans.factory.support.RootBeanDefinition; import org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser; import org.springframework.beans.factory.xml.ParserContext; -import org.springframework.integration.MessagingConfigurationException; +import org.springframework.integration.ConfigurationException; import org.springframework.integration.adapter.httpinvoker.HttpInvokerTargetAdapter; import org.springframework.integration.endpoint.DefaultMessageEndpoint; import org.springframework.integration.scheduling.Subscription; @@ -53,10 +53,10 @@ public class HttpInvokerTargetAdapterParser extends AbstractSingleBeanDefinition String channel = element.getAttribute("channel"); String url = element.getAttribute("url"); if (!StringUtils.hasText(channel)) { - throw new MessagingConfigurationException("The 'channel' attribute is required."); + throw new ConfigurationException("The 'channel' attribute is required."); } if (!StringUtils.hasText(url)) { - throw new MessagingConfigurationException("The 'url' attribute is required."); + throw new ConfigurationException("The 'url' attribute is required."); } adapterDef.getConstructorArgumentValues().addGenericArgumentValue(url); String adapterBeanName = parserContext.getReaderContext().generateBeanName(adapterDef); diff --git a/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/jms/AbstractJmsTemplateBasedAdapter.java b/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/jms/AbstractJmsTemplateBasedAdapter.java index cdaeae3bde..cb2685c58a 100644 --- a/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/jms/AbstractJmsTemplateBasedAdapter.java +++ b/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/jms/AbstractJmsTemplateBasedAdapter.java @@ -20,7 +20,7 @@ import javax.jms.ConnectionFactory; import javax.jms.Destination; import org.springframework.beans.factory.InitializingBean; -import org.springframework.integration.MessagingConfigurationException; +import org.springframework.integration.ConfigurationException; import org.springframework.integration.adapter.MessageHeaderMapper; import org.springframework.jms.core.JmsTemplate; import org.springframework.jms.support.converter.MessageConverter; @@ -105,7 +105,7 @@ public abstract class AbstractJmsTemplateBasedAdapter implements InitializingBea } if (this.jmsTemplate == null) { if (this.connectionFactory == null || (this.destination == null && this.destinationName == null)) { - throw new MessagingConfigurationException("Either a 'jmsTemplate' or " + + throw new ConfigurationException("Either a 'jmsTemplate' or " + "*both* 'connectionFactory' and 'destination' (or 'destination-name') are required."); } this.jmsTemplate = this.createDefaultJmsTemplate(); diff --git a/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/jms/ChannelPublishingJmsListener.java b/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/jms/ChannelPublishingJmsListener.java index 041a699326..3bb24ac4be 100644 --- a/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/jms/ChannelPublishingJmsListener.java +++ b/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/jms/ChannelPublishingJmsListener.java @@ -18,10 +18,10 @@ package org.springframework.integration.adapter.jms; import javax.jms.MessageListener; -import org.springframework.integration.MessagingConfigurationException; +import org.springframework.integration.ConfigurationException; import org.springframework.integration.channel.MessageChannel; import org.springframework.integration.message.Message; -import org.springframework.integration.message.MessageDeliveryException; +import org.springframework.integration.message.MessagingException; import org.springframework.jms.support.converter.MessageConverter; import org.springframework.util.Assert; @@ -54,7 +54,7 @@ public class ChannelPublishingJmsListener implements MessageListener { public void onMessage(javax.jms.Message jmsMessage) { if (this.channel == null) { - throw new MessagingConfigurationException("'channel' must not be null"); + throw new ConfigurationException("'channel' must not be null"); } try { Message messageToSend = (Message) this.converter.fromMessage(jmsMessage); @@ -66,7 +66,7 @@ public class ChannelPublishingJmsListener implements MessageListener { } } catch (Exception e) { - throw new MessageDeliveryException("failed to convert JMS Message", e); + throw new MessagingException("failed to convert and send JMS Message", e); } } diff --git a/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/jms/DefaultJmsHeaderMapper.java b/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/jms/DefaultJmsHeaderMapper.java index 422e8002df..1a326d7805 100644 --- a/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/jms/DefaultJmsHeaderMapper.java +++ b/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/jms/DefaultJmsHeaderMapper.java @@ -25,8 +25,8 @@ import javax.jms.Destination; import javax.jms.JMSException; import org.springframework.integration.adapter.MessageHeaderMapper; -import org.springframework.integration.adapter.MessageMappingException; import org.springframework.integration.message.MessageHeader; +import org.springframework.integration.message.MessagingException; import org.springframework.util.StringUtils; /** @@ -69,7 +69,7 @@ public class DefaultJmsHeaderMapper implements MessageHeaderMapper)) { - throw new MessageHandlingException("expected a '" + Message.class.getName() + + throw new MessagingException("expected a '" + Message.class.getName() + "', but received '" + object.getClass() + "'"); } Message message = (Message) object; diff --git a/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/jms/JmsMessageDrivenSourceAdapter.java b/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/jms/JmsMessageDrivenSourceAdapter.java index b9afa7671a..0d39397a30 100644 --- a/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/jms/JmsMessageDrivenSourceAdapter.java +++ b/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/jms/JmsMessageDrivenSourceAdapter.java @@ -23,7 +23,7 @@ import javax.jms.Session; import org.springframework.beans.factory.DisposableBean; import org.springframework.context.Lifecycle; import org.springframework.core.task.TaskExecutor; -import org.springframework.integration.MessagingConfigurationException; +import org.springframework.integration.ConfigurationException; import org.springframework.integration.adapter.AbstractSourceAdapter; import org.springframework.jms.listener.AbstractJmsListeningContainer; import org.springframework.jms.listener.DefaultMessageListenerContainer; @@ -113,7 +113,7 @@ public class JmsMessageDrivenSourceAdapter extends AbstractSourceAdapter private void initDefaultContainer() { if (this.connectionFactory == null || (this.destination == null && this.destinationName == null)) { - throw new MessagingConfigurationException("If a 'container' reference is not provided, then " + throw new ConfigurationException("If a 'container' reference is not provided, then " + "'connectionFactory' and 'destination' (or 'destinationName') are required."); } DefaultMessageListenerContainer dmlc = new DefaultMessageListenerContainer(); diff --git a/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/mail/ByteArrayMailMessageMapper.java b/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/mail/ByteArrayMailMessageMapper.java index 3ab0a524b8..8643cece9c 100644 --- a/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/mail/ByteArrayMailMessageMapper.java +++ b/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/mail/ByteArrayMailMessageMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. @@ -20,9 +20,9 @@ import javax.mail.MessagingException; import javax.mail.internet.MimeMessage; import org.springframework.core.io.ByteArrayResource; +import org.springframework.integration.adapter.MessageMappingException; import org.springframework.integration.message.AbstractMessageMapper; import org.springframework.integration.message.Message; -import org.springframework.integration.message.MessageHandlingException; import org.springframework.mail.MailMessage; import org.springframework.mail.javamail.JavaMailSender; import org.springframework.mail.javamail.MimeMailMessage; @@ -71,7 +71,7 @@ public class ByteArrayMailMessageMapper extends AbstractMessageMapper { } } catch (IOException e) { - throw new MessageDeliveryException("IO failure occurred in adapter", e); + throw new MessagingException("IO failure occurred in adapter", e); } } return results; diff --git a/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/stream/ByteStreamTargetAdapter.java b/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/stream/ByteStreamTargetAdapter.java index 8e87911e07..d19e1411f0 100644 --- a/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/stream/ByteStreamTargetAdapter.java +++ b/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/stream/ByteStreamTargetAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. @@ -21,7 +21,7 @@ import java.io.IOException; import java.io.OutputStream; import org.springframework.integration.adapter.AbstractTargetAdapter; -import org.springframework.integration.message.MessageHandlingException; +import org.springframework.integration.message.MessagingException; /** * A target adapter that writes a byte array to an {@link OutputStream}. @@ -63,14 +63,14 @@ public class ByteStreamTargetAdapter extends AbstractTargetAdapter { this.stream.write((byte[]) object); } else { - throw new MessageHandlingException(this.getClass().getSimpleName() + + throw new MessagingException(this.getClass().getSimpleName() + " only supports byte array and String-based messages"); } this.stream.flush(); return true; } catch (IOException e) { - throw new MessageHandlingException("IO failure occurred in adapter", e); + throw new MessagingException("IO failure occurred in adapter", e); } } diff --git a/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/stream/CharacterStreamSource.java b/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/stream/CharacterStreamSource.java index c09621112e..5c66130cf8 100644 --- a/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/stream/CharacterStreamSource.java +++ b/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/stream/CharacterStreamSource.java @@ -24,7 +24,7 @@ import java.util.Collection; import java.util.List; import org.springframework.integration.adapter.PollableSource; -import org.springframework.integration.message.MessageDeliveryException; +import org.springframework.integration.message.MessagingException; import org.springframework.util.Assert; /** @@ -76,7 +76,7 @@ public class CharacterStreamSource implements PollableSource { results.add(line); } catch (IOException e) { - throw new MessageDeliveryException("IO failure occurred in adapter", e); + throw new MessagingException("IO failure occurred in adapter", e); } } return results; diff --git a/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/stream/CharacterStreamTargetAdapter.java b/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/stream/CharacterStreamTargetAdapter.java index 45ed087487..615fac0b3a 100644 --- a/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/stream/CharacterStreamTargetAdapter.java +++ b/spring-integration-adapters/src/main/java/org/springframework/integration/adapter/stream/CharacterStreamTargetAdapter.java @@ -23,9 +23,9 @@ import java.io.OutputStreamWriter; import java.io.UnsupportedEncodingException; import java.io.Writer; -import org.springframework.integration.MessagingConfigurationException; +import org.springframework.integration.ConfigurationException; import org.springframework.integration.adapter.AbstractTargetAdapter; -import org.springframework.integration.message.MessageHandlingException; +import org.springframework.integration.message.MessagingException; import org.springframework.util.Assert; /** @@ -103,7 +103,7 @@ public class CharacterStreamTargetAdapter extends AbstractTargetAdapter { return new CharacterStreamTargetAdapter(new OutputStreamWriter(stream, charsetName)); } catch (UnsupportedEncodingException e) { - throw new MessagingConfigurationException("unsupported encoding: " + charsetName, e); + throw new ConfigurationException("unsupported encoding: " + charsetName, e); } } @@ -140,7 +140,7 @@ public class CharacterStreamTargetAdapter extends AbstractTargetAdapter { return true; } catch (IOException e) { - throw new MessageHandlingException("IO failure occurred in adapter", e); + throw new MessagingException("IO failure occurred in adapter", e); } } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/MessagingException.java b/spring-integration-core/src/main/java/org/springframework/integration/ConfigurationException.java similarity index 68% rename from spring-integration-core/src/main/java/org/springframework/integration/MessagingException.java rename to spring-integration-core/src/main/java/org/springframework/integration/ConfigurationException.java index e1ba2371b7..e22aa52f67 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/MessagingException.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/ConfigurationException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. @@ -17,22 +17,18 @@ package org.springframework.integration; /** - * The base exception for any failures within the messaging system. + * Exception that indicates an incorrectly configured integration component. * * @author Mark Fisher */ @SuppressWarnings("serial") -public class MessagingException extends RuntimeException { +public class ConfigurationException extends RuntimeException { - public MessagingException() { - super(); - } - - public MessagingException(String description) { + public ConfigurationException(String description) { super(description); } - public MessagingException(String description, Throwable cause) { + public ConfigurationException(String description, Throwable cause) { super(description, cause); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/MessagingConfigurationException.java b/spring-integration-core/src/main/java/org/springframework/integration/MessagingConfigurationException.java deleted file mode 100644 index b32efdb15b..0000000000 --- a/spring-integration-core/src/main/java/org/springframework/integration/MessagingConfigurationException.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2002-2007 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 messaging component. - * - * @author Mark Fisher - */ -@SuppressWarnings("serial") -public class MessagingConfigurationException extends MessagingException { - - public MessagingConfigurationException(String description) { - super(description); - } - - public MessagingConfigurationException(String description, Throwable cause) { - super(description, cause); - } - -} diff --git a/spring-integration-core/src/main/java/org/springframework/integration/adapter/AbstractSourceAdapter.java b/spring-integration-core/src/main/java/org/springframework/integration/adapter/AbstractSourceAdapter.java index 4f86a86624..ae633b3ef3 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/adapter/AbstractSourceAdapter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/adapter/AbstractSourceAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. @@ -20,7 +20,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.InitializingBean; -import org.springframework.integration.MessagingConfigurationException; +import org.springframework.integration.ConfigurationException; import org.springframework.integration.channel.MessageChannel; import org.springframework.integration.message.Message; import org.springframework.integration.message.MessageMapper; @@ -69,7 +69,7 @@ public abstract class AbstractSourceAdapter implements SourceAdapter, Initial public final void afterPropertiesSet() { if (this.channel == null) { - throw new MessagingConfigurationException("'channel' is required"); + throw new ConfigurationException("'channel' is required"); } this.initialize(); this.initialized = true; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/adapter/AbstractTargetAdapter.java b/spring-integration-core/src/main/java/org/springframework/integration/adapter/AbstractTargetAdapter.java index 2aaffa7ef3..7649a0ca93 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/adapter/AbstractTargetAdapter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/adapter/AbstractTargetAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/adapter/MethodInvokingSource.java b/spring-integration-core/src/main/java/org/springframework/integration/adapter/MethodInvokingSource.java index 3da57229da..660bdfde36 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/adapter/MethodInvokingSource.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/adapter/MethodInvokingSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. @@ -21,9 +21,9 @@ import java.util.Arrays; import java.util.Collection; import org.springframework.beans.factory.InitializingBean; -import org.springframework.integration.MessagingConfigurationException; +import org.springframework.integration.ConfigurationException; +import org.springframework.integration.handler.HandlerMethodInvoker; import org.springframework.integration.util.MethodValidator; -import org.springframework.integration.util.SimpleMethodInvoker; import org.springframework.util.Assert; /** @@ -38,7 +38,7 @@ public class MethodInvokingSource implements PollableSource, Initiali private String method; - private SimpleMethodInvoker invoker; + private HandlerMethodInvoker invoker; public void setObject(T object) { @@ -52,7 +52,7 @@ public class MethodInvokingSource implements PollableSource, Initiali } public void afterPropertiesSet() { - this.invoker = new SimpleMethodInvoker(this.object, this.method); + this.invoker = new HandlerMethodInvoker(this.object, this.method); this.invoker.setMethodValidator(new MessageReceivingMethodValidator()); } @@ -68,7 +68,7 @@ public class MethodInvokingSource implements PollableSource, Initiali public void validate(Method method) { if (method.getReturnType().equals(void.class)) { - throw new MessagingConfigurationException("MethodInvokingSource requires a non-void returning method."); + throw new ConfigurationException("MethodInvokingSource requires a non-void returning method."); } } } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/adapter/MethodInvokingTarget.java b/spring-integration-core/src/main/java/org/springframework/integration/adapter/MethodInvokingTarget.java index 73b76baa06..2e4d46f936 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/adapter/MethodInvokingTarget.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/adapter/MethodInvokingTarget.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. @@ -20,7 +20,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.InitializingBean; -import org.springframework.integration.util.SimpleMethodInvoker; +import org.springframework.integration.handler.HandlerMethodInvoker; import org.springframework.util.Assert; /** @@ -36,7 +36,7 @@ public class MethodInvokingTarget implements Target, InitializingBean private String method; - private SimpleMethodInvoker invoker; + private HandlerMethodInvoker invoker; private ArgumentListPreparer argumentListPreparer; @@ -56,7 +56,7 @@ public class MethodInvokingTarget implements Target, InitializingBean } public void afterPropertiesSet() { - this.invoker = new SimpleMethodInvoker(this.object, this.method); + this.invoker = new HandlerMethodInvoker(this.object, this.method); } public boolean send(Object object) { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/adapter/PollingSourceAdapter.java b/spring-integration-core/src/main/java/org/springframework/integration/adapter/PollingSourceAdapter.java index 75d861e44c..3eb2bff121 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/adapter/PollingSourceAdapter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/adapter/PollingSourceAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. @@ -20,10 +20,10 @@ import java.util.Collection; import java.util.concurrent.Executors; import org.springframework.context.Lifecycle; -import org.springframework.integration.MessagingConfigurationException; +import org.springframework.integration.ConfigurationException; import org.springframework.integration.channel.MessageChannel; -import org.springframework.integration.message.MessageHandlingException; import org.springframework.integration.message.MessageMapper; +import org.springframework.integration.message.MessagingException; import org.springframework.integration.scheduling.MessagingTask; import org.springframework.integration.scheduling.MessagingTaskScheduler; import org.springframework.integration.scheduling.MessagingTaskSchedulerAware; @@ -103,7 +103,7 @@ public class PollingSourceAdapter extends AbstractSourceAdapter implements @Override protected void initialize() { if (this.source == null) { - throw new MessagingConfigurationException("source must not be null"); + throw new ConfigurationException("source must not be null"); } } @@ -145,7 +145,7 @@ public class PollingSourceAdapter extends AbstractSourceAdapter implements Collection results = this.source.poll(limit); if (results != null) { if (results.size() > limit) { - throw new MessageHandlingException("source returned too many results, the limit is " + limit); + throw new MessagingException("source returned too many results, the limit is " + limit); } for (T next : results) { if (this.sendToChannel(next)) { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/annotation/DefaultOutput.java b/spring-integration-core/src/main/java/org/springframework/integration/annotation/DefaultOutput.java index 9f4c605373..5548a099a5 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/annotation/DefaultOutput.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/annotation/DefaultOutput.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/bus/DefaultErrorChannel.java b/spring-integration-core/src/main/java/org/springframework/integration/bus/DefaultErrorChannel.java index 7144e60e2f..9f2da472ba 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/bus/DefaultErrorChannel.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/bus/DefaultErrorChannel.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/bus/MessageBus.java b/spring-integration-core/src/main/java/org/springframework/integration/bus/MessageBus.java index 31bc2c4ac6..64647d0fca 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/bus/MessageBus.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/bus/MessageBus.java @@ -32,7 +32,7 @@ import org.springframework.beans.BeansException; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; import org.springframework.context.Lifecycle; -import org.springframework.integration.MessagingConfigurationException; +import org.springframework.integration.ConfigurationException; import org.springframework.integration.adapter.SourceAdapter; import org.springframework.integration.channel.ChannelRegistry; import org.springframework.integration.channel.ChannelRegistryAware; @@ -103,7 +103,7 @@ public class MessageBus implements ChannelRegistry, EndpointRegistry, Applicatio public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { Assert.notNull(applicationContext, "'applicationContext' must not be null"); if (applicationContext.getBeanNamesForType(this.getClass()).length > 1) { - throw new MessagingConfigurationException("Only one instance of '" + this.getClass().getSimpleName() + throw new ConfigurationException("Only one instance of '" + this.getClass().getSimpleName() + "' is allowed per ApplicationContext."); } this.registerChannels(applicationContext); @@ -304,20 +304,20 @@ public class MessageBus implements ChannelRegistry, EndpointRegistry, Applicatio private void activateEndpoint(MessageEndpoint endpoint) { Subscription subscription = endpoint.getSubscription(); if (subscription == null) { - throw new MessagingConfigurationException("Unable to register endpoint '" + + throw new ConfigurationException("Unable to register endpoint '" + endpoint + "'. No subscription information is available."); } MessageChannel channel = subscription.getChannel(); if (channel == null) { String channelName = subscription.getChannelName(); if (channelName == null) { - throw new MessagingConfigurationException("endpoint '" + endpoint + + throw new ConfigurationException("endpoint '" + endpoint + "' must provide either 'channel' or 'channelName' in its subscription metadata"); } channel = this.lookupChannel(channelName); if (channel == null) { if (this.autoCreateChannels == false) { - throw new MessagingConfigurationException("Cannot activate subscription, unknown channel '" + channelName + + throw new ConfigurationException("Cannot activate subscription, unknown channel '" + channelName + "'. Consider enabling the 'autoCreateChannels' option for the message bus."); } if (this.logger.isInfoEnabled()) { @@ -332,7 +332,7 @@ public class MessageBus implements ChannelRegistry, EndpointRegistry, Applicatio String outputChannelName = dme.getDefaultOutputChannelName(); if (outputChannelName != null && this.lookupChannel(outputChannelName) == null) { if (!this.autoCreateChannels) { - throw new MessagingConfigurationException("Unknown channel '" + outputChannelName + + throw new ConfigurationException("Unknown channel '" + outputChannelName + "' configured as 'default-output' for endpoint '" + endpoint + "'. Consider enabling the 'autoCreateChannels' option for the message bus."); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/channel/AbstractMessageChannel.java b/spring-integration-core/src/main/java/org/springframework/integration/channel/AbstractMessageChannel.java index d86e4d5c1c..89afc6fbde 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/channel/AbstractMessageChannel.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/channel/AbstractMessageChannel.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. @@ -24,7 +24,6 @@ import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.BeanNameAware; import org.springframework.integration.message.Message; -import org.springframework.util.StringUtils; /** * Base class for {@link MessageChannel} implementations providing common @@ -109,7 +108,7 @@ public abstract class AbstractMessageChannel implements MessageChannel, BeanName * @return true if the message is sent successfully or * false if the sending thread is interrupted. */ - public final boolean send(Message message) { + public final boolean send(Message message) { return this.send(message, -1); } @@ -127,7 +126,7 @@ public abstract class AbstractMessageChannel implements MessageChannel, BeanName * false if the message cannot be sent within the allotted * time or the sending thread is interrupted. */ - public final boolean send(Message message, long timeout) { + public final boolean send(Message message, long timeout) { if (!this.interceptors.preSend(message, this)) { return false; } @@ -143,7 +142,7 @@ public abstract class AbstractMessageChannel implements MessageChannel, BeanName * @return the first available message or null if the * receiving thread is interrupted. */ - public final Message receive() { + public final Message receive() { return this.receive(-1); } @@ -160,11 +159,11 @@ public abstract class AbstractMessageChannel implements MessageChannel, BeanName * is available within the allotted time or the receiving thread is * interrupted. */ - public final Message receive(long timeout) { + public final Message receive(long timeout) { if (!this.interceptors.preReceive(this)) { return null; } - Message message = this.doReceive(timeout); + Message message = this.doReceive(timeout); this.interceptors.postReceive(message, this); return message; } @@ -212,7 +211,7 @@ public abstract class AbstractMessageChannel implements MessageChannel, BeanName return this.interceptors.add(interceptor); } - public boolean preSend(Message message, MessageChannel channel) { + public boolean preSend(Message message, MessageChannel channel) { if (logger.isDebugEnabled()) { logger.debug("preSend on channel '" + channel + "', message: " + message); } @@ -224,7 +223,7 @@ public abstract class AbstractMessageChannel implements MessageChannel, BeanName return true; } - public void postSend(Message message, MessageChannel channel, boolean sent) { + public void postSend(Message message, MessageChannel channel, boolean sent) { if (logger.isDebugEnabled()) { logger.debug("postSend (sent=" + sent + ") on channel '" + channel + "', message: " + message); } @@ -245,7 +244,7 @@ public abstract class AbstractMessageChannel implements MessageChannel, BeanName return true; } - public void postReceive(Message message, MessageChannel channel) { + public void postReceive(Message message, MessageChannel channel) { if (logger.isDebugEnabled()) { logger.debug("postReceive on channel '" + channel + "', message: " + message); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/channel/BaseBlockingQueueChannel.java b/spring-integration-core/src/main/java/org/springframework/integration/channel/BaseBlockingQueueChannel.java index 81ef4bf3c4..690838a397 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/channel/BaseBlockingQueueChannel.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/channel/BaseBlockingQueueChannel.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/channel/ChannelInterceptor.java b/spring-integration-core/src/main/java/org/springframework/integration/channel/ChannelInterceptor.java index 32ec9d1f7b..719e992108 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/channel/ChannelInterceptor.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/channel/ChannelInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/channel/ChannelPurger.java b/spring-integration-core/src/main/java/org/springframework/integration/channel/ChannelPurger.java index a04254515b..fe68861876 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/channel/ChannelPurger.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/channel/ChannelPurger.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/channel/MessageChannel.java b/spring-integration-core/src/main/java/org/springframework/integration/channel/MessageChannel.java index 233535739f..83b4f1b67e 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/channel/MessageChannel.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/channel/MessageChannel.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. @@ -54,7 +54,7 @@ public interface MessageChannel { * @return true if the message is sent successfully, * false if interrupted */ - boolean send(Message message); + boolean send(Message message); /** * Send a message, blocking until either the message is accepted or the @@ -67,7 +67,7 @@ public interface MessageChannel { * false if the specified timeout period elapses or * the send is interrupted */ - boolean send(Message message, long timeout); + boolean send(Message message, long timeout); /** * Receive a message, blocking indefinitely if necessary. @@ -75,7 +75,7 @@ public interface MessageChannel { * @return the next available {@link Message} or null if * interrupted */ - Message receive(); + Message receive(); /** * Receive a message, blocking until either a message is available or the @@ -86,7 +86,7 @@ public interface MessageChannel { * @return the next available {@link Message} or null if the * specified timeout period elapses or the message reception is interrupted */ - Message receive(long timeout); + Message receive(long timeout); /** * Remove all {@link Message Messages} from this channel. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/channel/PriorityChannel.java b/spring-integration-core/src/main/java/org/springframework/integration/channel/PriorityChannel.java index db2e2dbe5c..c4c78fd52b 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/channel/PriorityChannel.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/channel/PriorityChannel.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/channel/RequestReplyTemplate.java b/spring-integration-core/src/main/java/org/springframework/integration/channel/RequestReplyTemplate.java index 8ec4ee0dd6..79b463d1bd 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/channel/RequestReplyTemplate.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/channel/RequestReplyTemplate.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/channel/SimpleChannel.java b/spring-integration-core/src/main/java/org/springframework/integration/channel/SimpleChannel.java index 9ce0232575..77db771dbe 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/channel/SimpleChannel.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/channel/SimpleChannel.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/channel/interceptor/ChannelInterceptorAdapter.java b/spring-integration-core/src/main/java/org/springframework/integration/channel/interceptor/ChannelInterceptorAdapter.java index 07cf53b07b..b5eb17fffd 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/channel/interceptor/ChannelInterceptorAdapter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/channel/interceptor/ChannelInterceptorAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/channel/interceptor/MessageSelectingInterceptor.java b/spring-integration-core/src/main/java/org/springframework/integration/channel/interceptor/MessageSelectingInterceptor.java index c1381e96c6..85d3953111 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/channel/interceptor/MessageSelectingInterceptor.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/channel/interceptor/MessageSelectingInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/channel/interceptor/WireTap.java b/spring-integration-core/src/main/java/org/springframework/integration/channel/interceptor/WireTap.java index dad074d193..4df0588a71 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/channel/interceptor/WireTap.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/channel/interceptor/WireTap.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. @@ -100,7 +100,7 @@ public class WireTap extends ChannelInterceptorAdapter implements Lifecycle { @Override public boolean preSend(Message message, MessageChannel channel) { if (this.running && this.selectorsAccept(message)) { - Message duplicate = new GenericMessage(message.getPayload(), message.getHeader()); + Message duplicate = new GenericMessage(message.getPayload(), message.getHeader()); duplicate.getHeader().setAttribute(ORIGINAL_MESSAGE_ID_KEY, message.getId()); if (!this.secondaryChannel.send(duplicate, 0)) { if (logger.isWarnEnabled()) { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/AggregatorParser.java b/spring-integration-core/src/main/java/org/springframework/integration/config/AggregatorParser.java index 2278c23cd4..060f8153ee 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/AggregatorParser.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/AggregatorParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. @@ -24,7 +24,7 @@ import org.springframework.beans.factory.parsing.BeanComponentDefinition; import org.springframework.beans.factory.support.RootBeanDefinition; import org.springframework.beans.factory.xml.BeanDefinitionParser; import org.springframework.beans.factory.xml.ParserContext; -import org.springframework.integration.MessagingConfigurationException; +import org.springframework.integration.ConfigurationException; import org.springframework.integration.router.AggregatingMessageHandler; import org.springframework.integration.router.AggregatorAdapter; import org.springframework.util.StringUtils; @@ -87,7 +87,7 @@ public class AggregatorParser implements BeanDefinitionParser { final String ref = element.getAttribute(REF_ATTRIBUTE); final String method = element.getAttribute(METHOD_ATTRIBUTE); if (!StringUtils.hasText(ref)) { - throw new MessagingConfigurationException("The 'ref' attribute must be present"); + throw new ConfigurationException("The 'ref' attribute must be present"); } if (!topLevel && StringUtils.hasText(id)) { parserContext.getReaderContext().error( diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/ChannelAdapterParser.java b/spring-integration-core/src/main/java/org/springframework/integration/config/ChannelAdapterParser.java index d47021c055..9ccaac21b6 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/ChannelAdapterParser.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/ChannelAdapterParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. @@ -24,7 +24,7 @@ import org.springframework.beans.factory.parsing.BeanComponentDefinition; import org.springframework.beans.factory.support.RootBeanDefinition; import org.springframework.beans.factory.xml.BeanDefinitionParser; import org.springframework.beans.factory.xml.ParserContext; -import org.springframework.integration.MessagingConfigurationException; +import org.springframework.integration.ConfigurationException; import org.springframework.integration.adapter.DefaultTargetAdapter; import org.springframework.integration.adapter.MethodInvokingSource; import org.springframework.integration.adapter.MethodInvokingTarget; @@ -64,13 +64,13 @@ public class ChannelAdapterParser implements BeanDefinitionParser { String method = element.getAttribute(METHOD_ATTRIBUTE); String channel = element.getAttribute(CHANNEL_ATTRIBUTE); if (!StringUtils.hasText(ref)) { - throw new MessagingConfigurationException("'ref' is required"); + throw new ConfigurationException("'ref' is required"); } if (!StringUtils.hasText(method)) { - throw new MessagingConfigurationException("'method' is required"); + throw new ConfigurationException("'method' is required"); } if (!StringUtils.hasText(channel)) { - throw new MessagingConfigurationException("'channel' is required"); + throw new ConfigurationException("'channel' is required"); } RootBeanDefinition adapterDef = null; RootBeanDefinition invokerDef = null; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/EndpointParser.java b/spring-integration-core/src/main/java/org/springframework/integration/config/EndpointParser.java index 36e12932ee..b845b99544 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/EndpointParser.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/EndpointParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. @@ -30,7 +30,7 @@ import org.springframework.beans.factory.support.ManagedList; import org.springframework.beans.factory.support.RootBeanDefinition; import org.springframework.beans.factory.xml.BeanDefinitionParser; import org.springframework.beans.factory.xml.ParserContext; -import org.springframework.integration.MessagingConfigurationException; +import org.springframework.integration.ConfigurationException; import org.springframework.integration.endpoint.ConcurrencyPolicy; import org.springframework.integration.endpoint.DefaultMessageEndpoint; import org.springframework.integration.handler.DefaultMessageHandlerAdapter; @@ -167,7 +167,7 @@ public class EndpointParser implements BeanDefinitionParser { String handlerRef = element.getAttribute(HANDLER_REF_ATTRIBUTE); if (StringUtils.hasText(handlerRef)) { if (childHandlerRefs.size() > 0) { - throw new MessagingConfigurationException( + throw new ConfigurationException( "The 'handler-ref' attribute is only supported when no 'handler' child elements are present"); } String handlerMethod = element.getAttribute(HANDLER_METHOD_ATTRIBUTE); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/MessageBusParser.java b/spring-integration-core/src/main/java/org/springframework/integration/config/MessageBusParser.java index cc4c95c1a0..0749677a6e 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/MessageBusParser.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/MessageBusParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. @@ -26,7 +26,7 @@ import org.springframework.beans.factory.support.BeanDefinitionBuilder; import org.springframework.beans.factory.xml.AbstractSimpleBeanDefinitionParser; import org.springframework.beans.factory.xml.ParserContext; import org.springframework.core.Conventions; -import org.springframework.integration.MessagingConfigurationException; +import org.springframework.integration.ConfigurationException; import org.springframework.integration.bus.MessageBus; import org.springframework.integration.endpoint.ConcurrencyPolicy; import org.springframework.util.StringUtils; @@ -53,7 +53,7 @@ public class MessageBusParser extends AbstractSimpleBeanDefinitionParser { protected String resolveId(Element element, AbstractBeanDefinition definition, ParserContext parserContext) throws BeanDefinitionStoreException { if (parserContext.getRegistry().containsBeanDefinition(MESSAGE_BUS_BEAN_NAME)) { - throw new MessagingConfigurationException("Only one instance of '" + MESSAGE_BUS_CLASS.getSimpleName() + throw new ConfigurationException("Only one instance of '" + MESSAGE_BUS_CLASS.getSimpleName() + "' is allowed per ApplicationContext."); } return MESSAGE_BUS_BEAN_NAME; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/MessageEndpointAnnotationPostProcessor.java b/spring-integration-core/src/main/java/org/springframework/integration/config/MessageEndpointAnnotationPostProcessor.java index 77579a9320..4017572a94 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/MessageEndpointAnnotationPostProcessor.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/MessageEndpointAnnotationPostProcessor.java @@ -33,7 +33,7 @@ import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.config.BeanPostProcessor; import org.springframework.core.OrderComparator; import org.springframework.core.annotation.AnnotationUtils; -import org.springframework.integration.MessagingConfigurationException; +import org.springframework.integration.ConfigurationException; import org.springframework.integration.adapter.DefaultTargetAdapter; import org.springframework.integration.adapter.MethodInvokingSource; import org.springframework.integration.adapter.MethodInvokingTarget; @@ -179,7 +179,7 @@ public class MessageEndpointAnnotationPostProcessor implements BeanPostProcessor Annotation annotation = AnnotationUtils.getAnnotation(method, DefaultOutput.class); if (annotation != null) { if (foundDefaultOutput) { - throw new MessagingConfigurationException("only one @DefaultOutput allowed per endpoint"); + throw new ConfigurationException("only one @DefaultOutput allowed per endpoint"); } MethodInvokingTarget target = new MethodInvokingTarget(); target.setObject(bean); @@ -231,7 +231,7 @@ public class MessageEndpointAnnotationPostProcessor implements BeanPostProcessor ((InitializingBean) handler).afterPropertiesSet(); } catch (Exception e) { - throw new MessagingConfigurationException("failed to create handler", e); + throw new ConfigurationException("failed to create handler", e); } } if (handler != null) { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/ChannelPollingMessageRetriever.java b/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/ChannelPollingMessageRetriever.java index cffeeb38e0..1bc8eb503d 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/ChannelPollingMessageRetriever.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/ChannelPollingMessageRetriever.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/DefaultMessageDispatcher.java b/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/DefaultMessageDispatcher.java index c5e9da4ce8..f9a298496d 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/DefaultMessageDispatcher.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/DefaultMessageDispatcher.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. @@ -27,7 +27,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.context.Lifecycle; -import org.springframework.integration.MessagingConfigurationException; +import org.springframework.integration.ConfigurationException; import org.springframework.integration.channel.MessageChannel; import org.springframework.integration.handler.MessageHandler; import org.springframework.integration.message.Message; @@ -130,7 +130,7 @@ public class DefaultMessageDispatcher implements SchedulingMessageDispatcher { return; } if (this.scheduler == null) { - throw new MessagingConfigurationException("'scheduler' is required"); + throw new ConfigurationException("'scheduler' is required"); } if (!this.scheduler.isRunning()) { this.scheduler.start(); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/DefaultMessageDistributor.java b/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/DefaultMessageDistributor.java index b662a27e10..b86763aa5a 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/DefaultMessageDistributor.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/DefaultMessageDistributor.java @@ -119,8 +119,10 @@ public class DefaultMessageDistributor implements MessageDistributor { attempts++; } if (this.dispatcherPolicy.getShouldFailOnRejectionLimit()) { - throw new MessageDeliveryException("Dispatcher reached rejection limit of " + this.dispatcherPolicy.getRejectionLimit() - + ". Consider increasing the handler's concurrency and/or the dispatcherPolicy's 'rejectionLimit'."); + throw new MessageDeliveryException(message, "Dispatcher reached rejection limit of " + + this.dispatcherPolicy.getRejectionLimit() + + ". Consider increasing the handler's concurrency and/or " + + "the dispatcherPolicy's 'rejectionLimit'."); } return false; } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/MessageRetriever.java b/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/MessageRetriever.java index ee1cdaeeed..65761f32a2 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/MessageRetriever.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/MessageRetriever.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/endpoint/ConcurrentHandler.java b/spring-integration-core/src/main/java/org/springframework/integration/endpoint/ConcurrentHandler.java index 12a5df4334..72c5e1e1ac 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/endpoint/ConcurrentHandler.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/endpoint/ConcurrentHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. @@ -73,14 +73,14 @@ public class ConcurrentHandler implements MessageHandler, DisposableBean { public Message handle(Message message) { if (this.executor.isShutdown()) { - throw new MessageHandlerNotRunningException(); + throw new MessageHandlerNotRunningException(message); } try { this.executor.execute(new HandlerTask(message)); return null; } catch (RuntimeException e) { - throw new MessageHandlerRejectedExecutionException(e); + throw new MessageHandlerRejectedExecutionException(message, e); } } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/endpoint/DefaultMessageEndpoint.java b/spring-integration-core/src/main/java/org/springframework/integration/endpoint/DefaultMessageEndpoint.java index 325c1507c0..9da66a94c2 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/endpoint/DefaultMessageEndpoint.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/endpoint/DefaultMessageEndpoint.java @@ -31,7 +31,7 @@ import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.BeanNameAware; import org.springframework.beans.factory.InitializingBean; import org.springframework.context.Lifecycle; -import org.springframework.integration.MessagingConfigurationException; +import org.springframework.integration.ConfigurationException; import org.springframework.integration.channel.ChannelRegistry; import org.springframework.integration.channel.ChannelRegistryAware; import org.springframework.integration.channel.MessageChannel; @@ -242,16 +242,16 @@ public class DefaultMessageEndpoint implements MessageEndpoint, ChannelRegistryA logger.debug("endpoint '" + this + "' handling message: " + message); } if (!this.isRunning()) { - throw new MessageHandlerNotRunningException(); + throw new MessageHandlerNotRunningException(message); } for (MessageSelector selector : this.selectors) { if (!selector.accept(message)) { - throw new MessageSelectorRejectedException(); + throw new MessageSelectorRejectedException(message); } } if (this.handler == null) { if (this.defaultOutputChannelName == null) { - throw new MessagingConfigurationException( + throw new ConfigurationException( "endpoint must have either a 'handler' or 'defaultOutputChannelName'"); } MessageChannel outputChannel = this.channelRegistry.lookupChannel(this.defaultOutputChannelName); @@ -278,7 +278,7 @@ public class DefaultMessageEndpoint implements MessageEndpoint, ChannelRegistryA } catch (Throwable t) { if (this.errorHandler == null) { - throw new MessageHandlingException( + throw new MessageHandlingException(message, "error occurred in endpoint, and no 'errorHandler' available", t); } this.errorHandler.handle(t); @@ -316,7 +316,8 @@ public class DefaultMessageEndpoint implements MessageEndpoint, ChannelRegistryA } MessageChannel replyChannel = resolveReplyChannel(originalMessageHeader); if (replyChannel == null) { - throw new MessageHandlingException("Unable to determine reply channel for message. " + + throw new MessageHandlingException(replyMessage, + "Unable to determine reply channel for message. " + "Provide a 'replyChannel' or 'replyChannelName' in the message header " + "or a 'defaultOutputChannelName' on the message endpoint."); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/AbstractMessageHandlerAdapter.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/AbstractMessageHandlerAdapter.java index 16d770fffe..9ffe276448 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/AbstractMessageHandlerAdapter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/AbstractMessageHandlerAdapter.java @@ -25,7 +25,6 @@ import org.springframework.integration.message.GenericMessage; import org.springframework.integration.message.Message; import org.springframework.integration.message.MessageHeader; import org.springframework.integration.message.MessageMapper; -import org.springframework.integration.util.SimpleMethodInvoker; import org.springframework.util.Assert; /** @@ -46,7 +45,7 @@ public abstract class AbstractMessageHandlerAdapter implements MessageHandler private volatile String methodName; - private volatile SimpleMethodInvoker invoker; + private volatile HandlerMethodInvoker invoker; private volatile int order = Integer.MAX_VALUE; @@ -83,7 +82,7 @@ public abstract class AbstractMessageHandlerAdapter implements MessageHandler if (this.initialized) { return; } - this.invoker = new SimpleMethodInvoker(this.object, this.methodName); + this.invoker = new HandlerMethodInvoker(this.object, this.methodName); this.initialized = true; } this.initialize(); @@ -129,6 +128,6 @@ public abstract class AbstractMessageHandlerAdapter implements MessageHandler * the provided target object and method. May return an object of type * {@link Message}, else rely on the message mapper to convert. */ - protected abstract Object doHandle(Message message, SimpleMethodInvoker invoker); + protected abstract Object doHandle(Message message, HandlerMethodInvoker invoker); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/DefaultMessageHandlerAdapter.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/DefaultMessageHandlerAdapter.java index b8cdbc24a2..cbe01c9956 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/DefaultMessageHandlerAdapter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/DefaultMessageHandlerAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. @@ -18,7 +18,6 @@ package org.springframework.integration.handler; import org.springframework.core.Ordered; import org.springframework.integration.message.Message; -import org.springframework.integration.util.SimpleMethodInvoker; /** * An implementation of {@link MessageHandler} that invokes the specified method @@ -45,7 +44,7 @@ public class DefaultMessageHandlerAdapter extends AbstractMessageHandlerAdapt this.expectsMessage = expectsMessage; } - public Object doHandle(Message message, SimpleMethodInvoker invoker) { + public Object doHandle(Message message, HandlerMethodInvoker invoker) { if (this.expectsMessage) { return invoker.invokeMethod(message); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/util/SimpleMethodInvoker.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/HandlerMethodInvoker.java similarity index 86% rename from spring-integration-core/src/main/java/org/springframework/integration/util/SimpleMethodInvoker.java rename to spring-integration-core/src/main/java/org/springframework/integration/handler/HandlerMethodInvoker.java index 909016a065..dbe69b88c6 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/util/SimpleMethodInvoker.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/HandlerMethodInvoker.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. @@ -14,12 +14,13 @@ * limitations under the License. */ -package org.springframework.integration.util; +package org.springframework.integration.handler; import java.lang.reflect.InvocationTargetException; import org.springframework.beans.support.ArgumentConvertingMethodInvoker; -import org.springframework.integration.MessagingException; +import org.springframework.integration.message.MessagingException; +import org.springframework.integration.util.MethodValidator; import org.springframework.util.Assert; import org.springframework.util.MethodInvoker; import org.springframework.util.ObjectUtils; @@ -29,7 +30,7 @@ import org.springframework.util.ObjectUtils; * * @author Mark Fisher */ -public class SimpleMethodInvoker { +public class HandlerMethodInvoker { private T object; @@ -38,7 +39,7 @@ public class SimpleMethodInvoker { private MethodValidator methodValidator; - public SimpleMethodInvoker(T object, String method) { + public HandlerMethodInvoker(T object, String method) { Assert.notNull(object, "'object' must not be null"); Assert.notNull(method, "'method' must not be null"); this.object = object; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/InterceptingMessageHandler.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/InterceptingMessageHandler.java index ca57f1aabc..2676e54f81 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/InterceptingMessageHandler.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/InterceptingMessageHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/MessageHandler.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/MessageHandler.java index 1d345df7c5..d5bfbede1e 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/MessageHandler.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/MessageHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/MessageHandlerChain.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/MessageHandlerChain.java index 82cdec27f1..e07020d0af 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/MessageHandlerChain.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/MessageHandlerChain.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/MessageHandlerNotRunningException.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/MessageHandlerNotRunningException.java index 85df94cd12..e841304ba6 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/MessageHandlerNotRunningException.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/MessageHandlerNotRunningException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. @@ -16,6 +16,7 @@ package org.springframework.integration.handler; +import org.springframework.integration.message.Message; import org.springframework.integration.message.MessageHandlingException; /** @@ -23,10 +24,11 @@ import org.springframework.integration.message.MessageHandlingException; * * @author Mark Fisher */ +@SuppressWarnings("serial") public class MessageHandlerNotRunningException extends MessageHandlingException { - public MessageHandlerNotRunningException() { - super("handler is not running"); + public MessageHandlerNotRunningException(Message message) { + super(message, "handler is not running"); } } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/MessageHandlerRejectedExecutionException.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/MessageHandlerRejectedExecutionException.java index bdfde73f65..91c0f7b7f9 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/MessageHandlerRejectedExecutionException.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/MessageHandlerRejectedExecutionException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. @@ -16,6 +16,7 @@ package org.springframework.integration.handler; +import org.springframework.integration.message.Message; import org.springframework.integration.message.MessageHandlingException; /** @@ -24,18 +25,15 @@ import org.springframework.integration.message.MessageHandlingException; * * @author Mark Fisher */ +@SuppressWarnings("serial") public class MessageHandlerRejectedExecutionException extends MessageHandlingException { - public MessageHandlerRejectedExecutionException() { - super(); + public MessageHandlerRejectedExecutionException(Message message) { + super(message); } - public MessageHandlerRejectedExecutionException(Throwable cause) { - super("handler rejected execution", cause); - } - - public MessageHandlerRejectedExecutionException(String message, Throwable cause) { - super(message, cause); + public MessageHandlerRejectedExecutionException(Message message, Throwable cause) { + super(message, "handler rejected execution", cause); } } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/ReplyHandler.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/ReplyHandler.java index 48d155ed2f..f73f001cbb 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/ReplyHandler.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/ReplyHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/ResponseCorrelator.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/ResponseCorrelator.java index 99383c88e9..9f64ec415b 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/ResponseCorrelator.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/ResponseCorrelator.java @@ -47,7 +47,8 @@ public class ResponseCorrelator implements MessageHandler { public Message handle(Message message) { Object correlationId = this.getCorrelationId(message); if (correlationId == null) { - throw new MessageHandlingException("unable to handle response, message has no correlationId: " + message); + throw new MessageHandlingException(message, + "unable to handle response, message has no correlationId: " + message); } this.messageStore.put(correlationId, message); return null; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/config/AbstractMessageHandlerCreator.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/config/AbstractMessageHandlerCreator.java index 6debd75e1d..a1eaa7b6ec 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/config/AbstractMessageHandlerCreator.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/config/AbstractMessageHandlerCreator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. @@ -22,7 +22,7 @@ import java.util.Map; import org.springframework.beans.factory.InitializingBean; import org.springframework.core.annotation.AnnotationUtils; import org.springframework.core.annotation.Order; -import org.springframework.integration.MessagingConfigurationException; +import org.springframework.integration.ConfigurationException; import org.springframework.integration.handler.AbstractMessageHandlerAdapter; import org.springframework.integration.handler.MessageHandler; @@ -50,7 +50,7 @@ public abstract class AbstractMessageHandlerCreator implements MessageHandlerCre ((InitializingBean) handler).afterPropertiesSet(); } catch (Exception e) { - throw new MessagingConfigurationException("failed to initialize handler", e); + throw new ConfigurationException("failed to initialize handler", e); } } return handler; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/config/DefaultMessageHandlerCreator.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/config/DefaultMessageHandlerCreator.java index 4186618604..a8907bbd56 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/config/DefaultMessageHandlerCreator.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/config/DefaultMessageHandlerCreator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. @@ -20,7 +20,7 @@ import java.lang.reflect.Method; import java.util.Map; import org.springframework.core.annotation.Order; -import org.springframework.integration.MessagingConfigurationException; +import org.springframework.integration.ConfigurationException; import org.springframework.integration.handler.DefaultMessageHandlerAdapter; import org.springframework.integration.handler.MessageHandler; import org.springframework.integration.message.Message; @@ -38,7 +38,7 @@ public class DefaultMessageHandlerCreator extends AbstractMessageHandlerCreator public MessageHandler doCreateHandler(Object object, Method method, Map attributes) { Class[] types = method.getParameterTypes(); if (types.length != 1) { - throw new MessagingConfigurationException("exactly one method parameter is required"); + throw new ConfigurationException("exactly one method parameter is required"); } DefaultMessageHandlerAdapter adapter = new DefaultMessageHandlerAdapter(); adapter.setExpectsMessage(Message.class.isAssignableFrom(types[0])); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/message/GenericMessage.java b/spring-integration-core/src/main/java/org/springframework/integration/message/GenericMessage.java index efa1750030..81392873e6 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/message/GenericMessage.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/message/GenericMessage.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/message/Message.java b/spring-integration-core/src/main/java/org/springframework/integration/message/Message.java index 5dc7b8ae5e..378c225b6b 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/message/Message.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/message/Message.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/message/MessageDeliveryException.java b/spring-integration-core/src/main/java/org/springframework/integration/message/MessageDeliveryException.java index 2b282129af..f92d2bef34 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/message/MessageDeliveryException.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/message/MessageDeliveryException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. @@ -16,8 +16,6 @@ package org.springframework.integration.message; -import org.springframework.integration.MessagingException; - /** * Exception that indicates an error during message delivery. * @@ -26,36 +24,12 @@ import org.springframework.integration.MessagingException; @SuppressWarnings("serial") public class MessageDeliveryException extends MessagingException { - private Message undeliveredMessage; - - - public MessageDeliveryException() { - super(); - } - public MessageDeliveryException(Message undeliveredMessage) { - this.undeliveredMessage = undeliveredMessage; - } - - public MessageDeliveryException(String description) { - super(description); + super(undeliveredMessage); } public MessageDeliveryException(Message undeliveredMessage, String description) { - super(description); - this.undeliveredMessage = undeliveredMessage; - } - - public MessageDeliveryException(String description, Throwable cause) { - super(description, cause); - } - - - /** - * Return the undelivered {@link Message} if available, may be null. - */ - public Message getUndeliveredMessage() { - return this.undeliveredMessage; + super(undeliveredMessage, description); } } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/message/MessageHandlingException.java b/spring-integration-core/src/main/java/org/springframework/integration/message/MessageHandlingException.java index 9df16ece94..b26603f5fd 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/message/MessageHandlingException.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/message/MessageHandlingException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. @@ -16,8 +16,6 @@ package org.springframework.integration.message; -import org.springframework.integration.MessagingException; - /** * Exception that indicates an error during message handling. * @@ -26,36 +24,16 @@ import org.springframework.integration.MessagingException; @SuppressWarnings("serial") public class MessageHandlingException extends MessagingException { - private Message failedMessage; - - - public MessageHandlingException() { - super(); - } - public MessageHandlingException(Message failedMessage) { - this.failedMessage = failedMessage; - } - - public MessageHandlingException(String description) { - super(description); + super(failedMessage); } public MessageHandlingException(Message failedMessage, String description) { - super(description); - this.failedMessage = failedMessage; + super(failedMessage, description); } - public MessageHandlingException(String description, Throwable cause) { - super(description, cause); - } - - - /** - * Return the failed {@link Message} if available, may be null. - */ - public Message getFailedMessage() { - return this.failedMessage; + public MessageHandlingException(Message failedMessage, String description, Throwable cause) { + super(failedMessage, description, cause); } } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/message/MessageHeader.java b/spring-integration-core/src/main/java/org/springframework/integration/message/MessageHeader.java index 4803c84634..a6f7e2b813 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/message/MessageHeader.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/message/MessageHeader.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/message/MessageMapper.java b/spring-integration-core/src/main/java/org/springframework/integration/message/MessageMapper.java index e673868701..f788cf5a51 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/message/MessageMapper.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/message/MessageMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/message/MessagePriority.java b/spring-integration-core/src/main/java/org/springframework/integration/message/MessagePriority.java index 87ab5fcbbd..7479a253f5 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/message/MessagePriority.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/message/MessagePriority.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/message/MessagingException.java b/spring-integration-core/src/main/java/org/springframework/integration/message/MessagingException.java new file mode 100644 index 0000000000..4e2a69fb29 --- /dev/null +++ b/spring-integration-core/src/main/java/org/springframework/integration/message/MessagingException.java @@ -0,0 +1,65 @@ +/* + * 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.message; + +/** + * The base exception for any failures within the messaging system. + * + * @author Mark Fisher + */ +@SuppressWarnings("serial") +public class MessagingException extends RuntimeException { + + private final Message failedMessage; + + + public MessagingException(Message message) { + super(); + this.failedMessage = message; + } + + public MessagingException(String description) { + super(description); + this.failedMessage = null; + } + + public MessagingException(String description, Throwable cause) { + super(description, cause); + this.failedMessage = null; + } + + public MessagingException(Message message, String description) { + super(description); + this.failedMessage = message; + } + + public MessagingException(Message message, Throwable cause) { + super(cause); + this.failedMessage = message; + } + + public MessagingException(Message message, String description, Throwable cause) { + super(description, cause); + this.failedMessage = message; + } + + + public Message getFailedMessage() { + return this.failedMessage; + } + +} diff --git a/spring-integration-core/src/main/java/org/springframework/integration/message/SimplePayloadMessageMapper.java b/spring-integration-core/src/main/java/org/springframework/integration/message/SimplePayloadMessageMapper.java index 7c4455ed4d..4bcd3fad79 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/message/SimplePayloadMessageMapper.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/message/SimplePayloadMessageMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/message/selector/MessageSelectorRejectedException.java b/spring-integration-core/src/main/java/org/springframework/integration/message/selector/MessageSelectorRejectedException.java index d6e669e1ac..9a8aaa63e0 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/message/selector/MessageSelectorRejectedException.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/message/selector/MessageSelectorRejectedException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. @@ -16,6 +16,7 @@ package org.springframework.integration.message.selector; +import org.springframework.integration.message.Message; import org.springframework.integration.message.MessageHandlingException; /** @@ -24,14 +25,11 @@ import org.springframework.integration.message.MessageHandlingException; * * @author Mark Fisher */ +@SuppressWarnings("serial") public class MessageSelectorRejectedException extends MessageHandlingException { - public MessageSelectorRejectedException() { - super(); - } - - public MessageSelectorRejectedException(String message) { - super(message); + public MessageSelectorRejectedException(Message rejectedMessage) { + super(rejectedMessage); } } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/router/AbstractRoutingMessageHandler.java b/spring-integration-core/src/main/java/org/springframework/integration/router/AbstractRoutingMessageHandler.java index d9a77eb7b8..78e945af20 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/router/AbstractRoutingMessageHandler.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/router/AbstractRoutingMessageHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. @@ -22,7 +22,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.InitializingBean; -import org.springframework.integration.MessagingConfigurationException; +import org.springframework.integration.ConfigurationException; import org.springframework.integration.channel.ChannelRegistry; import org.springframework.integration.channel.ChannelRegistryAware; import org.springframework.integration.channel.MessageChannel; @@ -78,12 +78,12 @@ public abstract class AbstractRoutingMessageHandler implements MessageHandler, C public final Message handle(Message message) { List channels = this.resolveChannels(message); if (channels == null || channels.size() == 0) { - String errorMessage = "failed to resolve any channel for message"; + String description = "failed to resolve any channel for message"; if (this.resolutionRequired) { - throw new MessageHandlingException(errorMessage); + throw new MessageHandlingException(message, description); } if (logger.isWarnEnabled()) { - logger.warn(errorMessage); + logger.warn(description); } return null; } @@ -102,11 +102,12 @@ public abstract class AbstractRoutingMessageHandler implements MessageHandler, C sent = channel.send(message, timeout); } if (!sent) { - throw new MessageHandlingException("failed to send message to channel '" + channel.getName() + "'"); + throw new MessageHandlingException(message, + "failed to send message to channel '" + channel.getName() + "'"); } } - protected abstract void validate() throws MessagingConfigurationException; + protected abstract void validate() throws ConfigurationException; protected abstract List resolveChannels(Message message); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/router/AggregatingMessageHandler.java b/spring-integration-core/src/main/java/org/springframework/integration/router/AggregatingMessageHandler.java index fc4212e002..b74c1d5c48 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/router/AggregatingMessageHandler.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/router/AggregatingMessageHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. @@ -198,8 +198,8 @@ public class AggregatingMessageHandler implements MessageHandler, InitializingBe } Object correlationId = message.getHeader().getCorrelationId(); if (correlationId == null) { - throw new MessageHandlingException(this.getClass().getSimpleName() + - " requires the 'correlationId' property"); + throw new MessageHandlingException(message, + this.getClass().getSimpleName() + " requires the 'correlationId' property"); } if (this.trackedCorrelationIds.contains(correlationId)) { if (logger.isDebugEnabled()) { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/router/AggregationBarrier.java b/spring-integration-core/src/main/java/org/springframework/integration/router/AggregationBarrier.java index 0b7d2553a8..47c3e5da55 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/router/AggregationBarrier.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/router/AggregationBarrier.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/router/Aggregator.java b/spring-integration-core/src/main/java/org/springframework/integration/router/Aggregator.java index 140a435045..a161f64ef6 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/router/Aggregator.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/router/Aggregator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/router/AggregatorAdapter.java b/spring-integration-core/src/main/java/org/springframework/integration/router/AggregatorAdapter.java index 42575bc2bb..35737f2bfa 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/router/AggregatorAdapter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/router/AggregatorAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. @@ -23,10 +23,10 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; -import org.springframework.integration.MessagingConfigurationException; +import org.springframework.integration.ConfigurationException; +import org.springframework.integration.handler.HandlerMethodInvoker; import org.springframework.integration.message.GenericMessage; import org.springframework.integration.message.Message; -import org.springframework.integration.util.SimpleMethodInvoker; import org.springframework.util.Assert; import org.springframework.util.ReflectionUtils; @@ -40,7 +40,7 @@ import org.springframework.util.ReflectionUtils; */ public class AggregatorAdapter implements Aggregator { - private final SimpleMethodInvoker invoker; + private final HandlerMethodInvoker invoker; private final Method method; @@ -50,21 +50,21 @@ public class AggregatorAdapter implements Aggregator { Assert.notNull(methodName, "'methodName' must not be null"); this.method = ReflectionUtils.findMethod(object.getClass(), methodName, new Class[] { Collection.class }); if (this.method == null) { - throw new MessagingConfigurationException("Method '" + methodName + + throw new ConfigurationException("Method '" + methodName + "(Collection args)' not found on '" + object.getClass().getName() + "'."); } - this.invoker = new SimpleMethodInvoker(object, this.method.getName()); + this.invoker = new HandlerMethodInvoker(object, this.method.getName()); } public AggregatorAdapter(Object object, Method method) { Assert.notNull(object, "'object' must not be null"); Assert.notNull(method, "'method' must not be null"); if (method.getParameterTypes().length != 1 || !method.getParameterTypes()[0].equals(Collection.class)) { - throw new MessagingConfigurationException( + throw new ConfigurationException( "Aggregator method must accept exactly one parameter, and it must be a Collection."); } this.method = method; - this.invoker = new SimpleMethodInvoker(object, this.method.getName()); + this.invoker = new HandlerMethodInvoker(object, this.method.getName()); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/router/ChannelNameResolver.java b/spring-integration-core/src/main/java/org/springframework/integration/router/ChannelNameResolver.java index 09a9f00505..ce9f8314b6 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/router/ChannelNameResolver.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/router/ChannelNameResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/router/ChannelResolver.java b/spring-integration-core/src/main/java/org/springframework/integration/router/ChannelResolver.java index 89881c2809..ba402e8159 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/router/ChannelResolver.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/router/ChannelResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/router/CompletionStrategy.java b/spring-integration-core/src/main/java/org/springframework/integration/router/CompletionStrategy.java index bd7eac2fd4..f5982d6d6f 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/router/CompletionStrategy.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/router/CompletionStrategy.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/router/MessageBarrier.java b/spring-integration-core/src/main/java/org/springframework/integration/router/MessageBarrier.java index 9d3bf22e61..aec642986c 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/router/MessageBarrier.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/router/MessageBarrier.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/router/MessageSequenceComparator.java b/spring-integration-core/src/main/java/org/springframework/integration/router/MessageSequenceComparator.java index bd6f39e6f8..1439f9af20 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/router/MessageSequenceComparator.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/router/MessageSequenceComparator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/router/MultiChannelNameResolver.java b/spring-integration-core/src/main/java/org/springframework/integration/router/MultiChannelNameResolver.java index 12e25211e6..e8d68c6b0a 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/router/MultiChannelNameResolver.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/router/MultiChannelNameResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/router/MultiChannelResolver.java b/spring-integration-core/src/main/java/org/springframework/integration/router/MultiChannelResolver.java index 4a41969641..0fa75155df 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/router/MultiChannelResolver.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/router/MultiChannelResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/router/MultiChannelRouter.java b/spring-integration-core/src/main/java/org/springframework/integration/router/MultiChannelRouter.java index 0f89da60de..c2bd71f203 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/router/MultiChannelRouter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/router/MultiChannelRouter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. @@ -19,7 +19,7 @@ package org.springframework.integration.router; import java.util.ArrayList; import java.util.List; -import org.springframework.integration.MessagingConfigurationException; +import org.springframework.integration.ConfigurationException; import org.springframework.integration.channel.MessageChannel; import org.springframework.integration.message.Message; @@ -52,11 +52,11 @@ public class MultiChannelRouter extends AbstractRoutingMessageHandler { @Override public void validate() { if (!(this.channelResolver != null ^ this.channelNameResolver != null)) { - throw new MessagingConfigurationException( + throw new ConfigurationException( "exactly one of 'channelResolver' or 'channelNameResolver' must be provided"); } if (this.channelNameResolver != null && this.getChannelRegistry() == null) { - throw new MessagingConfigurationException("'channelRegistry' is required when resolving by channel name"); + throw new ConfigurationException("'channelRegistry' is required when resolving by channel name"); } } @@ -66,7 +66,7 @@ public class MultiChannelRouter extends AbstractRoutingMessageHandler { return this.channelResolver.resolve(message); } if (this.channelNameResolver == null || this.getChannelRegistry() == null) { - throw new MessagingConfigurationException("router configuration requires either " + throw new ConfigurationException("router configuration requires either " + "a 'channelResolver' or both 'channelNameResolver' and 'channelRegistry'"); } String[] channelNames = this.channelNameResolver.resolve(message); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/router/PayloadTypeRouter.java b/spring-integration-core/src/main/java/org/springframework/integration/router/PayloadTypeRouter.java index 752b127835..b86bcb8ed1 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/router/PayloadTypeRouter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/router/PayloadTypeRouter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/router/RecipientListRouter.java b/spring-integration-core/src/main/java/org/springframework/integration/router/RecipientListRouter.java index 5f5753288a..e6cb1ce18e 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/router/RecipientListRouter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/router/RecipientListRouter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/router/RouterMessageHandlerAdapter.java b/spring-integration-core/src/main/java/org/springframework/integration/router/RouterMessageHandlerAdapter.java index d805f556f6..7eeea57d42 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/router/RouterMessageHandlerAdapter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/router/RouterMessageHandlerAdapter.java @@ -20,15 +20,15 @@ import java.lang.reflect.Method; import java.util.Collection; import java.util.Map; -import org.springframework.integration.MessagingConfigurationException; +import org.springframework.integration.ConfigurationException; import org.springframework.integration.annotation.Router; import org.springframework.integration.channel.ChannelRegistry; import org.springframework.integration.channel.ChannelRegistryAware; import org.springframework.integration.channel.MessageChannel; import org.springframework.integration.handler.AbstractMessageHandlerAdapter; +import org.springframework.integration.handler.HandlerMethodInvoker; import org.springframework.integration.message.Message; import org.springframework.integration.message.MessageHandlingException; -import org.springframework.integration.util.SimpleMethodInvoker; import org.springframework.util.Assert; import org.springframework.util.StringUtils; @@ -74,9 +74,9 @@ public class RouterMessageHandlerAdapter extends AbstractMessageHandlerAdapter i } @Override - protected Object doHandle(Message message, SimpleMethodInvoker invoker) { + protected Object doHandle(Message message, HandlerMethodInvoker invoker) { if (method.getParameterTypes().length != 1) { - throw new MessagingConfigurationException( + throw new ConfigurationException( "method must accept exactly one parameter"); } String propertyName = (String) attributes.get(PROPERTY_KEY); @@ -84,19 +84,21 @@ public class RouterMessageHandlerAdapter extends AbstractMessageHandlerAdapter i Object retval = null; if (StringUtils.hasText(propertyName)) { if (StringUtils.hasText(attributeName)) { - throw new MessagingConfigurationException( + throw new ConfigurationException( "cannot accept both 'property' and 'attribute'"); } String property = message.getHeader().getProperty(propertyName); if (!StringUtils.hasText(property)) { - throw new MessageHandlingException("no '" + propertyName + "' property available for router method"); + throw new MessageHandlingException(message, + "no '" + propertyName + "' property available for router method"); } retval = this.invokeMethod(invoker, property); } else if (StringUtils.hasText(attributeName)) { Object attribute = message.getHeader().getAttribute(attributeName); if (attribute == null) { - throw new MessageHandlingException("no '" + attributeName + "' attribute available for router method"); + throw new MessageHandlingException(message, + "no '" + attributeName + "' attribute available for router method"); } retval = this.invokeMethod(invoker, attribute); } @@ -120,7 +122,7 @@ public class RouterMessageHandlerAdapter extends AbstractMessageHandlerAdapter i this.sendMessage(message, (String) channel); } else { - throw new MessagingConfigurationException( + throw new ConfigurationException( "router method must return type 'MessageChannel' or 'String'"); } } @@ -142,14 +144,14 @@ public class RouterMessageHandlerAdapter extends AbstractMessageHandlerAdapter i this.sendMessage(message, (String) retval); } else { - throw new MessagingConfigurationException( + throw new ConfigurationException( "router method must return type 'MessageChannel' or 'String'"); } } return null; } - private Object invokeMethod(SimpleMethodInvoker invoker, Object parameter) { + private Object invokeMethod(HandlerMethodInvoker invoker, Object parameter) { if (this.logger.isDebugEnabled()) { logger.debug("invoking method '" + method.getName() + "' with parameter of type '" + parameter.getClass().getName() + "'"); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/router/SequenceSizeCompletionStrategy.java b/spring-integration-core/src/main/java/org/springframework/integration/router/SequenceSizeCompletionStrategy.java index 85fe7a45d7..ab5523b532 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/router/SequenceSizeCompletionStrategy.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/router/SequenceSizeCompletionStrategy.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/router/SingleChannelRouter.java b/spring-integration-core/src/main/java/org/springframework/integration/router/SingleChannelRouter.java index 7aa81e5fa7..0e59d65527 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/router/SingleChannelRouter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/router/SingleChannelRouter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. @@ -19,7 +19,7 @@ package org.springframework.integration.router; import java.util.ArrayList; import java.util.List; -import org.springframework.integration.MessagingConfigurationException; +import org.springframework.integration.ConfigurationException; import org.springframework.integration.channel.MessageChannel; import org.springframework.integration.message.Message; @@ -51,11 +51,11 @@ public class SingleChannelRouter extends AbstractRoutingMessageHandler { @Override public void validate() { if (!(this.channelResolver != null ^ this.channelNameResolver != null)) { - throw new MessagingConfigurationException( + throw new ConfigurationException( "exactly one of 'channelResolver' or 'channelNameResolver' must be provided"); } if (this.channelNameResolver != null && this.getChannelRegistry() == null) { - throw new MessagingConfigurationException("'channelRegistry' is required when resolving by channel name"); + throw new ConfigurationException("'channelRegistry' is required when resolving by channel name"); } } @@ -74,7 +74,7 @@ public class SingleChannelRouter extends AbstractRoutingMessageHandler { return this.channelResolver.resolve(message); } if (this.channelNameResolver == null || this.getChannelRegistry() == null) { - throw new MessagingConfigurationException("router configuration requires either " + throw new ConfigurationException("router configuration requires either " + "a 'channelResolver' or both 'channelNameResolver' and 'channelRegistry'"); } String channelName = this.channelNameResolver.resolve(message); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/router/SplitterMessageHandlerAdapter.java b/spring-integration-core/src/main/java/org/springframework/integration/router/SplitterMessageHandlerAdapter.java index 2919832d79..8dbabe02a0 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/router/SplitterMessageHandlerAdapter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/router/SplitterMessageHandlerAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. @@ -20,15 +20,15 @@ import java.lang.reflect.Method; import java.util.Collection; import java.util.Map; -import org.springframework.integration.MessagingConfigurationException; +import org.springframework.integration.ConfigurationException; import org.springframework.integration.annotation.Splitter; import org.springframework.integration.channel.ChannelRegistry; import org.springframework.integration.channel.ChannelRegistryAware; import org.springframework.integration.channel.MessageChannel; import org.springframework.integration.handler.AbstractMessageHandlerAdapter; +import org.springframework.integration.handler.HandlerMethodInvoker; import org.springframework.integration.message.Message; import org.springframework.integration.message.MessageHeader; -import org.springframework.integration.util.SimpleMethodInvoker; import org.springframework.util.Assert; /** @@ -71,10 +71,10 @@ public class SplitterMessageHandlerAdapter extends AbstractMessageHandlerAdap } @Override - protected final Object doHandle(Message message, SimpleMethodInvoker invoker) { + protected final Object doHandle(Message message, HandlerMethodInvoker invoker) { final MessageHeader originalMessageHeader = message.getHeader(); if (method.getParameterTypes().length != 1) { - throw new MessagingConfigurationException( + throw new ConfigurationException( "Splitter method must accept exactly one parameter"); } String channelName = (String) attributes.get(CHANNEL_KEY); @@ -121,7 +121,7 @@ public class SplitterMessageHandlerAdapter extends AbstractMessageHandlerAdap } } else { - throw new MessagingConfigurationException( + throw new ConfigurationException( "splitter method must return either a Collection or array"); } return null; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/transformer/MessageFilter.java b/spring-integration-core/src/main/java/org/springframework/integration/transformer/MessageFilter.java index 8e08474086..b0b4f566b4 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/transformer/MessageFilter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/transformer/MessageFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/util/MethodValidator.java b/spring-integration-core/src/main/java/org/springframework/integration/util/MethodValidator.java index 101cf3141b..d9bf880a6c 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/util/MethodValidator.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/util/MethodValidator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. @@ -18,8 +18,6 @@ package org.springframework.integration.util; import java.lang.reflect.Method; -import org.springframework.integration.MessagingConfigurationException; - /** * Interface for method validation. Implementations should throw an exception if * the method is invalid for its purpose. @@ -28,6 +26,6 @@ import org.springframework.integration.MessagingConfigurationException; */ public interface MethodValidator { - void validate(Method method) throws MessagingConfigurationException; + void validate(Method method) throws Exception; } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/message/MessageHeaderTests.java b/spring-integration-core/src/test/java/org/springframework/integration/MessageHeaderTests.java similarity index 95% rename from spring-integration-core/src/test/java/org/springframework/integration/message/MessageHeaderTests.java rename to spring-integration-core/src/test/java/org/springframework/integration/MessageHeaderTests.java index 91e40d885f..2717567295 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/message/MessageHeaderTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/MessageHeaderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.integration.message; +package org.springframework.integration; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -26,6 +26,8 @@ import java.util.Set; import org.junit.Test; +import org.springframework.integration.message.MessageHeader; + /** * @author Mark Fisher */ diff --git a/spring-integration-core/src/test/java/org/springframework/integration/adapter/DefaultTargetAdapterTests.java b/spring-integration-core/src/test/java/org/springframework/integration/adapter/DefaultTargetAdapterTests.java index a2051c1b27..17d06e754b 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/adapter/DefaultTargetAdapterTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/adapter/DefaultTargetAdapterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/test/java/org/springframework/integration/adapter/MethodInvokingSourceTests.java b/spring-integration-core/src/test/java/org/springframework/integration/adapter/MethodInvokingSourceTests.java index 7dc0bc956d..c7240dadde 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/adapter/MethodInvokingSourceTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/adapter/MethodInvokingSourceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. @@ -23,7 +23,7 @@ import java.util.Collection; import org.junit.Test; -import org.springframework.integration.MessagingException; +import org.springframework.integration.message.MessagingException; /** * @author Mark Fisher diff --git a/spring-integration-core/src/test/java/org/springframework/integration/adapter/MethodInvokingTargetTests.java b/spring-integration-core/src/test/java/org/springframework/integration/adapter/MethodInvokingTargetTests.java index be800eef5e..4e3196f743 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/adapter/MethodInvokingTargetTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/adapter/MethodInvokingTargetTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. @@ -20,7 +20,7 @@ import static org.junit.Assert.assertTrue; import org.junit.Test; -import org.springframework.integration.MessagingException; +import org.springframework.integration.message.MessagingException; /** * @author Mark Fisher diff --git a/spring-integration-core/src/test/java/org/springframework/integration/adapter/PollingSourceAdapterTests.java b/spring-integration-core/src/test/java/org/springframework/integration/adapter/PollingSourceAdapterTests.java index cb0d3ea50c..16ed7bce0c 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/adapter/PollingSourceAdapterTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/adapter/PollingSourceAdapterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. @@ -29,7 +29,7 @@ import org.junit.Test; import org.springframework.integration.channel.SimpleChannel; import org.springframework.integration.message.Message; -import org.springframework.integration.message.MessageHandlingException; +import org.springframework.integration.message.MessagingException; /** * @author Mark Fisher @@ -96,7 +96,7 @@ public class PollingSourceAdapterTests { assertNull("message should be null", message4); } - @Test(expected=MessageHandlingException.class) + @Test(expected=MessagingException.class) public void testResultSizeExceedsLimit() { TestSource source = new TestSource("testing", 3); SimpleChannel channel = new SimpleChannel(); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/aop/MessagePublishingInterceptorTests.java b/spring-integration-core/src/test/java/org/springframework/integration/aop/MessagePublishingInterceptorTests.java index 3f1b9ec003..6de614ca06 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/aop/MessagePublishingInterceptorTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/aop/MessagePublishingInterceptorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/test/java/org/springframework/integration/aop/PublisherAnnotationAdvisorTests.java b/spring-integration-core/src/test/java/org/springframework/integration/aop/PublisherAnnotationAdvisorTests.java index bca2ba10d8..f340f28ba0 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/aop/PublisherAnnotationAdvisorTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/aop/PublisherAnnotationAdvisorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/test/java/org/springframework/integration/aop/PublisherAnnotationPostProcessorTests.java b/spring-integration-core/src/test/java/org/springframework/integration/aop/PublisherAnnotationPostProcessorTests.java index 933e11ecfb..5ac01de977 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/aop/PublisherAnnotationPostProcessorTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/aop/PublisherAnnotationPostProcessorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/test/java/org/springframework/integration/bus/MessageBusTests.java b/spring-integration-core/src/test/java/org/springframework/integration/bus/MessageBusTests.java index 3afebedb0b..525fcfbe1b 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/bus/MessageBusTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/bus/MessageBusTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. @@ -29,7 +29,7 @@ import org.junit.Test; import org.springframework.beans.factory.BeanCreationException; import org.springframework.context.support.ClassPathXmlApplicationContext; -import org.springframework.integration.MessagingConfigurationException; +import org.springframework.integration.ConfigurationException; import org.springframework.integration.adapter.PollableSource; import org.springframework.integration.adapter.PollingSourceAdapter; import org.springframework.integration.adapter.SourceAdapter; @@ -228,7 +228,7 @@ public class MessageBusTests { } catch (BeanCreationException e) { exceptionThrown = true; - assertEquals(MessagingConfigurationException.class, e.getCause().getClass()); + assertEquals(ConfigurationException.class, e.getCause().getClass()); } assertTrue(exceptionThrown); } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/channel/ChannelPurgerTests.java b/spring-integration-core/src/test/java/org/springframework/integration/channel/ChannelPurgerTests.java index 61df56fd68..fa7c8f4596 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/channel/ChannelPurgerTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/channel/ChannelPurgerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/test/java/org/springframework/integration/channel/MessagePayloadTestComparator.java b/spring-integration-core/src/test/java/org/springframework/integration/channel/MessagePayloadTestComparator.java index 1f4e925e8f..b72e68f4f0 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/channel/MessagePayloadTestComparator.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/channel/MessagePayloadTestComparator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/test/java/org/springframework/integration/channel/PriorityChannelTests.java b/spring-integration-core/src/test/java/org/springframework/integration/channel/PriorityChannelTests.java index fbdf3b28df..8db3d64c91 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/channel/PriorityChannelTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/channel/PriorityChannelTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/test/java/org/springframework/integration/channel/RequestReplyTemplateTests.java b/spring-integration-core/src/test/java/org/springframework/integration/channel/RequestReplyTemplateTests.java index 45197d375f..9d7fd8d016 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/channel/RequestReplyTemplateTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/channel/RequestReplyTemplateTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/test/java/org/springframework/integration/channel/SimpleChannelTests.java b/spring-integration-core/src/test/java/org/springframework/integration/channel/SimpleChannelTests.java index 64bc8419d4..75eb291586 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/channel/SimpleChannelTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/channel/SimpleChannelTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/test/java/org/springframework/integration/channel/interceptor/ChannelInterceptorTests.java b/spring-integration-core/src/test/java/org/springframework/integration/channel/interceptor/ChannelInterceptorTests.java index 414552da8b..31723e5123 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/channel/interceptor/ChannelInterceptorTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/channel/interceptor/ChannelInterceptorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/test/java/org/springframework/integration/channel/interceptor/MessageSelectingInterceptorTests.java b/spring-integration-core/src/test/java/org/springframework/integration/channel/interceptor/MessageSelectingInterceptorTests.java index 843b3e0148..b34fdccbc5 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/channel/interceptor/MessageSelectingInterceptorTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/channel/interceptor/MessageSelectingInterceptorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/test/java/org/springframework/integration/channel/interceptor/WireTapTests.java b/spring-integration-core/src/test/java/org/springframework/integration/channel/interceptor/WireTapTests.java index 7c172a537a..49c19c2441 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/channel/interceptor/WireTapTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/channel/interceptor/WireTapTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/AggregatorParserTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/AggregatorParserTests.java index afb6d62672..1e7d2a174e 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/AggregatorParserTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/AggregatorParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/ChannelParserTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/ChannelParserTests.java index b29f65e9cc..cc3ec0e0b7 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/ChannelParserTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/ChannelParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. @@ -263,7 +263,7 @@ public class ChannelParserTests { channel.send(new StringMessage("wrong type")); } catch (MessageDeliveryException e) { - assertEquals("wrong type", e.getUndeliveredMessage().getPayload()); + assertEquals("wrong type", e.getFailedMessage().getPayload()); threwException = true; } assertTrue(threwException); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/EndpointParserTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/EndpointParserTests.java index c52caf2cf5..f5f9f6b28d 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/EndpointParserTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/EndpointParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/ExceptionThrowingTestHandler.java b/spring-integration-core/src/test/java/org/springframework/integration/config/ExceptionThrowingTestHandler.java index a8708b0d4e..d840ef1aa1 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/ExceptionThrowingTestHandler.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/ExceptionThrowingTestHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/HandlerParserTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/HandlerParserTests.java index 2ca42e6b87..f9831d37e8 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/HandlerParserTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/HandlerParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/MessageBusParserTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/MessageBusParserTests.java index 5a4061c768..a8ab759c10 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/MessageBusParserTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/MessageBusParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. @@ -26,7 +26,7 @@ import org.springframework.beans.factory.BeanCreationException; import org.springframework.beans.factory.BeanDefinitionStoreException; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; -import org.springframework.integration.MessagingConfigurationException; +import org.springframework.integration.ConfigurationException; import org.springframework.integration.bus.MessageBus; import org.springframework.integration.endpoint.MessageEndpoint; import org.springframework.integration.handler.TestHandlers; @@ -55,7 +55,7 @@ public class MessageBusParserTests { assertNotNull("bus should have created a default error channel", bus.getErrorChannel()); } - @Test(expected=MessagingConfigurationException.class) + @Test(expected=ConfigurationException.class) public void testAutoCreateChannelsDisabledByDefault() { ApplicationContext context = new ClassPathXmlApplicationContext( "messageBusWithDefaults.xml", this.getClass()); @@ -84,7 +84,7 @@ public class MessageBusParserTests { } catch (BeanDefinitionStoreException e) { exceptionThrown = true; - assertEquals(MessagingConfigurationException.class, e.getCause().getClass()); + assertEquals(ConfigurationException.class, e.getCause().getClass()); } assertTrue(exceptionThrown); } @@ -97,7 +97,7 @@ public class MessageBusParserTests { } catch (BeanCreationException e) { exceptionThrown = true; - assertEquals(MessagingConfigurationException.class, e.getCause().getClass()); + assertEquals(ConfigurationException.class, e.getCause().getClass()); } assertTrue(exceptionThrown); } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/TestAggregator.java b/spring-integration-core/src/test/java/org/springframework/integration/config/TestAggregator.java index 2a92e67db7..d0b8576abe 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/TestAggregator.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/TestAggregator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/TestAnnotatedEndpointWithCustomizedAggregator.java b/spring-integration-core/src/test/java/org/springframework/integration/config/TestAnnotatedEndpointWithCustomizedAggregator.java index 039600f43a..1159c810ae 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/TestAnnotatedEndpointWithCustomizedAggregator.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/TestAnnotatedEndpointWithCustomizedAggregator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/TestAnnotatedEndpointWithDefaultAggregator.java b/spring-integration-core/src/test/java/org/springframework/integration/config/TestAnnotatedEndpointWithDefaultAggregator.java index 8db15e2d63..3ca344de10 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/TestAnnotatedEndpointWithDefaultAggregator.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/TestAnnotatedEndpointWithDefaultAggregator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/TestChannelInterceptor.java b/spring-integration-core/src/test/java/org/springframework/integration/config/TestChannelInterceptor.java index 6e31f9f038..a4d4d5017b 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/TestChannelInterceptor.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/TestChannelInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/TestCompletionStrategy.java b/spring-integration-core/src/test/java/org/springframework/integration/config/TestCompletionStrategy.java index be822dbeb1..c813b91337 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/TestCompletionStrategy.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/TestCompletionStrategy.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/TestConcatenatingHandler.java b/spring-integration-core/src/test/java/org/springframework/integration/config/TestConcatenatingHandler.java index 928b5ba22d..78409e6428 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/TestConcatenatingHandler.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/TestConcatenatingHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/TestHandler.java b/spring-integration-core/src/test/java/org/springframework/integration/config/TestHandler.java index 642fcf995e..9a38a8f355 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/TestHandler.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/TestHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/TestReplyHandler.java b/spring-integration-core/src/test/java/org/springframework/integration/config/TestReplyHandler.java index 5818a00e24..fd8ca4b22e 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/TestReplyHandler.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/TestReplyHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/test/java/org/springframework/integration/dispatcher/ChannelPollingMessageRetrieverTests.java b/spring-integration-core/src/test/java/org/springframework/integration/dispatcher/ChannelPollingMessageRetrieverTests.java index cb33a3561d..d0257d71ae 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/dispatcher/ChannelPollingMessageRetrieverTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/dispatcher/ChannelPollingMessageRetrieverTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/test/java/org/springframework/integration/dispatcher/DefaultMessageDispatcherTests.java b/spring-integration-core/src/test/java/org/springframework/integration/dispatcher/DefaultMessageDispatcherTests.java index a1c5a1de93..7560a322c8 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/dispatcher/DefaultMessageDispatcherTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/dispatcher/DefaultMessageDispatcherTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. @@ -166,7 +166,7 @@ public class DefaultMessageDispatcherTests { dispatcher.addHandler(new ConcurrentHandler(handler2, createExecutor()) { @Override public Message handle(Message message) { - throw new MessageHandlerRejectedExecutionException(); + throw new MessageHandlerRejectedExecutionException(message); } }); dispatcher.addHandler(new ConcurrentHandler(handler3, createExecutor())); @@ -198,7 +198,7 @@ public class DefaultMessageDispatcherTests { dispatcher.addHandler(new MessageHandler() { public Message handle(Message message) { latch.countDown(); - throw new MessageHandlerRejectedExecutionException(); + throw new MessageHandlerRejectedExecutionException(message); } }); dispatcher.addHandler(handler2); @@ -251,7 +251,7 @@ public class DefaultMessageDispatcherTests { public Message handle(Message message) { rejectedCounter1.incrementAndGet(); latch.countDown(); - throw new MessageHandlerRejectedExecutionException(); + throw new MessageHandlerRejectedExecutionException(message); } }); dispatcher.addHandler(new ConcurrentHandler(handler2, createExecutor()) { @@ -259,7 +259,7 @@ public class DefaultMessageDispatcherTests { public Message handle(Message message) { rejectedCounter2.incrementAndGet(); latch.countDown(); - throw new MessageHandlerRejectedExecutionException(); + throw new MessageHandlerRejectedExecutionException(message); } }); dispatcher.start(); @@ -295,7 +295,7 @@ public class DefaultMessageDispatcherTests { public Message handle(Message message) { rejectedCounter1.incrementAndGet(); latch.countDown(); - throw new MessageHandlerRejectedExecutionException(); + throw new MessageHandlerRejectedExecutionException(message); } }); dispatcher.addHandler(new ConcurrentHandler(handler2, createExecutor()) { @@ -306,7 +306,7 @@ public class DefaultMessageDispatcherTests { } rejectedCounter2.incrementAndGet(); latch.countDown(); - throw new MessageHandlerRejectedExecutionException(); + throw new MessageHandlerRejectedExecutionException(message); } }); dispatcher.addHandler(new ConcurrentHandler(handler3, createExecutor()) { @@ -314,7 +314,7 @@ public class DefaultMessageDispatcherTests { public Message handle(Message message) { rejectedCounter3.incrementAndGet(); latch.countDown(); - throw new MessageHandlerRejectedExecutionException(); + throw new MessageHandlerRejectedExecutionException(message); } }); dispatcher.start(); @@ -352,7 +352,7 @@ public class DefaultMessageDispatcherTests { } rejectedCounter1.incrementAndGet(); latch.countDown(); - throw new MessageHandlerRejectedExecutionException(); + throw new MessageHandlerRejectedExecutionException(message); } }); dispatcher.addHandler(new ConcurrentHandler(handler2, createExecutor()) { @@ -363,7 +363,7 @@ public class DefaultMessageDispatcherTests { } rejectedCounter2.incrementAndGet(); latch.countDown(); - throw new MessageHandlerRejectedExecutionException(); + throw new MessageHandlerRejectedExecutionException(message); } }); dispatcher.start(); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/endpoint/DefaultMessageEndpointTests.java b/spring-integration-core/src/test/java/org/springframework/integration/endpoint/DefaultMessageEndpointTests.java index 45518e631e..7bec2fe98a 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/endpoint/DefaultMessageEndpointTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/endpoint/DefaultMessageEndpointTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. @@ -466,7 +466,7 @@ public class DefaultMessageEndpointTests { Throwable error = errorHandler.getLastError(); assertNotNull(error); assertEquals(MessageDeliveryException.class, error.getClass()); - assertEquals("test2", ((MessageDeliveryException) error).getUndeliveredMessage().getPayload()); + assertEquals("test2", ((MessageDeliveryException) error).getFailedMessage().getPayload()); } @Test @@ -491,7 +491,7 @@ public class DefaultMessageEndpointTests { Throwable error = errorHandler.getLastError(); assertNotNull(error); assertEquals(MessageDeliveryException.class, error.getClass()); - assertEquals(message2, ((MessageDeliveryException) error).getUndeliveredMessage()); + assertEquals(message2, ((MessageDeliveryException) error).getFailedMessage()); } @Test @@ -519,7 +519,7 @@ public class DefaultMessageEndpointTests { Throwable error = errorHandler.getLastError(); assertNotNull(error); assertEquals(MessageDeliveryException.class, error.getClass()); - assertEquals(message2, ((MessageDeliveryException) error).getUndeliveredMessage()); + assertEquals(message2, ((MessageDeliveryException) error).getFailedMessage()); } @Test diff --git a/spring-integration-core/src/test/java/org/springframework/integration/endpoint/annotation/MessageParameterAnnotatedEndpoint.java b/spring-integration-core/src/test/java/org/springframework/integration/endpoint/annotation/MessageParameterAnnotatedEndpoint.java index c63b6b8fb9..88d75e4439 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/endpoint/annotation/MessageParameterAnnotatedEndpoint.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/endpoint/annotation/MessageParameterAnnotatedEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/test/java/org/springframework/integration/handler/CorrelationIdTests.java b/spring-integration-core/src/test/java/org/springframework/integration/handler/CorrelationIdTests.java index 38fd456107..bb547de7ff 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/handler/CorrelationIdTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/handler/CorrelationIdTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. @@ -32,7 +32,6 @@ import org.springframework.integration.message.GenericMessage; import org.springframework.integration.message.Message; import org.springframework.integration.message.StringMessage; import org.springframework.integration.router.SplitterMessageHandlerAdapter; -import org.springframework.integration.util.SimpleMethodInvoker; /** * @author Mark Fisher @@ -84,7 +83,7 @@ public class CorrelationIdTests { message.getHeader().setCorrelationId(correlationId); AbstractMessageHandlerAdapter adapter = new AbstractMessageHandlerAdapter() { @Override - protected Object doHandle(Message message, SimpleMethodInvoker invoker) { + protected Object doHandle(Message message, HandlerMethodInvoker invoker) { Object result = invoker.invokeMethod(message.getPayload()); Message resultMessage = new GenericMessage(result); resultMessage.getHeader().setCorrelationId("456-XYZ"); @@ -103,7 +102,7 @@ public class CorrelationIdTests { Message message = new StringMessage("test"); AbstractMessageHandlerAdapter adapter = new AbstractMessageHandlerAdapter() { @Override - protected Object doHandle(Message message, SimpleMethodInvoker invoker) { + protected Object doHandle(Message message, HandlerMethodInvoker invoker) { Object result = invoker.invokeMethod(message.getPayload()); Message resultMessage = new GenericMessage(result); resultMessage.getHeader().setCorrelationId("456-XYZ"); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/handler/DefaultMessageHandlerAdapterTests.java b/spring-integration-core/src/test/java/org/springframework/integration/handler/DefaultMessageHandlerAdapterTests.java index 2c2b79cddc..2132549506 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/handler/DefaultMessageHandlerAdapterTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/handler/DefaultMessageHandlerAdapterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/test/java/org/springframework/integration/handler/MessageHandlerChainTests.java b/spring-integration-core/src/test/java/org/springframework/integration/handler/MessageHandlerChainTests.java index e1d80a4903..2d4b149318 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/handler/MessageHandlerChainTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/handler/MessageHandlerChainTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. @@ -35,7 +35,7 @@ public class MessageHandlerChainTests { chain.add(new TestHandler("b")); chain.add(new TestHandler("c")); chain.add(new TestHandler("d")); - Message result = chain.handle(new StringMessage(1, "!")); + Message result = chain.handle(new StringMessage(1, "!")); assertEquals("!abcd", result.getPayload()); } @@ -49,7 +49,7 @@ public class MessageHandlerChainTests { chain.add(new TestHandler("a")); chain.add(handler4); chain.add(new TestHandler("b")); - Message result = chain.handle(new StringMessage(1, "!")); + Message result = chain.handle(new StringMessage(1, "!")); assertEquals("234!a*234b", result.getPayload()); } @@ -62,7 +62,7 @@ public class MessageHandlerChainTests { this.text = text; } - public Message handle(Message message) { + public Message handle(Message message) { return new StringMessage(1, message.getPayload() + text); } } @@ -77,7 +77,7 @@ public class MessageHandlerChainTests { this.text = text; } - public Message handle(Message message, MessageHandler target) { + public Message handle(Message message, MessageHandler target) { message = target.handle(new StringMessage(1, text + message.getPayload())); return new StringMessage(1, message.getPayload() + text); } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/handler/TestHandlers.java b/spring-integration-core/src/test/java/org/springframework/integration/handler/TestHandlers.java index 9e0de65ded..dde3ff3419 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/handler/TestHandlers.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/handler/TestHandlers.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. @@ -46,7 +46,7 @@ public abstract class TestHandlers { public final static MessageHandler rejectingHandler() { return new MessageHandler() { public Message handle(Message message) { - throw new MessageHandlerRejectedExecutionException(); + throw new MessageHandlerRejectedExecutionException(message); } }; } @@ -59,7 +59,7 @@ public abstract class TestHandlers { return new MessageHandler() { public Message handle(Message message) { latch.countDown(); - throw new MessageHandlerRejectedExecutionException(); + throw new MessageHandlerRejectedExecutionException(message); } }; } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/handler/config/DefaultMessageHandlerCreatorTests.java b/spring-integration-core/src/test/java/org/springframework/integration/handler/config/DefaultMessageHandlerCreatorTests.java index d643dd19f5..441c379614 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/handler/config/DefaultMessageHandlerCreatorTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/handler/config/DefaultMessageHandlerCreatorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/test/java/org/springframework/integration/message/GenericMessageTests.java b/spring-integration-core/src/test/java/org/springframework/integration/message/GenericMessageTests.java index 3fdf7082ae..6208b0cfab 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/message/GenericMessageTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/message/GenericMessageTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/test/java/org/springframework/integration/message/selector/PayloadTypeSelectorTests.java b/spring-integration-core/src/test/java/org/springframework/integration/message/selector/PayloadTypeSelectorTests.java index 3dc625d596..e5b5474de7 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/message/selector/PayloadTypeSelectorTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/message/selector/PayloadTypeSelectorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. @@ -21,9 +21,9 @@ import static org.junit.Assert.assertTrue; import org.junit.Test; -import org.springframework.integration.MessagingException; import org.springframework.integration.message.ErrorMessage; import org.springframework.integration.message.GenericMessage; +import org.springframework.integration.message.MessagingException; import org.springframework.integration.message.StringMessage; /** diff --git a/spring-integration-core/src/test/java/org/springframework/integration/message/selector/UnexpiredMessageSelectorTests.java b/spring-integration-core/src/test/java/org/springframework/integration/message/selector/UnexpiredMessageSelectorTests.java index c95d26ddc8..1cf6648e7a 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/message/selector/UnexpiredMessageSelectorTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/message/selector/UnexpiredMessageSelectorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/test/java/org/springframework/integration/router/AggregatingMessageHandlerTests.java b/spring-integration-core/src/test/java/org/springframework/integration/router/AggregatingMessageHandlerTests.java index 93bccb27b6..cc753ff51a 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/router/AggregatingMessageHandlerTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/router/AggregatingMessageHandlerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/test/java/org/springframework/integration/router/AggregationBarrierTests.java b/spring-integration-core/src/test/java/org/springframework/integration/router/AggregationBarrierTests.java index f15ffd3e10..25832cafed 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/router/AggregationBarrierTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/router/AggregationBarrierTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/test/java/org/springframework/integration/router/AggregatorAdapterTests.java b/spring-integration-core/src/test/java/org/springframework/integration/router/AggregatorAdapterTests.java index b52d7fb973..42f00912d5 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/router/AggregatorAdapterTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/router/AggregatorAdapterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. @@ -25,7 +25,7 @@ import org.junit.Assert; import org.junit.Before; import org.junit.Test; -import org.springframework.integration.MessagingConfigurationException; +import org.springframework.integration.ConfigurationException; import org.springframework.integration.message.GenericMessage; import org.springframework.integration.message.Message; @@ -88,50 +88,50 @@ public class AggregatorAdapterTests { Assert.assertEquals(123456789l, returnedMessge.getPayload()); } - @Test(expected=MessagingConfigurationException.class) + @Test(expected=ConfigurationException.class) public void testAdapterWithWrongMethodName() { new AggregatorAdapter(simpleAggregator, "methodThatDoesNotExist"); } - @Test(expected=MessagingConfigurationException.class) + @Test(expected=ConfigurationException.class) public void testInvalidParameterTypeUsingMethodName() { new AggregatorAdapter(simpleAggregator, "invalidParameterType"); } - @Test(expected=MessagingConfigurationException.class) + @Test(expected=ConfigurationException.class) public void testTooManyParametersUsingMethodName() { new AggregatorAdapter(simpleAggregator, "tooManyParameters"); } - @Test(expected=MessagingConfigurationException.class) + @Test(expected=ConfigurationException.class) public void testNotEnoughParametersUsingMethodName() { new AggregatorAdapter(simpleAggregator, "notEnoughParameters"); } - @Test(expected=MessagingConfigurationException.class) + @Test(expected=ConfigurationException.class) public void testCollectionSubclassParameterUsingMethodName() { new AggregatorAdapter(simpleAggregator, "collectionSubclassParameter"); } - @Test(expected=MessagingConfigurationException.class) + @Test(expected=ConfigurationException.class) public void testInvalidParameterTypeUsingMethodObject() throws SecurityException, NoSuchMethodException { new AggregatorAdapter(simpleAggregator, simpleAggregator.getClass().getMethod( "invalidParameterType", String.class)); } - @Test(expected=MessagingConfigurationException.class) + @Test(expected=ConfigurationException.class) public void testTooManyParametersUsingMethodObject() throws SecurityException, NoSuchMethodException { new AggregatorAdapter(simpleAggregator, simpleAggregator.getClass().getMethod( "tooManyParameters", Collection.class, Collection.class)); } - @Test(expected=MessagingConfigurationException.class) + @Test(expected=ConfigurationException.class) public void testNotEnoughParametersUsingMethodObject() throws SecurityException, NoSuchMethodException { new AggregatorAdapter(simpleAggregator, simpleAggregator.getClass().getMethod( "notEnoughParameters", new Class[] {} )); } - @Test(expected= MessagingConfigurationException.class) + @Test(expected= ConfigurationException.class) public void testCollectionSubclassParameterUsingMethodObject() throws SecurityException, NoSuchMethodException { new AggregatorAdapter(simpleAggregator, simpleAggregator.getClass().getMethod( "collectionSubclassParameter", new Class[] {List.class} )); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/router/MultiChannelRouterTests.java b/spring-integration-core/src/test/java/org/springframework/integration/router/MultiChannelRouterTests.java index 105432c94a..e0891173c9 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/router/MultiChannelRouterTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/router/MultiChannelRouterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. @@ -23,7 +23,8 @@ import java.util.ArrayList; import java.util.List; import org.junit.Test; -import org.springframework.integration.MessagingConfigurationException; + +import org.springframework.integration.ConfigurationException; import org.springframework.integration.channel.ChannelRegistry; import org.springframework.integration.channel.DefaultChannelRegistry; import org.springframework.integration.channel.MessageChannel; @@ -88,7 +89,7 @@ public class MultiChannelRouterTests { assertEquals("test", result2.getPayload()); } - @Test(expected=MessagingConfigurationException.class) + @Test(expected=ConfigurationException.class) public void testConfiguringBothChannelResolverAndChannelNameResolverIsNotAllowed() { MultiChannelResolver channelResolver = new MultiChannelResolver() { public List resolve(Message message) { @@ -168,7 +169,7 @@ public class MultiChannelRouterTests { router.handle(message); } - @Test(expected=MessagingConfigurationException.class) + @Test(expected=ConfigurationException.class) public void testChannelRegistryIsRequiredWhenUsingChannelNameResolver() { MultiChannelNameResolver channelNameResolver = new MultiChannelNameResolver() { public String[] resolve(Message message) { @@ -180,7 +181,7 @@ public class MultiChannelRouterTests { router.resolveChannels(new StringMessage("this should fail")); } - @Test(expected=MessagingConfigurationException.class) + @Test(expected=ConfigurationException.class) public void testValidateChannelRegistryIsPresentWhenUsingChannelNameResolver() { MultiChannelNameResolver channelNameResolver = new MultiChannelNameResolver() { public String[] resolve(Message message) { @@ -192,7 +193,7 @@ public class MultiChannelRouterTests { router.afterPropertiesSet(); } - @Test(expected=MessagingConfigurationException.class) + @Test(expected=ConfigurationException.class) public void testChannelResolverIsRequired() { ChannelRegistry channelRegistry = new DefaultChannelRegistry(); MultiChannelRouter router = new MultiChannelRouter(); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/router/PayloadTypeRouterTests.java b/spring-integration-core/src/test/java/org/springframework/integration/router/PayloadTypeRouterTests.java index 01f808b604..35e64e38c7 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/router/PayloadTypeRouterTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/router/PayloadTypeRouterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/test/java/org/springframework/integration/router/RecipientListRouterTests.java b/spring-integration-core/src/test/java/org/springframework/integration/router/RecipientListRouterTests.java index d244085440..4d32591742 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/router/RecipientListRouterTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/router/RecipientListRouterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. @@ -25,7 +25,7 @@ import java.util.List; import org.junit.Test; -import org.springframework.integration.MessagingConfigurationException; +import org.springframework.integration.ConfigurationException; import org.springframework.integration.channel.ChannelRegistry; import org.springframework.integration.channel.DefaultChannelRegistry; import org.springframework.integration.channel.MessageChannel; @@ -99,7 +99,7 @@ public class RecipientListRouterTests { assertNull(result2); } - @Test(expected=MessagingConfigurationException.class) + @Test(expected=ConfigurationException.class) public void testConfigurationExceptionWhenBothChannelsAndNamesAreProvided() { SimpleChannel channel1 = new SimpleChannel(); SimpleChannel channel2 = new SimpleChannel(); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/router/RouterMessageHandlerAdapterTests.java b/spring-integration-core/src/test/java/org/springframework/integration/router/RouterMessageHandlerAdapterTests.java index 65158f2c62..64174ad183 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/router/RouterMessageHandlerAdapterTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/router/RouterMessageHandlerAdapterTests.java @@ -28,7 +28,7 @@ import java.util.concurrent.ConcurrentHashMap; import org.junit.Test; -import org.springframework.integration.MessagingConfigurationException; +import org.springframework.integration.ConfigurationException; import org.springframework.integration.channel.ChannelRegistry; import org.springframework.integration.channel.ChannelRegistryAware; import org.springframework.integration.channel.DefaultChannelRegistry; @@ -114,7 +114,7 @@ public class RouterMessageHandlerAdapterTests { assertEquals("bar", message3.getPayload()); } - @Test(expected=MessagingConfigurationException.class) + @Test(expected=ConfigurationException.class) public void testFailsWhenPropertyAndAttributeAreBothProvided() throws Exception { SingleChannelNameRoutingTestBean testBean = new SingleChannelNameRoutingTestBean(); Method routingMethod = testBean.getClass().getMethod("routePayload", String.class); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/router/SequenceSizeCompletionStrategyTests.java b/spring-integration-core/src/test/java/org/springframework/integration/router/SequenceSizeCompletionStrategyTests.java index d41755248f..bfbb867c86 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/router/SequenceSizeCompletionStrategyTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/router/SequenceSizeCompletionStrategyTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-core/src/test/java/org/springframework/integration/router/SingleChannelRouterTests.java b/spring-integration-core/src/test/java/org/springframework/integration/router/SingleChannelRouterTests.java index 27b8d3cb83..458b41e6c4 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/router/SingleChannelRouterTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/router/SingleChannelRouterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. @@ -21,7 +21,7 @@ import static org.junit.Assert.assertNotNull; import org.junit.Test; -import org.springframework.integration.MessagingConfigurationException; +import org.springframework.integration.ConfigurationException; import org.springframework.integration.channel.ChannelRegistry; import org.springframework.integration.channel.DefaultChannelRegistry; import org.springframework.integration.channel.MessageChannel; @@ -74,7 +74,7 @@ public class SingleChannelRouterTests { assertEquals("test", result.getPayload()); } - @Test(expected=MessagingConfigurationException.class) + @Test(expected=ConfigurationException.class) public void testConfiguringBothChannelResolverAndChannelNameResolverIsNotAllowed() { ChannelResolver channelResolver = new ChannelResolver() { public MessageChannel resolve(Message message) { @@ -154,7 +154,7 @@ public class SingleChannelRouterTests { router.handle(message); } - @Test(expected=MessagingConfigurationException.class) + @Test(expected=ConfigurationException.class) public void testChannelRegistryIsRequiredWhenUsingChannelNameResolver() { ChannelNameResolver channelNameResolver = new ChannelNameResolver() { public String resolve(Message message) { @@ -166,7 +166,7 @@ public class SingleChannelRouterTests { router.resolveChannels(new StringMessage("this should fail")); } - @Test(expected=MessagingConfigurationException.class) + @Test(expected=ConfigurationException.class) public void testValidateChannelRegistryIsPresentWhenUsingChannelNameResolver() { ChannelNameResolver channelNameResolver = new ChannelNameResolver() { public String resolve(Message message) { @@ -178,7 +178,7 @@ public class SingleChannelRouterTests { router.afterPropertiesSet(); } - @Test(expected=MessagingConfigurationException.class) + @Test(expected=ConfigurationException.class) public void testChannelResolverIsRequired() { ChannelRegistry channelRegistry = new DefaultChannelRegistry(); SingleChannelRouter router = new SingleChannelRouter(); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/router/SplitterMessageHandlerAdapterTests.java b/spring-integration-core/src/test/java/org/springframework/integration/router/SplitterMessageHandlerAdapterTests.java index 65a8f7723c..d98968b90a 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/router/SplitterMessageHandlerAdapterTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/router/SplitterMessageHandlerAdapterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. @@ -28,7 +28,7 @@ import java.util.concurrent.ConcurrentHashMap; import org.junit.Test; -import org.springframework.integration.MessagingConfigurationException; +import org.springframework.integration.ConfigurationException; import org.springframework.integration.channel.ChannelRegistry; import org.springframework.integration.channel.DefaultChannelRegistry; import org.springframework.integration.channel.SimpleChannel; @@ -159,7 +159,7 @@ public class SplitterMessageHandlerAdapterTests { assertEquals("bar", reply2.getPayload()); } - @Test(expected=MessagingConfigurationException.class) + @Test(expected=ConfigurationException.class) public void testInvalidReturnType() throws Exception { Method splittingMethod = this.testBean.getClass().getMethod("invalidParameterCount", String.class, String.class); SplitterMessageHandlerAdapter adapter = new SplitterMessageHandlerAdapter(testBean, splittingMethod, attribs); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/transformer/MessageFilterTests.java b/spring-integration-core/src/test/java/org/springframework/integration/transformer/MessageFilterTests.java index 9163c1780d..f9af9e42f5 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/transformer/MessageFilterTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/transformer/MessageFilterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * 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. diff --git a/spring-integration-ws/src/main/java/org/springframework/integration/ws/adapter/SimpleWebServiceTargetAdapter.java b/spring-integration-ws/src/main/java/org/springframework/integration/ws/adapter/SimpleWebServiceTargetAdapter.java index 07ab794016..df0bf25389 100644 --- a/spring-integration-ws/src/main/java/org/springframework/integration/ws/adapter/SimpleWebServiceTargetAdapter.java +++ b/spring-integration-ws/src/main/java/org/springframework/integration/ws/adapter/SimpleWebServiceTargetAdapter.java @@ -24,7 +24,7 @@ import javax.xml.transform.TransformerException; import javax.xml.transform.dom.DOMResult; import javax.xml.transform.dom.DOMSource; -import org.springframework.integration.message.MessageHandlingException; +import org.springframework.integration.message.MessagingException; import org.springframework.ws.client.core.SourceExtractor; import org.springframework.ws.client.core.WebServiceMessageCallback; import org.springframework.xml.transform.StringResult; @@ -63,7 +63,7 @@ public class SimpleWebServiceTargetAdapter extends AbstractWebServiceTargetAdapt new StringSource((String) requestPayload), requestCallback, result); return result.toString(); } - throw new MessageHandlingException("Unsupported payload type '" + requestPayload.getClass() + + throw new MessagingException("Unsupported payload type '" + requestPayload.getClass() + "'. " + this.getClass().getName() + " only supports 'java.lang.String' and '" + Source.class.getName() + "'. Consider using the '" + MarshallingWebServiceTargetAdapter.class.getName() + "' instead."); } diff --git a/spring-integration-ws/src/main/java/org/springframework/integration/ws/config/WebServiceTargetAdapterParser.java b/spring-integration-ws/src/main/java/org/springframework/integration/ws/config/WebServiceTargetAdapterParser.java index 295051a26a..bdfa0948e9 100644 --- a/spring-integration-ws/src/main/java/org/springframework/integration/ws/config/WebServiceTargetAdapterParser.java +++ b/spring-integration-ws/src/main/java/org/springframework/integration/ws/config/WebServiceTargetAdapterParser.java @@ -24,7 +24,7 @@ import org.springframework.beans.factory.support.BeanDefinitionBuilder; import org.springframework.beans.factory.support.RootBeanDefinition; import org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser; import org.springframework.beans.factory.xml.ParserContext; -import org.springframework.integration.MessagingConfigurationException; +import org.springframework.integration.ConfigurationException; import org.springframework.integration.endpoint.DefaultMessageEndpoint; import org.springframework.integration.scheduling.Subscription; import org.springframework.integration.ws.adapter.MarshallingWebServiceTargetAdapter; @@ -54,10 +54,10 @@ public class WebServiceTargetAdapterParser extends AbstractSingleBeanDefinitionP String channel = element.getAttribute("channel"); String uri = element.getAttribute("uri"); if (!StringUtils.hasText(channel)) { - throw new MessagingConfigurationException("The 'channel' attribute is required."); + throw new ConfigurationException("The 'channel' attribute is required."); } if (!StringUtils.hasText(uri)) { - throw new MessagingConfigurationException("The 'uri' attribute is required."); + throw new ConfigurationException("The 'uri' attribute is required."); } String marshallerRef = element.getAttribute("marshaller"); String unmarshallerRef = element.getAttribute("unmarshaller");