Author: ffang
Date: Wed Feb 18 08:07:19 2009
New Revision: 745410
URL: http://svn.apache.org/viewvc?rev=745410&view=rev
Log:
[SMX4NMR-91 SMX4NMR-92]create example showing how to write NMR endpoint and how
to access NMR to send exchange
Added:
servicemix/smx4/nmr/trunk/examples/
servicemix/smx4/nmr/trunk/examples/nmr/
servicemix/smx4/nmr/trunk/examples/nmr/README.txt (with props)
servicemix/smx4/nmr/trunk/examples/nmr/client/
servicemix/smx4/nmr/trunk/examples/nmr/client/pom.xml (with props)
servicemix/smx4/nmr/trunk/examples/nmr/client/src/
servicemix/smx4/nmr/trunk/examples/nmr/client/src/main/
servicemix/smx4/nmr/trunk/examples/nmr/client/src/main/java/
servicemix/smx4/nmr/trunk/examples/nmr/client/src/main/java/org/
servicemix/smx4/nmr/trunk/examples/nmr/client/src/main/java/org/apache/
servicemix/smx4/nmr/trunk/examples/nmr/client/src/main/java/org/apache/servicemix/
servicemix/smx4/nmr/trunk/examples/nmr/client/src/main/java/org/apache/servicemix/nmr/
servicemix/smx4/nmr/trunk/examples/nmr/client/src/main/java/org/apache/servicemix/nmr/examples/
servicemix/smx4/nmr/trunk/examples/nmr/client/src/main/java/org/apache/servicemix/nmr/examples/nmr/
servicemix/smx4/nmr/trunk/examples/nmr/client/src/main/java/org/apache/servicemix/nmr/examples/nmr/client/
servicemix/smx4/nmr/trunk/examples/nmr/client/src/main/java/org/apache/servicemix/nmr/examples/nmr/client/Client.java
(with props)
servicemix/smx4/nmr/trunk/examples/nmr/client/src/main/resources/
servicemix/smx4/nmr/trunk/examples/nmr/client/src/main/resources/META-INF/
servicemix/smx4/nmr/trunk/examples/nmr/client/src/main/resources/META-INF/spring/
servicemix/smx4/nmr/trunk/examples/nmr/client/src/main/resources/META-INF/spring/beans.xml
(with props)
servicemix/smx4/nmr/trunk/examples/nmr/endpoint/
servicemix/smx4/nmr/trunk/examples/nmr/endpoint/pom.xml (with props)
servicemix/smx4/nmr/trunk/examples/nmr/endpoint/src/
servicemix/smx4/nmr/trunk/examples/nmr/endpoint/src/main/
servicemix/smx4/nmr/trunk/examples/nmr/endpoint/src/main/java/
servicemix/smx4/nmr/trunk/examples/nmr/endpoint/src/main/java/org/
servicemix/smx4/nmr/trunk/examples/nmr/endpoint/src/main/java/org/apache/
servicemix/smx4/nmr/trunk/examples/nmr/endpoint/src/main/java/org/apache/servicemix/
servicemix/smx4/nmr/trunk/examples/nmr/endpoint/src/main/java/org/apache/servicemix/nmr/
servicemix/smx4/nmr/trunk/examples/nmr/endpoint/src/main/java/org/apache/servicemix/nmr/examples/
servicemix/smx4/nmr/trunk/examples/nmr/endpoint/src/main/java/org/apache/servicemix/nmr/examples/nmr/
servicemix/smx4/nmr/trunk/examples/nmr/endpoint/src/main/java/org/apache/servicemix/nmr/examples/nmr/endpoint/
servicemix/smx4/nmr/trunk/examples/nmr/endpoint/src/main/java/org/apache/servicemix/nmr/examples/nmr/endpoint/EchoEndpoint.java
(with props)
servicemix/smx4/nmr/trunk/examples/nmr/endpoint/src/main/resources/
servicemix/smx4/nmr/trunk/examples/nmr/endpoint/src/main/resources/META-INF/
servicemix/smx4/nmr/trunk/examples/nmr/endpoint/src/main/resources/META-INF/spring/
servicemix/smx4/nmr/trunk/examples/nmr/endpoint/src/main/resources/META-INF/spring/beans.xml
(with props)
servicemix/smx4/nmr/trunk/examples/nmr/pom.xml (with props)
servicemix/smx4/nmr/trunk/examples/pom.xml (with props)
Modified:
servicemix/smx4/nmr/trunk/assembly/src/main/descriptors/unix-bin.xml
servicemix/smx4/nmr/trunk/assembly/src/main/descriptors/windows-bin.xml
servicemix/smx4/nmr/trunk/assembly/src/main/filtered-resources/features.xml
servicemix/smx4/nmr/trunk/pom.xml
Modified: servicemix/smx4/nmr/trunk/assembly/src/main/descriptors/unix-bin.xml
URL:
http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/assembly/src/main/descriptors/unix-bin.xml?rev=745410&r1=745409&r2=745410&view=diff
==============================================================================
--- servicemix/smx4/nmr/trunk/assembly/src/main/descriptors/unix-bin.xml
(original)
+++ servicemix/smx4/nmr/trunk/assembly/src/main/descriptors/unix-bin.xml Wed
Feb 18 08:07:19 2009
@@ -86,6 +86,16 @@
</includes>
<outputDirectory>/lib/</outputDirectory>
</fileSet>
+
+ <!-- Copy over the examples -->
+ <fileSet>
+ <directory>../examples</directory>
+ <outputDirectory>/examples/</outputDirectory>
+ <lineEnding>unix</lineEnding>
+ <excludes>
+ <exclude>**/target/**</exclude>
+ </excludes>
+ </fileSet>
</fileSets>
Modified:
servicemix/smx4/nmr/trunk/assembly/src/main/descriptors/windows-bin.xml
URL:
http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/assembly/src/main/descriptors/windows-bin.xml?rev=745410&r1=745409&r2=745410&view=diff
==============================================================================
--- servicemix/smx4/nmr/trunk/assembly/src/main/descriptors/windows-bin.xml
(original)
+++ servicemix/smx4/nmr/trunk/assembly/src/main/descriptors/windows-bin.xml Wed
Feb 18 08:07:19 2009
@@ -86,6 +86,16 @@
</includes>
<outputDirectory>/lib/</outputDirectory>
</fileSet>
+
+ <!-- Copy over the examples -->
+ <fileSet>
+ <directory>../examples</directory>
+ <outputDirectory>/examples/</outputDirectory>
+ <lineEnding>dos</lineEnding>
+ <excludes>
+ <exclude>**/target/**</exclude>
+ </excludes>
+ </fileSet>
</fileSets>
Modified:
servicemix/smx4/nmr/trunk/assembly/src/main/filtered-resources/features.xml
URL:
http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/assembly/src/main/filtered-resources/features.xml?rev=745410&r1=745409&r2=745410&view=diff
==============================================================================
--- servicemix/smx4/nmr/trunk/assembly/src/main/filtered-resources/features.xml
(original)
+++ servicemix/smx4/nmr/trunk/assembly/src/main/filtered-resources/features.xml
Wed Feb 18 08:07:19 2009
@@ -41,4 +41,8 @@
<bundle>mvn:org.apache.servicemix.jbi/org.apache.servicemix.jbi.deployer/${pom.version}</bundle>
<bundle>mvn:org.apache.servicemix.jbi/org.apache.servicemix.jbi.commands/${pom.version}</bundle>
</feature>
+ <feature name="examples-nmr" version="${version}">
+
<bundle>mvn:org.apache.servicemix.nmr.examples/org.apache.servicemix.nmr.examples.nmr.endpoint/${pom.version}</bundle>
+
<bundle>mvn:org.apache.servicemix.nmr.examples/org.apache.servicemix.nmr.examples.nmr.client/${pom.version}</bundle>
+ </feature>
</features>
Added: servicemix/smx4/nmr/trunk/examples/nmr/README.txt
URL:
http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/examples/nmr/README.txt?rev=745410&view=auto
==============================================================================
--- servicemix/smx4/nmr/trunk/examples/nmr/README.txt (added)
+++ servicemix/smx4/nmr/trunk/examples/nmr/README.txt Wed Feb 18 08:07:19 2009
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+
+Welcome to the ServiceMix NMR nmr example
+==========================================
+
+This example include two bundles.
+The endpoint bundle shows how to write a
+simple NMR endpoint, a osgi spring configuration file appended with this
+bundle to demostrate how to expose the Endpoint service in this bundle. The
+endpoint bundle include one java class EchoEndpoint, it simply print out the
+received exchange and add "Echo" prefix then send the exchange back.
+The client bundle shows how to access the NMR and send exhanges, also there is
+an osgi spring configuration file with this bundle to show how NMR get injected
+from OSGI service.
+
+Quick steps to install the sample
+---------------------------------
+
+Launch the ServiceMix Kernel by running
+ bin/servicemix
+in the root dir of this distribution.
+
+When inside the console, just run the following commands to install the
+example:
+
+ features/install examples-nmr
+
+If you have all the bundles available in your local repo, the installation
+of the example will be very fast, otherwise it may take some time to
+download everything needed.
+
+Testing the example
+-------------------
+
+When the feature is installed, you should be output from the log file every 5
+seconds
+15:50:37,240 | INFO | pool-8-thread-1 | EchoEndpoint |
+amples.nmr.endpoint.EchoEndpoint 30 | Receiced in EchoEndpoint: Hello
+15:50:37,241 | INFO | Thread-11 | Client |
+.client.Client$SendRequestThread 69 | Response from Endpoint EchoHello
+
+
+
+
Propchange: servicemix/smx4/nmr/trunk/examples/nmr/README.txt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: servicemix/smx4/nmr/trunk/examples/nmr/README.txt
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: servicemix/smx4/nmr/trunk/examples/nmr/client/pom.xml
URL:
http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/examples/nmr/client/pom.xml?rev=745410&view=auto
==============================================================================
--- servicemix/smx4/nmr/trunk/examples/nmr/client/pom.xml (added)
+++ servicemix/smx4/nmr/trunk/examples/nmr/client/pom.xml Wed Feb 18 08:07:19
2009
@@ -0,0 +1,76 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You 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.
+ -->
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.servicemix.nmr.examples</groupId>
+ <artifactId>org.apache.servicemix.nmr.examples.nmr</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.apache.servicemix.nmr.examples</groupId>
+ <artifactId>org.apache.servicemix.nmr.examples.nmr.client</artifactId>
+ <packaging>bundle</packaging>
+ <name>Apache ServiceMix NMR Example:: NMR Client</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.servicemix.nmr</groupId>
+ <artifactId>org.apache.servicemix.nmr.api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <configuration>
+ <instructions>
+
<Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
+ <Import-Package>org.apache.commons.logging,
+ org.apache.servicemix.nmr.api,
+ org.apache.servicemix.nmr.api.service,
+ org.osgi.framework,
+ org.springframework.beans.factory
+ </Import-Package>
+
<Private-Package>org.apache.servicemix.nmr.examples.nmr.client</Private-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Propchange: servicemix/smx4/nmr/trunk/examples/nmr/client/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: servicemix/smx4/nmr/trunk/examples/nmr/client/pom.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: servicemix/smx4/nmr/trunk/examples/nmr/client/pom.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added:
servicemix/smx4/nmr/trunk/examples/nmr/client/src/main/java/org/apache/servicemix/nmr/examples/nmr/client/Client.java
URL:
http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/examples/nmr/client/src/main/java/org/apache/servicemix/nmr/examples/nmr/client/Client.java?rev=745410&view=auto
==============================================================================
---
servicemix/smx4/nmr/trunk/examples/nmr/client/src/main/java/org/apache/servicemix/nmr/examples/nmr/client/Client.java
(added)
+++
servicemix/smx4/nmr/trunk/examples/nmr/client/src/main/java/org/apache/servicemix/nmr/examples/nmr/client/Client.java
Wed Feb 18 08:07:19 2009
@@ -0,0 +1,85 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.servicemix.nmr.examples.nmr.client;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.servicemix.nmr.api.Channel;
+import org.apache.servicemix.nmr.api.Endpoint;
+import org.apache.servicemix.nmr.api.Exchange;
+import org.apache.servicemix.nmr.api.NMR;
+import org.apache.servicemix.nmr.api.Pattern;
+import org.apache.servicemix.nmr.api.service.ServiceHelper;
+import org.springframework.beans.factory.DisposableBean;
+import org.springframework.beans.factory.InitializingBean;
+
+public class Client implements InitializingBean, DisposableBean {
+
+ private static final transient Log LOG = LogFactory.getLog(Client.class);
+ private NMR nmr;
+
+ private SendRequestThread sendRequestThread;
+
+ public void afterPropertiesSet() throws Exception {
+ sendRequestThread = new SendRequestThread();
+ sendRequestThread.setRun(true);
+ sendRequestThread.start();
+
+ }
+
+ public void destroy() throws Exception {
+ sendRequestThread.setRun(false);
+ }
+
+
+ public void setNmr(NMR nmr) {
+ this.nmr = nmr;
+ }
+
+ public NMR getNmr() {
+ return nmr;
+ }
+
+ class SendRequestThread extends Thread {
+ private boolean run;
+ public void run() {
+ while (run) {
+ try {
+ Thread.sleep(5000);
+ if (run && nmr != null) {
+ Channel client = nmr.createChannel();
+ Exchange e = client.createExchange(Pattern.InOut);
+
e.setTarget(nmr.getEndpointRegistry().lookup(ServiceHelper.createMap(Endpoint.NAME,
"EchoEndpoint")));
+ e.getIn().setBody("Hello");
+ client.sendSync(e);
+ LOG.info("Response from Endpoint " +
e.getOut().getBody());
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ LOG.error(e.getMessage());
+ }
+ }
+ }
+
+ public void setRun(boolean run) {
+ this.run = run;
+ }
+ }
+
+
+}
+
Propchange:
servicemix/smx4/nmr/trunk/examples/nmr/client/src/main/java/org/apache/servicemix/nmr/examples/nmr/client/Client.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
servicemix/smx4/nmr/trunk/examples/nmr/client/src/main/java/org/apache/servicemix/nmr/examples/nmr/client/Client.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
servicemix/smx4/nmr/trunk/examples/nmr/client/src/main/resources/META-INF/spring/beans.xml
URL:
http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/examples/nmr/client/src/main/resources/META-INF/spring/beans.xml?rev=745410&view=auto
==============================================================================
---
servicemix/smx4/nmr/trunk/examples/nmr/client/src/main/resources/META-INF/spring/beans.xml
(added)
+++
servicemix/smx4/nmr/trunk/examples/nmr/client/src/main/resources/META-INF/spring/beans.xml
Wed Feb 18 08:07:19 2009
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You 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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:osgi="http://www.springframework.org/schema/osgi"
+ xmlns:util="http://www.springframework.org/schema/util"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://www.springframework.org/schema/util
+ http://www.springframework.org/schema/util/spring-util.xsd
+ http://www.springframework.org/schema/osgi
+ http://www.springframework.org/schema/osgi/spring-osgi.xsd">
+
+ <!-- NMR -->
+ <osgi:reference id="nmr"
+ interface="org.apache.servicemix.nmr.api.NMR"
+ cardinality="1..1" />
+
+ <!-- client -->
+ <bean id="client"
class="org.apache.servicemix.nmr.examples.nmr.client.Client">
+ <property name="nmr" ref="nmr" />
+ </bean>
+</beans>
Propchange:
servicemix/smx4/nmr/trunk/examples/nmr/client/src/main/resources/META-INF/spring/beans.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
servicemix/smx4/nmr/trunk/examples/nmr/client/src/main/resources/META-INF/spring/beans.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange:
servicemix/smx4/nmr/trunk/examples/nmr/client/src/main/resources/META-INF/spring/beans.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: servicemix/smx4/nmr/trunk/examples/nmr/endpoint/pom.xml
URL:
http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/examples/nmr/endpoint/pom.xml?rev=745410&view=auto
==============================================================================
--- servicemix/smx4/nmr/trunk/examples/nmr/endpoint/pom.xml (added)
+++ servicemix/smx4/nmr/trunk/examples/nmr/endpoint/pom.xml Wed Feb 18 08:07:19
2009
@@ -0,0 +1,62 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You 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.
+ -->
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.servicemix.nmr.examples</groupId>
+ <artifactId>org.apache.servicemix.nmr.examples.nmr</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.apache.servicemix.nmr.examples</groupId>
+ <artifactId>org.apache.servicemix.nmr.examples.nmr.endpoint</artifactId>
+ <packaging>bundle</packaging>
+ <name>Apache ServiceMix NMR Example:: NMR Endpoint</name>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.servicemix.nmr</groupId>
+ <artifactId>org.apache.servicemix.nmr.api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <configuration>
+ <instructions>
+
<Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
+ <Import-Package>org.apache.commons.logging,
org.apache.servicemix.nmr.api</Import-Package>
+
<Private-Package>org.apache.servicemix.nmr.examples.nmr.endpoint</Private-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+
+</project>
Propchange: servicemix/smx4/nmr/trunk/examples/nmr/endpoint/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: servicemix/smx4/nmr/trunk/examples/nmr/endpoint/pom.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: servicemix/smx4/nmr/trunk/examples/nmr/endpoint/pom.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added:
servicemix/smx4/nmr/trunk/examples/nmr/endpoint/src/main/java/org/apache/servicemix/nmr/examples/nmr/endpoint/EchoEndpoint.java
URL:
http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/examples/nmr/endpoint/src/main/java/org/apache/servicemix/nmr/examples/nmr/endpoint/EchoEndpoint.java?rev=745410&view=auto
==============================================================================
---
servicemix/smx4/nmr/trunk/examples/nmr/endpoint/src/main/java/org/apache/servicemix/nmr/examples/nmr/endpoint/EchoEndpoint.java
(added)
+++
servicemix/smx4/nmr/trunk/examples/nmr/endpoint/src/main/java/org/apache/servicemix/nmr/examples/nmr/endpoint/EchoEndpoint.java
Wed Feb 18 08:07:19 2009
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.servicemix.nmr.examples.nmr.endpoint;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.servicemix.nmr.api.Channel;
+import org.apache.servicemix.nmr.api.Endpoint;
+import org.apache.servicemix.nmr.api.Exchange;
+import org.apache.servicemix.nmr.api.Status;
+
+public class EchoEndpoint implements Endpoint {
+ private static final transient Log LOG =
LogFactory.getLog(EchoEndpoint.class);
+ private Channel channel;
+ public void process(Exchange exchange) {
+ LOG.info("Received in EchoEndpoint: " + exchange.getIn().getBody());
+ exchange.getOut().setBody("Echo" + exchange.getIn().getBody(),
String.class);
+ exchange.setStatus(Status.Done);
+ channel.send(exchange);
+ }
+
+ public void setChannel(Channel channel) {
+ this.channel = channel;
+ }
+
+}
+
Propchange:
servicemix/smx4/nmr/trunk/examples/nmr/endpoint/src/main/java/org/apache/servicemix/nmr/examples/nmr/endpoint/EchoEndpoint.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
servicemix/smx4/nmr/trunk/examples/nmr/endpoint/src/main/java/org/apache/servicemix/nmr/examples/nmr/endpoint/EchoEndpoint.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
servicemix/smx4/nmr/trunk/examples/nmr/endpoint/src/main/resources/META-INF/spring/beans.xml
URL:
http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/examples/nmr/endpoint/src/main/resources/META-INF/spring/beans.xml?rev=745410&view=auto
==============================================================================
---
servicemix/smx4/nmr/trunk/examples/nmr/endpoint/src/main/resources/META-INF/spring/beans.xml
(added)
+++
servicemix/smx4/nmr/trunk/examples/nmr/endpoint/src/main/resources/META-INF/spring/beans.xml
Wed Feb 18 08:07:19 2009
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You 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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:osgi="http://www.springframework.org/schema/osgi"
+ xmlns:util="http://www.springframework.org/schema/util"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://www.springframework.org/schema/util
+ http://www.springframework.org/schema/util/spring-util.xsd
+ http://www.springframework.org/schema/osgi
+ http://www.springframework.org/schema/osgi/spring-osgi.xsd">
+
+ <!-- Echo Endpoint -->
+ <bean id="echo"
class="org.apache.servicemix.nmr.examples.nmr.endpoint.EchoEndpoint">
+ </bean>
+ <osgi:service ref="echo">
+ <osgi:interfaces>
+ <value>org.apache.servicemix.nmr.api.Endpoint</value>
+ </osgi:interfaces>
+ <osgi:service-properties>
+ <entry key="NAME">
+ <value>EchoEndpoint</value>
+ </entry>
+ </osgi:service-properties>
+ </osgi:service>
+
+</beans>
Propchange:
servicemix/smx4/nmr/trunk/examples/nmr/endpoint/src/main/resources/META-INF/spring/beans.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
servicemix/smx4/nmr/trunk/examples/nmr/endpoint/src/main/resources/META-INF/spring/beans.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange:
servicemix/smx4/nmr/trunk/examples/nmr/endpoint/src/main/resources/META-INF/spring/beans.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: servicemix/smx4/nmr/trunk/examples/nmr/pom.xml
URL:
http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/examples/nmr/pom.xml?rev=745410&view=auto
==============================================================================
--- servicemix/smx4/nmr/trunk/examples/nmr/pom.xml (added)
+++ servicemix/smx4/nmr/trunk/examples/nmr/pom.xml Wed Feb 18 08:07:19 2009
@@ -0,0 +1,39 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You 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.
+ -->
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.servicemix.nmr.examples</groupId>
+ <artifactId>examples</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.apache.servicemix.nmr.examples</groupId>
+ <artifactId>org.apache.servicemix.nmr.examples.nmr</artifactId>
+ <packaging>pom</packaging>
+ <name>Apache ServiceMix NMR Example:: NMR endpoint and Client</name>
+
+ <modules>
+ <module>endpoint</module>
+ <module>client</module>
+ </modules>
+
+</project>
Propchange: servicemix/smx4/nmr/trunk/examples/nmr/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: servicemix/smx4/nmr/trunk/examples/nmr/pom.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: servicemix/smx4/nmr/trunk/examples/nmr/pom.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: servicemix/smx4/nmr/trunk/examples/pom.xml
URL:
http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/examples/pom.xml?rev=745410&view=auto
==============================================================================
--- servicemix/smx4/nmr/trunk/examples/pom.xml (added)
+++ servicemix/smx4/nmr/trunk/examples/pom.xml Wed Feb 18 08:07:19 2009
@@ -0,0 +1,38 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You 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.
+ -->
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.servicemix.nmr</groupId>
+ <artifactId>nmr-parent</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.apache.servicemix.nmr.examples</groupId>
+ <artifactId>examples</artifactId>
+ <packaging>pom</packaging>
+ <name>Apache ServiceMix NMR Examples</name>
+
+ <modules>
+ <module>nmr</module>
+ </modules>
+
+</project>
Propchange: servicemix/smx4/nmr/trunk/examples/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: servicemix/smx4/nmr/trunk/examples/pom.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: servicemix/smx4/nmr/trunk/examples/pom.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Modified: servicemix/smx4/nmr/trunk/pom.xml
URL:
http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/pom.xml?rev=745410&r1=745409&r2=745410&view=diff
==============================================================================
--- servicemix/smx4/nmr/trunk/pom.xml (original)
+++ servicemix/smx4/nmr/trunk/pom.xml Wed Feb 18 08:07:19 2009
@@ -39,6 +39,7 @@
<module>jbi</module>
<module>bundle</module>
<module>assembly</module>
+ <module>examples</module>
</modules>
<scm>