servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r776562 - in /servicemix/smx4/features/trunk/examples/camel-osgi: README.txt pom.xml src/main/java/org/apache/servicemix/examples/camel/MyRouteBuilder.java src/main/resources/META-INF/spring/beans.xml
Date Wed, 20 May 2009 05:28:31 GMT
Author: ffang
Date: Wed May 20 05:28:31 2009
New Revision: 776562

URL: http://svn.apache.org/viewvc?rev=776562&view=rev
Log:
[SMX4-282]Add the Java DSL example for the example of camel-osgi

Added:
    servicemix/smx4/features/trunk/examples/camel-osgi/src/main/java/org/apache/servicemix/examples/camel/MyRouteBuilder.java
  (with props)
Modified:
    servicemix/smx4/features/trunk/examples/camel-osgi/README.txt
    servicemix/smx4/features/trunk/examples/camel-osgi/pom.xml
    servicemix/smx4/features/trunk/examples/camel-osgi/src/main/resources/META-INF/spring/beans.xml

Modified: servicemix/smx4/features/trunk/examples/camel-osgi/README.txt
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/examples/camel-osgi/README.txt?rev=776562&r1=776561&r2=776562&view=diff
==============================================================================
--- servicemix/smx4/features/trunk/examples/camel-osgi/README.txt (original)
+++ servicemix/smx4/features/trunk/examples/camel-osgi/README.txt Wed May 20 05:28:31 2009
@@ -48,8 +48,8 @@
 Once the example feature is installed, periodic events are routed to the
 transform method of the MyTransform class which prints output to the 
 console: 
-
 >>>> MyTransform set body:  Tue Jun 10 16:56:47 NDT 2008
+>>>> JavaDSL set body: Tue Jun 10 16:56:47 NDT 2008
 
 You can view the route configuration in META-INF/spring/beans.xml.
 
@@ -65,12 +65,18 @@
 Edit the org.apache.servicemix.examples.cfg in this folder, change the
 value of key "prefix" whatever you want(for example YourTransform), then in
 the console 
-optional/exec "cp
+exec cp
 $YOUR_SERVICEMIX_HOME/examples/camel-osgi/org.apache.servicemix.examples.cfg
-$YOUR_SERVICEMIX_HOME/etc" 
+$YOUR_SERVICEMIX_HOME/etc
+
+For Windows user, if you don't install the cigwin, you may need to change the cp command
to xcopy or cmd /c copy.
+exec xcopy
+%YOUR_SERVICEMIX_HOME%\\examples\\camel-osgi\\org.apache.servicemix.examples.cfg %YOUR_SERVICEMIX_HOME%\\etc
+ 
 And then stop and start the bundle of this example which name is "Apache ServiceMix Example
:: Camel OSGi", you can use "osgi list"to get this bundle id.
 Then you should find the prefix of the output should like
 >>>> YourTransform set body:  Tue Jun 10 16:56:47 NDT 2008
+>>>> JavaDSL set body: Tue Jun 10 16:56:47 NDT 2008
 
 How does it work?
 -----------------
@@ -79,7 +85,7 @@
 'features'. You can see the features definition file using the following
 command inside the ServiceMix console:
 
-optional/cat mvn:org.apache.servicemix.features/apache-servicemix/${version}/xml/features
+cat mvn:org.apache.servicemix.features/apache-servicemix/${version}/xml/features
 
 The list of available features can be obtained using:
 

Modified: servicemix/smx4/features/trunk/examples/camel-osgi/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/examples/camel-osgi/pom.xml?rev=776562&r1=776561&r2=776562&view=diff
==============================================================================
--- servicemix/smx4/features/trunk/examples/camel-osgi/pom.xml (original)
+++ servicemix/smx4/features/trunk/examples/camel-osgi/pom.xml Wed May 20 05:28:31 2009
@@ -40,6 +40,11 @@
             <version>${commons.logging.version}</version>
             <scope>provided</scope>
         </dependency>
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-spring</artifactId>
+            <version>${camel.version}</version>  
+        </dependency>
     </dependencies>
 
     <build>

Added: servicemix/smx4/features/trunk/examples/camel-osgi/src/main/java/org/apache/servicemix/examples/camel/MyRouteBuilder.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/examples/camel-osgi/src/main/java/org/apache/servicemix/examples/camel/MyRouteBuilder.java?rev=776562&view=auto
==============================================================================
--- servicemix/smx4/features/trunk/examples/camel-osgi/src/main/java/org/apache/servicemix/examples/camel/MyRouteBuilder.java
(added)
+++ servicemix/smx4/features/trunk/examples/camel-osgi/src/main/java/org/apache/servicemix/examples/camel/MyRouteBuilder.java
Wed May 20 05:28:31 2009
@@ -0,0 +1,48 @@
+/**
+ * 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.examples.camel;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.spring.Main;
+
+/**
+ * A simple example router to show how to define the route with Java DSL
+ *
+ * @version $Revision$
+ */
+public class MyRouteBuilder extends RouteBuilder {
+    /**
+     * Allow this route to be run as an application
+     *
+     * @param args
+     */
+    public static void main(String[] args) {
+        new Main().run(args);
+    }
+
+    public void configure() {
+        // set up the transform bean
+        MyTransform transform = new MyTransform();
+        transform.setPrefix("JavaDSL");
+        
+        from("timer://myTimer?fixedRate=true&period=2000")
+            .bean(transform, "transform")
+            .to("log:ExampleRouter");        
+    }
+
+    
+}

Propchange: servicemix/smx4/features/trunk/examples/camel-osgi/src/main/java/org/apache/servicemix/examples/camel/MyRouteBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: servicemix/smx4/features/trunk/examples/camel-osgi/src/main/java/org/apache/servicemix/examples/camel/MyRouteBuilder.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: servicemix/smx4/features/trunk/examples/camel-osgi/src/main/resources/META-INF/spring/beans.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/examples/camel-osgi/src/main/resources/META-INF/spring/beans.xml?rev=776562&r1=776561&r2=776562&view=diff
==============================================================================
--- servicemix/smx4/features/trunk/examples/camel-osgi/src/main/resources/META-INF/spring/beans.xml
(original)
+++ servicemix/smx4/features/trunk/examples/camel-osgi/src/main/resources/META-INF/spring/beans.xml
Wed May 20 05:28:31 2009
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?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
@@ -29,6 +29,9 @@
        http://www.springframework.org/schema/osgi-compendium http://www.springframework.org/schema/osgi-compendium/spring-osgi-compendium.xsd">
 
   <osgi:camelContext xmlns="http://activemq.apache.org/camel/schema/spring">
+    <!-- install the Java DSL route builder -->
+    <package>org.apache.servicemix.examples.camel</package>
+    <!-- install the route which is defined with xml tags -->
     <route>
       <from uri="timer://myTimer?fixedRate=true&amp;period=2000"/>
       <bean ref="myTransform" method="transform"/>



Mime
View raw message