INT-729 Added log4j configuration to the quote, ws, and xml samples.

This commit is contained in:
Mark Fisher
2009-07-16 23:09:43 +00:00
parent cb0307a12b
commit 1be9b86a59
12 changed files with 129 additions and 19 deletions

View File

@@ -0,0 +1,32 @@
<?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>
<logger name="org.springframework.integration.xml">
<level value="warn" />
</logger>
<!-- Root Logger -->
<root>
<priority value="warn" />
<appender-ref ref="console" />
</root>
</log4j:configuration>

View File

@@ -13,18 +13,20 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.integration.samples.xml;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.integration.core.MessageChannel;
import org.springframework.integration.message.GenericMessage;
import org.w3c.dom.Document;
/**
* This example demonstrates the processing of an order for books using

View File

@@ -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.
@@ -13,13 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.integration.samples.xml;
import org.w3c.dom.Document;
public class ExternalResupply {
public void orderResupply(Document resupplyOrder){
public void orderResupply(Document resupplyOrder) {
System.out.println("Placing resupply order: " + XmlUtil.docAsString(resupplyOrder));
}

View File

@@ -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.
@@ -13,15 +13,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.integration.samples.xml;
import org.springframework.xml.xpath.XPathExpression;
import org.w3c.dom.Document;
import org.springframework.xml.xpath.XPathExpression;
/**
*
* @author Jonas Partner
*
*/
public class StockChecker {

View File

@@ -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.
@@ -13,16 +13,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.integration.samples.xml;
import org.w3c.dom.Document;
public class WarehouseDispatch {
public void dispatch(Document orderItem){
System.out.println("Warehouse dispatching orderItem: " + XmlUtil.docAsString(orderItem));
}
}

View File

@@ -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.
@@ -13,15 +13,20 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.integration.samples.xml;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import org.springframework.xml.transform.StringResult;
import org.w3c.dom.Document;
import org.springframework.xml.transform.StringResult;
/**
* @author Jonas Partner
*/
public class XmlUtil {
public static String docAsString(Document doc) {

View File

@@ -69,7 +69,4 @@
<si:outbound-channel-adapter ref="externalResupply" method="orderResupply" channel="resupplyOrderChannel" />
<bean id="externalResupply" class="org.springframework.integration.samples.xml.ExternalResupply" />
</beans>