You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2010/09/17 07:56:13 UTC
svn commit: r997985 - in /camel/trunk/examples/camel-example-osgi:
README.txt src/main/java/org/apache/camel/example/osgi/MyRouteBuilder.java
src/main/resources/META-INF/spring/camelContext.xml
Author: davsclaus
Date: Fri Sep 17 05:56:12 2010
New Revision: 997985
URL: http://svn.apache.org/viewvc?rev=997985&view=rev
Log:
Removed osgi namespace as its no longer in use.
Modified:
camel/trunk/examples/camel-example-osgi/README.txt
camel/trunk/examples/camel-example-osgi/src/main/java/org/apache/camel/example/osgi/MyRouteBuilder.java
camel/trunk/examples/camel-example-osgi/src/main/resources/META-INF/spring/camelContext.xml
Modified: camel/trunk/examples/camel-example-osgi/README.txt
URL: http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-osgi/README.txt?rev=997985&r1=997984&r2=997985&view=diff
==============================================================================
--- camel/trunk/examples/camel-example-osgi/README.txt (original)
+++ camel/trunk/examples/camel-example-osgi/README.txt Fri Sep 17 05:56:12 2010
@@ -4,6 +4,9 @@ OSGi Example
This example shows how use OSGi with Camel. It can be run using Maven or
Ant.
+Running from cmd line outside OSGi container
+============================================
+
You will need to compile this example first:
mvn compile
@@ -15,6 +18,29 @@ To run the example using Ant type
To stop the example hit ctrl + c
+
+
+Running inside OSGi container
+=============================
+
+You will need to compile and install this example first:
+ mvn compile install
+
+If using Apache Karaf / Apache ServiceMix you can install this example
+from the shell
+
+ osgi:install mvn:org.apache.camel/camel-example-osgi/2.5.0
+
+ (substitute 2.5.0 with the Camel version number)
+
+Then start the bundle by starting the id it was assigned during installation
+
+ osgi:start 182
+
+ (substitute 182 with the id of the bundle)
+
+
+
To use log4j as the logging framework add this to the pom.xml:
<dependency>
<groupId>log4j</groupId>
Modified: camel/trunk/examples/camel-example-osgi/src/main/java/org/apache/camel/example/osgi/MyRouteBuilder.java
URL: http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-osgi/src/main/java/org/apache/camel/example/osgi/MyRouteBuilder.java?rev=997985&r1=997984&r2=997985&view=diff
==============================================================================
--- camel/trunk/examples/camel-example-osgi/src/main/java/org/apache/camel/example/osgi/MyRouteBuilder.java (original)
+++ camel/trunk/examples/camel-example-osgi/src/main/java/org/apache/camel/example/osgi/MyRouteBuilder.java Fri Sep 17 05:56:12 2010
@@ -25,11 +25,9 @@ import org.apache.camel.spring.Main;
* @version $Revision$
*/
public class MyRouteBuilder extends RouteBuilder {
+
/**
* Allow this route to be run as an application
- *
- * @param args
- * @throws Exception
*/
public static void main(String[] args) throws Exception {
new Main().run(args);
@@ -45,5 +43,4 @@ public class MyRouteBuilder extends Rout
.to("log:ExampleRouter");
}
-
}
Modified: camel/trunk/examples/camel-example-osgi/src/main/resources/META-INF/spring/camelContext.xml
URL: http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-osgi/src/main/resources/META-INF/spring/camelContext.xml?rev=997985&r1=997984&r2=997985&view=diff
==============================================================================
--- camel/trunk/examples/camel-example-osgi/src/main/resources/META-INF/spring/camelContext.xml (original)
+++ camel/trunk/examples/camel-example-osgi/src/main/resources/META-INF/spring/camelContext.xml Fri Sep 17 05:56:12 2010
@@ -18,23 +18,21 @@
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:osgi="http://camel.apache.org/schema/osgi"
xmlns:camel="http://camel.apache.org/schema/spring"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
- http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
- http://camel.apache.org/schema/osgi http://camel.apache.org/schema/osgi/camel-osgi.xsd">
+ http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
- <camelContext xmlns="http://camel.apache.org/schema/osgi">
- <camel:route>
- <camel:from uri="timer://myTimer?fixedRate=true&period=2000"/>
- <camel:bean ref="myTransform" method="transform"/>
- <camel:to uri="log:ExampleRouter"/>
- </camel:route>
- </camelContext>
+ <camelContext xmlns="http://camel.apache.org/schema/spring">
+ <camel:route>
+ <camel:from uri="timer://myTimer?fixedRate=true&period=2000"/>
+ <camel:bean ref="myTransform" method="transform"/>
+ <camel:to uri="log:ExampleRouter"/>
+ </camel:route>
+ </camelContext>
- <bean id="myTransform" class="org.apache.camel.example.osgi.MyTransform">
- <property name="prefix" value="SpringDSL"/>
- </bean>
+ <bean id="myTransform" class="org.apache.camel.example.osgi.MyTransform">
+ <property name="prefix" value="SpringDSL"/>
+ </bean>
</beans>