INT-1282, Updated licensing information (year), removed bundle activator from 'cafe' sample, added readme.txt and util class to clean up Active MQ to 'jms' sample, other minor polishing

This commit is contained in:
Oleg Zhurakousky
2010-07-27 16:18:35 +00:00
parent 19dc3bb897
commit efff839537
34 changed files with 104 additions and 116 deletions

View File

@@ -15,22 +15,22 @@ Instructions for running the CafeDemo sample
. . . . . . . . . . . . .
System.out I -----------------------
[2009-07-11 01:43:04.614] task-scheduler-3 System.out I Order #1
[2009-07-11 01:43:04.614] task-scheduler-3 System.out I Iced MOCHA, 3 shots.
[2009-07-11 01:43:04.614] task-scheduler-3 System.out I Hot LATTE, 2 shots.
[2009-07-11 01:43:04.614] task-scheduler-3 System.out I -----------------------
[2009-07-11 01:43:04.618] task-scheduler-2 System.out I task-scheduler-2 prepared cold drink #5 for order #5: iced 3 shot MOCHA
[2009-07-11 01:43:05.618] task-scheduler-2 System.out I task-scheduler-2 prepared cold drink #6 for order #6: iced 3 shot MOCHA
[2009-07-11 01:43:06.618] task-scheduler-2 System.out I task-scheduler-2 prepared cold drink #7 for order #7: iced 3 shot MOCHA
[2009-07-11 01:43:07.619] task-scheduler-2 System.out I task-scheduler-2 prepared cold drink #8 for order #8: iced 3 shot MOCHA
[2009-07-11 01:43:08.619] task-scheduler-2 System.out I task-scheduler-2 prepared cold drink #9 for order #9: iced 3 shot MOCHA
[2009-07-11 01:43:09.614] task-scheduler-3 System.out I task-scheduler-3 prepared hot drink #2 for order #2: hot 2 shot LATTE
[2009-07-11 01:43:09.615] task-scheduler-3 System.out I -----------------------
[2009-07-11 01:43:09.615] task-scheduler-3 System.out I Order #2
[2009-07-11 01:43:09.615] task-scheduler-3 System.out I Iced MOCHA, 3 shots.
[2009-07-11 01:43:09.615] task-scheduler-3 System.out I Hot LATTE, 2 shots.
[2009-07-11 01:43:09.615] task-scheduler-3 System.out I -----------------------
[2009-07-11 01:43:09.620] task-scheduler-2 System.out I task-scheduler-2 prepared cold
[2010-07-11 01:43:04.614] task-scheduler-3 System.out I Order #1
[2010-07-11 01:43:04.614] task-scheduler-3 System.out I Iced MOCHA, 3 shots.
[2010-07-11 01:43:04.614] task-scheduler-3 System.out I Hot LATTE, 2 shots.
[2010-07-11 01:43:04.614] task-scheduler-3 System.out I -----------------------
[2010-07-11 01:43:04.618] task-scheduler-2 System.out I task-scheduler-2 prepared cold drink #5 for order #5: iced 3 shot MOCHA
[2010-07-11 01:43:05.618] task-scheduler-2 System.out I task-scheduler-2 prepared cold drink #6 for order #6: iced 3 shot MOCHA
[2010-07-11 01:43:06.618] task-scheduler-2 System.out I task-scheduler-2 prepared cold drink #7 for order #7: iced 3 shot MOCHA
[2010-07-11 01:43:07.619] task-scheduler-2 System.out I task-scheduler-2 prepared cold drink #8 for order #8: iced 3 shot MOCHA
[2010-07-11 01:43:08.619] task-scheduler-2 System.out I task-scheduler-2 prepared cold drink #9 for order #9: iced 3 shot MOCHA
[2010-07-11 01:43:09.614] task-scheduler-3 System.out I task-scheduler-3 prepared hot drink #2 for order #2: hot 2 shot LATTE
[2010-07-11 01:43:09.615] task-scheduler-3 System.out I -----------------------
[2010-07-11 01:43:09.615] task-scheduler-3 System.out I Order #2
[2010-07-11 01:43:09.615] task-scheduler-3 System.out I Iced MOCHA, 3 shots.
[2010-07-11 01:43:09.615] task-scheduler-3 System.out I Hot LATTE, 2 shots.
[2010-07-11 01:43:09.615] task-scheduler-3 System.out I -----------------------
[2010-07-11 01:43:09.620] task-scheduler-2 System.out I task-scheduler-2 prepared cold
. . . . . . . . . . . . .
Happy integration :-)

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2008 the original author or authors.
* 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.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2008 the original author or authors.
* 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.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2008 the original author or authors.
* 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.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2008 the original author or authors.
* 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.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2008 the original author or authors.
* 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.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2008 the original author or authors.
* 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.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2008 the original author or authors.
* 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.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2009 the original author or authors.
* 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.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2008 the original author or authors.
* 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.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2008 the original author or authors.
* 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.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2008 the original author or authors.
* 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.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2009 the original author or authors.
* 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.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2008 the original author or authors.
* 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.

