From b63ee532974b39c4877e983c7af7aa0a48014f78 Mon Sep 17 00:00:00 2001 From: Oleg Zhurakousky Date: Thu, 13 Jan 2011 15:51:48 -0500 Subject: [PATCH] INT-1716 moved ControlBus sample to its own project --- basic/control-bus/.classpath | 10 +++ basic/control-bus/.gitignore | 1 + basic/control-bus/.project | 23 +++++++ .../.settings/org.eclipse.jdt.core.prefs | 13 ++++ .../.settings/org.maven.ide.eclipse.prefs | 9 +++ basic/control-bus/pom.xml | 65 +++++++++++++++++++ basic/control-bus/readme.txt | 12 ++++ .../integration/ControlBusDemo-context.xml | 0 .../controlbus}/ControlBusDemoTest.java | 2 +- .../control-bus/src/test/resources/log4j.xml | 28 ++++++++ basic/jmx/.springBeans | 1 - basic/jmx/readme.txt | 12 ---- 12 files changed, 162 insertions(+), 14 deletions(-) create mode 100644 basic/control-bus/.classpath create mode 100644 basic/control-bus/.gitignore create mode 100644 basic/control-bus/.project create mode 100644 basic/control-bus/.settings/org.eclipse.jdt.core.prefs create mode 100644 basic/control-bus/.settings/org.maven.ide.eclipse.prefs create mode 100644 basic/control-bus/pom.xml create mode 100644 basic/control-bus/readme.txt rename basic/{jmx => control-bus}/src/main/resources/META-INF/spring/integration/ControlBusDemo-context.xml (100%) rename basic/{jmx/src/test/java/org/springframework/integration/samples/jmx => control-bus/src/test/java/org/springframework/integration/samples/controlbus}/ControlBusDemoTest.java (96%) create mode 100644 basic/control-bus/src/test/resources/log4j.xml diff --git a/basic/control-bus/.classpath b/basic/control-bus/.classpath new file mode 100644 index 00000000..96489ff1 --- /dev/null +++ b/basic/control-bus/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/basic/control-bus/.gitignore b/basic/control-bus/.gitignore new file mode 100644 index 00000000..ea8c4bf7 --- /dev/null +++ b/basic/control-bus/.gitignore @@ -0,0 +1 @@ +/target diff --git a/basic/control-bus/.project b/basic/control-bus/.project new file mode 100644 index 00000000..6a53a1df --- /dev/null +++ b/basic/control-bus/.project @@ -0,0 +1,23 @@ + + + control-bus + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.maven.ide.eclipse.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.maven.ide.eclipse.maven2Nature + + diff --git a/basic/control-bus/.settings/org.eclipse.jdt.core.prefs b/basic/control-bus/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..9e8a2f6a --- /dev/null +++ b/basic/control-bus/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,13 @@ +#Thu Jan 13 15:48:03 EST 2011 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/basic/control-bus/.settings/org.maven.ide.eclipse.prefs b/basic/control-bus/.settings/org.maven.ide.eclipse.prefs new file mode 100644 index 00000000..1587a73e --- /dev/null +++ b/basic/control-bus/.settings/org.maven.ide.eclipse.prefs @@ -0,0 +1,9 @@ +#Thu Jan 13 15:43:24 EST 2011 +activeProfiles= +eclipse.preferences.version=1 +fullBuildGoals=process-test-resources +includeModules=false +resolveWorkspaceProjects=true +resourceFilterGoals=process-resources resources\:testResources +skipCompilerPlugin=true +version=1 diff --git a/basic/control-bus/pom.xml b/basic/control-bus/pom.xml new file mode 100644 index 00000000..fcc1c1bf --- /dev/null +++ b/basic/control-bus/pom.xml @@ -0,0 +1,65 @@ + + + 4.0.0 + org.springframework.integration.samples + control-bus + 2.0.0 + Spring Integration Hello World Sample + jar + + 2.0.2.BUILD-SNAPSHOT + 1.2.16 + 4.7 + + + + org.springframework.integration + spring-integration-core + ${spring.integration.version} + + + log4j + log4j + ${log4j.version} + + + + junit + junit + ${junit.version} + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + 1.5 + 1.5 + -Xlint:all + true + false + + + + + + + repository.springframework.maven.release + Spring Framework Maven Release Repository + http://maven.springframework.org/release + + + repository.springframework.maven.milestone + Spring Framework Maven Milestone Repository + http://maven.springframework.org/milestone + + + repository.springframework.maven.snapshot + Spring Framework Maven Snapshot Repository + http://maven.springframework.org/snapshot + + + \ No newline at end of file diff --git a/basic/control-bus/readme.txt b/basic/control-bus/readme.txt new file mode 100644 index 00000000..0fcc77a7 --- /dev/null +++ b/basic/control-bus/readme.txt @@ -0,0 +1,12 @@ +This example demonstrates the functionality of the Control Bus component available with Spring Integration: + +Control Bus uses SpEL to send a Control Message to start/stop and inbound adapter + +To run Control Bus sample simple execute ControlBusDemoTest + +You will see the output similar to this + +INFO : org.springframework.integration.samples.jmx.ControlBusDemo - Received before adapter started: null +INFO : org.springframework.integration.samples.jmx.ControlBusDemo - Received before adapter started: [Payload=Hello][Headers={timestamp=1294950897714, id=240e72fb-93b0-4d38-8fe8-b701cf7e9a5d}] +INFO : org.springframework.integration.samples.jmx.ControlBusDemo - Received after adapter stopped: null + diff --git a/basic/jmx/src/main/resources/META-INF/spring/integration/ControlBusDemo-context.xml b/basic/control-bus/src/main/resources/META-INF/spring/integration/ControlBusDemo-context.xml similarity index 100% rename from basic/jmx/src/main/resources/META-INF/spring/integration/ControlBusDemo-context.xml rename to basic/control-bus/src/main/resources/META-INF/spring/integration/ControlBusDemo-context.xml diff --git a/basic/jmx/src/test/java/org/springframework/integration/samples/jmx/ControlBusDemoTest.java b/basic/control-bus/src/test/java/org/springframework/integration/samples/controlbus/ControlBusDemoTest.java similarity index 96% rename from basic/jmx/src/test/java/org/springframework/integration/samples/jmx/ControlBusDemoTest.java rename to basic/control-bus/src/test/java/org/springframework/integration/samples/controlbus/ControlBusDemoTest.java index 1b58bc65..b44c515c 100644 --- a/basic/jmx/src/test/java/org/springframework/integration/samples/jmx/ControlBusDemoTest.java +++ b/basic/control-bus/src/test/java/org/springframework/integration/samples/controlbus/ControlBusDemoTest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.integration.samples.jmx; +package org.springframework.integration.samples.controlbus; import org.apache.log4j.Logger; import org.junit.Test; diff --git a/basic/control-bus/src/test/resources/log4j.xml b/basic/control-bus/src/test/resources/log4j.xml new file mode 100644 index 00000000..678b69b3 --- /dev/null +++ b/basic/control-bus/src/test/resources/log4j.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/basic/jmx/.springBeans b/basic/jmx/.springBeans index 46d8806e..ca9c1817 100644 --- a/basic/jmx/.springBeans +++ b/basic/jmx/.springBeans @@ -7,7 +7,6 @@ - src/main/resources/META-INF/spring/integration/ControlBusDemo-context.xml diff --git a/basic/jmx/readme.txt b/basic/jmx/readme.txt index cc14a0b6..d3c3a259 100644 --- a/basic/jmx/readme.txt +++ b/basic/jmx/readme.txt @@ -1,7 +1,6 @@ This example demonstrates the following aspects of the JMX support available with Spring Integration: 1. JMX Attribute Polling Channel 2. JMX Operation Invoking Channel Adapter -3. Control Bus StopWatch is a Managed Bean. It is bootstraped and deployed using annotation support (@Component, @ManagedResource) and component scanning functionality provided by Spring JMX. Internally StopWatch simply runs a task that increments the @@ -14,9 +13,6 @@ The interesting this is that 'seconds' channel is a publish-subscribe-channel an Once the payload value is 10 filter sends the Message to a 'reset' channel which is represented as JMX Operation Invoking Channel Adapter which simply invokes 'reset' operation on the same StopWatch MBean resetting 'Seconds' attribute value back to 1 and the process repeats. -Another example is a Control Bus which uses SpEL to send a Control Message to start/stop and inbound adapter - - To run JMX Adapter sample simple execute JmxAdapterDemoTest You will see the output similar to this which will loop for ~ 20 sec: @@ -35,11 +31,3 @@ You will see the output similar to this which will loop for ~ 20 sec: 3 . . . -To run Control Bus sample simple execute ControlBusDemoTest - -You will see the output similar to this - -INFO : org.springframework.integration.samples.jmx.ControlBusDemo - Received before adapter started: null -INFO : org.springframework.integration.samples.jmx.ControlBusDemo - Received before adapter started: [Payload=Hello][Headers={timestamp=1294950897714, id=240e72fb-93b0-4d38-8fe8-b701cf7e9a5d}] -INFO : org.springframework.integration.samples.jmx.ControlBusDemo - Received after adapter stopped: null -