INT-1477 restructuring samples repo to have basic, intermediate, advancedand applications directories
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Copyright 2002-2010 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.jms;
|
||||
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
|
||||
/**
|
||||
* A simple bootstrap main() method for starting a pair of JMS Channel
|
||||
* Adapters. Text entered in the console will go through an outbound
|
||||
* JMS Channel Adapter from which it is sent to a JMS Destination.
|
||||
* An inbound JMS Channel Adapter is listening to that same JMS
|
||||
* Destination and will echo the result in the console.
|
||||
* <p>
|
||||
* See the configuration in the three XML files that are referenced below.
|
||||
*
|
||||
* @author Mark Fisher
|
||||
*/
|
||||
public class ChannelAdapterDemo {
|
||||
|
||||
private final static String[] configFiles = {
|
||||
"/META-INF/spring/integration/common.xml",
|
||||
"/META-INF/spring/integration/inboundChannelAdapter.xml",
|
||||
"/META-INF/spring/integration/outboundChannelAdapter.xml"
|
||||
};
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
ActiveMqTestUtils.prepare();
|
||||
new ClassPathXmlApplicationContext(configFiles, ChannelAdapterDemo.class);
|
||||
System.out.println("Please type something and hit return");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Copyright 2002-2010 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.jms;
|
||||
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
|
||||
/**
|
||||
* A simple bootstrap main() method for starting a pair of JMS Gateways.
|
||||
* Text entered in the console will go through an outbound JMS Gateway from
|
||||
* which it is sent to a JMS Destination. An inbound JMS Gateway is listening
|
||||
* to that same JMS Destination and will send the text to another Spring
|
||||
* Integration channel where it is handled by a service that simply converts
|
||||
* the text to upper case. The upper-case result is then sent in a response
|
||||
* message over JMS so that the outbound Gateway receives it as the reply to
|
||||
* its original request. At that point, the text is logged to the console.
|
||||
* <p>
|
||||
* See the configuration in the three XML files that are referenced below.
|
||||
*
|
||||
* @author Mark Fisher
|
||||
*/
|
||||
public class GatewayDemo {
|
||||
|
||||
private final static String[] configFiles = {
|
||||
"/META-INF/spring/integration/common.xml",
|
||||
"/META-INF/spring/integration/inboundGateway.xml",
|
||||
"/META-INF/spring/integration/outboundGateway.xml"
|
||||
};
|
||||
|
||||
public static void main(String[] args) {
|
||||
ActiveMqTestUtils.prepare();
|
||||
new ClassPathXmlApplicationContext(configFiles, GatewayDemo.class);
|
||||
System.out.println("Please type something and hit return");
|
||||
}
|
||||
|
||||
}
|
||||
36
basic/jms/src/test/resources/log4j.xml
Normal file
36
basic/jms/src/test/resources/log4j.xml
Normal file
@@ -0,0 +1,36 @@
|
||||
<?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.samples">
|
||||
<level value="debug" />
|
||||
</logger>
|
||||
|
||||
<logger name="org.springframework.integration.jms">
|
||||
<level value="warn" />
|
||||
</logger>
|
||||
|
||||
<logger name="org.apache.activemq">
|
||||
<level value="warn" />
|
||||
</logger>
|
||||
|
||||
<!-- Root Logger -->
|
||||
<root>
|
||||
<priority value="warn" />
|
||||
<appender-ref ref="console" />
|
||||
</root>
|
||||
|
||||
</log4j:configuration>
|
||||
Reference in New Issue
Block a user