INT-729 Added log4j configuration to the File copy samples.
This commit is contained in:
28
spring-integration-samples/filecopy/src/main/java/log4j.xml
Normal file
28
spring-integration-samples/filecopy/src/main/java/log4j.xml
Normal file
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
|
||||
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
|
||||
|
||||
<!-- Appenders -->
|
||||
<appender name="console" class="org.apache.log4j.ConsoleAppender">
|
||||
<param name="Target" value="System.out" />
|
||||
<layout class="org.apache.log4j.PatternLayout">
|
||||
<param name="ConversionPattern" value="%-5p: %c - %m%n" />
|
||||
</layout>
|
||||
</appender>
|
||||
|
||||
<!-- Loggers -->
|
||||
<logger name="org.springframework">
|
||||
<level value="warn" />
|
||||
</logger>
|
||||
|
||||
<logger name="org.springframework.integration">
|
||||
<level value="warn" />
|
||||
</logger>
|
||||
|
||||
<!-- Root Logger -->
|
||||
<root>
|
||||
<priority value="warn" />
|
||||
<appender-ref ref="console" />
|
||||
</root>
|
||||
|
||||
</log4j:configuration>
|
||||
@@ -20,7 +20,9 @@ import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
|
||||
/**
|
||||
* Demonstrating the file copy scenario using binary file source and target.
|
||||
* See the 'fileCopyDemo-binary.xml' configuration file for details.
|
||||
* See the 'fileCopyDemo-binary.xml' configuration file for details. Notice
|
||||
* that the transformer is configured to delete the source File after it
|
||||
* extracts the content as a byte array.
|
||||
*
|
||||
* @author Marius Bogoevici
|
||||
*/
|
||||
|
||||
@@ -31,6 +31,7 @@ public class FileCopyDemoCommon {
|
||||
File outDir = new File(baseDir, "output");
|
||||
System.out.println("Input directory is: " + inDir.getAbsolutePath());
|
||||
System.out.println("Output directory is: " + outDir.getAbsolutePath());
|
||||
System.out.println("===================================================");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2008 the original author or authors.
|
||||
* Copyright 2002-2009 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,19 +24,19 @@ import java.io.File;
|
||||
* @author Mark Fisher
|
||||
* @author Marius Bogoevici
|
||||
*/
|
||||
public class Exclaimer {
|
||||
public class Handler {
|
||||
|
||||
public String exclaim(String input) {
|
||||
public String handleString(String input) {
|
||||
System.out.println("Copying text: " + input);
|
||||
return input.toUpperCase();
|
||||
}
|
||||
|
||||
public File exclaim(File input) {
|
||||
public File handleFile(File input) {
|
||||
System.out.println("Copying file: " + input.getAbsolutePath());
|
||||
return input;
|
||||
}
|
||||
|
||||
public byte[] exclaim(byte[] input) {
|
||||
public byte[] handleBytes(byte[] input) {
|
||||
System.out.println("Copying " + input.length + " bytes ...");
|
||||
return new String(input).toUpperCase().getBytes();
|
||||
}
|
||||
@@ -21,11 +21,11 @@
|
||||
|
||||
<integration:service-activator input-channel="bytes"
|
||||
output-channel="filesOut"
|
||||
ref="exclaimer" method="exclaim"/>
|
||||
ref="handler"/>
|
||||
|
||||
<file:outbound-channel-adapter id="filesOut" directory="${java.io.tmpdir}/spring-integration-samples/output"/>
|
||||
|
||||
<bean id="exclaimer" class="org.springframework.integration.samples.filecopy.Exclaimer"/>
|
||||
<bean id="handler" class="org.springframework.integration.samples.filecopy.Handler"/>
|
||||
|
||||
<integration:poller id="poller" default="true">
|
||||
<integration:interval-trigger interval="5000"/>
|
||||
|
||||
@@ -21,10 +21,10 @@
|
||||
|
||||
<integration:service-activator input-channel="filesIn"
|
||||
output-channel="filesOut"
|
||||
ref="exclaimer" method="exclaim"/>
|
||||
ref="handler"/>
|
||||
|
||||
<file:outbound-channel-adapter id="filesOut" directory="${java.io.tmpdir}/spring-integration-samples/output"/>
|
||||
|
||||
<bean id="exclaimer" class="org.springframework.integration.samples.filecopy.Exclaimer"/>
|
||||
<bean id="handler" class="org.springframework.integration.samples.filecopy.Handler"/>
|
||||
|
||||
</beans>
|
||||
|
||||
@@ -26,10 +26,10 @@
|
||||
|
||||
<integration:service-activator input-channel="strings"
|
||||
output-channel="filesOut"
|
||||
ref="exclaimer" method="exclaim"/>
|
||||
ref="handler"/>
|
||||
|
||||
<file:outbound-channel-adapter id="filesOut" directory="${java.io.tmpdir}/spring-integration-samples/output"/>
|
||||
|
||||
<bean id="exclaimer" class="org.springframework.integration.samples.filecopy.Exclaimer"/>
|
||||
<bean id="handler" class="org.springframework.integration.samples.filecopy.Handler"/>
|
||||
|
||||
</beans>
|
||||
|
||||
Reference in New Issue
Block a user