View File

@@ -1,63 +0,0 @@
/*
* 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.
* 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.osgi.cafe;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.Constants;
import org.osgi.framework.ServiceEvent;
import org.osgi.framework.ServiceListener;
import org.osgi.framework.ServiceReference;
import org.springframework.context.ApplicationContext;
import org.springframework.integration.samples.cafe.xml.CafeDemo;
/**
* An OSGi BundleActivator which will register a ServiceListener to listen for
* an ApplicationContext published event. Once the event is received, the
* CafeDemo will be executed.
*
* @author Oleg Zhurakousky
* @since 1.0.3
*/
public class CafeBundleActivator implements BundleActivator, ServiceListener{
private BundleContext context;
public void start(BundleContext context) throws Exception {
this.context = context;
context.addServiceListener(this);
}
public void stop(BundleContext context) throws Exception {}
public void serviceChanged(ServiceEvent serviceEvent) {
ServiceReference sr = serviceEvent.getServiceReference();
if (context.getBundle().getSymbolicName().equals(sr.getProperty(Constants.BUNDLE_SYMBOLICNAME))) {
final ApplicationContext applicationContext = (ApplicationContext) context.getService(sr);
ExecutorService executor = Executors.newCachedThreadPool();
executor.execute(new Runnable() {
public void run() {
new CafeDemo().performDemo(applicationContext, 20);
}
});
}
}
}

View File

@@ -1,5 +1,5 @@
/**
* Copyright 2002-2009 the original author or authors.
* 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.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2009 the original author or authors.
* 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.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2009 the original author or authors.
* 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.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2009 the original author or authors.
* 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.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2009 the original author or authors.
* 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.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2009 the original author or authors.
* 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.

View File

@@ -0,0 +1,9 @@
Instructions for running the HelloWorldDemo sample
-------------------------------------------------------------------------------
1. See README.txt in the parent directory.
This demo consists of two samples, ChannelAdapterDemo and GatewayDemo.
PLease see the corresponding javadocs for more details on each sample.
Happy integration :-)

View File

@@ -0,0 +1,46 @@
/*
* 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 java.io.File;
/**
* @author Oleg Zhurakousky
*
*/
public class ActiveMqTestUtils {
public static void prepare() {
System.out.println("####### Refreshing ActiveMq ########");
File activeMqTempDir = new File("activemq-data");
deleteDir(activeMqTempDir);
}
/*
*
*/
private static void deleteDir(File directory){
if (directory.exists()){
String[] children = directory.list();
if (children != null){
for (int i=0; i < children.length; i++) {
deleteDir(new File(directory, children[i]));
}
}
}
directory.delete();
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2009 the original author or authors.
* 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.
@@ -37,6 +37,7 @@ public class ChannelAdapterDemo {
public static void main(String[] args) {
ActiveMqTestUtils.prepare();
new ClassPathXmlApplicationContext(configFiles, ChannelAdapterDemo.class);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2009 the original author or authors.
* 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.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2009 the original author or authors.
* 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.
@@ -40,6 +40,7 @@ public class GatewayDemo {
public static void main(String[] args) {
ActiveMqTestUtils.prepare();
new ClassPathXmlApplicationContext(configFiles, GatewayDemo.class);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2009 the original author or authors.
* 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.

View File

@@ -1,15 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="ws-inbound-gateway">
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<wb-resource deploy-path="/" source-path="/src/main/webapp"/>
<dependent-module deploy-path="/WEB-INF/lib" handle="module:/resource/spring-integration-xml/spring-integration-xml">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module deploy-path="/WEB-INF/lib" handle="module:/resource/spring-integration-core/spring-integration-core">
<dependency-type>uses</dependency-type>
</dependent-module>
<property name="java-output-path" value="/ws-inbound-gateway/target/classes"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<property name="context-root" value="ws-inbound-gateway"/>
<property name="java-output-path" value="/ws-inbound-gateway/target/classes"/>
</wb-module>
</project-modules>

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2009 the original author or authors.
* 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.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2009 the original author or authors.
* 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.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2009 the original author or authors.
* 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.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2009 the original author or authors.
* 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.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2009 the original author or authors.
* 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.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2009 the original author or authors.
* 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.