Added a simple endpoint (Exclaimer) to the FileCopy demo.

This commit is contained in:
Mark Fisher
2008-01-04 15:42:35 +00:00
parent 004baebd10
commit 7f7391c9c2
2 changed files with 41 additions and 4 deletions

View File

@@ -0,0 +1,28 @@
/*
* 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.samples.filecopy;
/**
* @author Mark Fisher
*/
public class Exclaimer {
public String exclaim(String input) {
return input.toUpperCase() + "!!!";
}
}

View File

@@ -9,12 +9,21 @@
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
<bean class="org.springframework.integration.bus.MessageBus"/>
<si:message-bus/>
<bean id="channel" class="org.springframework.integration.channel.PointToPointChannel"/>
<si:channel id="channel1"/>
<si:file-source directory="${java.io.tmpdir}/spring-integration-samples/input" channel="channel" poll-period="10000"/>
<si:channel id="channel2"/>
<si:file-target directory="${java.io.tmpdir}/spring-integration-samples/output" channel="channel"/>
<si:file-source directory="${java.io.tmpdir}/spring-integration-samples/input"
channel="channel1" poll-period="10000"/>
<si:endpoint input-channel="channel1" default-output-channel="channel2"
handler-ref="exclaimer" handler-method="exclaim"/>
<si:file-target directory="${java.io.tmpdir}/spring-integration-samples/output"
channel="channel2"/>
<bean id="exclaimer" class="org.springframework.integration.samples.filecopy.Exclaimer"/>
</beans>