Modifying test beans to no longer implement MessageHandler.

This commit is contained in:
Mark Fisher
2008-09-05 02:32:36 +00:00
parent ae161208cd
commit 4ea9f755e0
4 changed files with 5 additions and 47 deletions

View File

@@ -16,16 +16,15 @@
package org.springframework.integration.config;
import org.springframework.integration.handler.MessageHandler;
import org.springframework.integration.message.Message;
import org.springframework.integration.message.MessageHandlingException;
/**
* @author Mark Fisher
*/
public class ExceptionThrowingTestHandler implements MessageHandler {
public class ExceptionThrowingTestBean {
public Message<?> handle(Message<?> message) {
public void handle(Message<?> message) {
throw new MessageHandlingException(message, "intentional test failure");
}

View File

@@ -1,40 +0,0 @@
/*
* Copyright 2002-2008 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.integration.config;
import org.springframework.integration.handler.MessageHandler;
import org.springframework.integration.message.Message;
import org.springframework.integration.message.StringMessage;
/**
* @author Mark Fisher
*/
public class TestConcatenatingHandler implements MessageHandler {
private String value;
public TestConcatenatingHandler(String value) {
this.value = value;
}
public Message<?> handle(Message<?> message) {
return new StringMessage(message.getPayload() + this.value);
}
}

View File

@@ -18,14 +18,13 @@ package org.springframework.integration.config;
import java.util.concurrent.CountDownLatch;
import org.springframework.integration.handler.MessageHandler;
import org.springframework.integration.message.Message;
import org.springframework.integration.message.StringMessage;
/**
* @author Mark Fisher
*/
public class TestHandler implements MessageHandler {
public class TestHandler {
private String messageString;

View File

@@ -11,9 +11,9 @@
<channel id="channel"/>
<service-activator id="endpoint" input-channel="channel" ref="handler" error-handler="errorHandler"/>
<service-activator id="endpoint" input-channel="channel" ref="testBean" error-handler="errorHandler"/>
<beans:bean id="handler" class="org.springframework.integration.config.ExceptionThrowingTestHandler"/>
<beans:bean id="testBean" class="org.springframework.integration.config.ExceptionThrowingTestBean"/>
<beans:bean id="errorHandler" class="org.springframework.integration.config.TestErrorHandler"/>