You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by ff...@apache.org on 2008/08/18 12:22:55 UTC

svn commit: r686721 - in /servicemix/smx4/features/trunk/examples/camel-osgi: README.txt org.apache.servicemix.examples.cfg src/main/resources/META-INF/spring/beans.xml

Author: ffang
Date: Mon Aug 18 03:22:55 2008
New Revision: 686721

URL: http://svn.apache.org/viewvc?rev=686721&view=rev
Log:
[SMX4-86]add example to show how to use osgi propertie placeholder and how to deploy the properties file from console

Added:
    servicemix/smx4/features/trunk/examples/camel-osgi/org.apache.servicemix.examples.cfg
Modified:
    servicemix/smx4/features/trunk/examples/camel-osgi/README.txt
    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=686721&r1=686720&r2=686721&view=diff
==============================================================================
--- servicemix/smx4/features/trunk/examples/camel-osgi/README.txt (original)
+++ servicemix/smx4/features/trunk/examples/camel-osgi/README.txt Mon Aug 18 03:22:55 2008
@@ -20,6 +20,8 @@
 
 This example demonstrates using Apache Camel to deploy EIP routes in
 Servicemix.
+Also this example shows how to use osgi propertie placeholder and how to
+deploy the properties file from console.
 
 Quick steps to install the sample
 ---------------------------------
@@ -57,6 +59,19 @@
 As well, you can view ExampleRouter log entries in the ServiceMix log:
   log d
 
+You also can update and redeploy properties file which is used by the properties
+placeholder in the beans.xml from console.
+
+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 
+utils exec "cp
+$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
+
 How does it work?
 -----------------
 

Added: servicemix/smx4/features/trunk/examples/camel-osgi/org.apache.servicemix.examples.cfg
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/examples/camel-osgi/org.apache.servicemix.examples.cfg?rev=686721&view=auto
==============================================================================
--- servicemix/smx4/features/trunk/examples/camel-osgi/org.apache.servicemix.examples.cfg (added)
+++ servicemix/smx4/features/trunk/examples/camel-osgi/org.apache.servicemix.examples.cfg Mon Aug 18 03:22:55 2008
@@ -0,0 +1,22 @@
+#
+# 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.
+#
+#
+
+
+prefix=YourTransform

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=686721&r1=686720&r2=686721&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 Mon Aug 18 03:22:55 2008
@@ -19,10 +19,12 @@
 <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:osgi="http://activemq.apache.org/camel/schema/osgi"
+       xmlns:osgix="http://www.springframework.org/schema/osgi-compendium"
        xsi:schemaLocation="
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
        http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd
-       http://activemq.apache.org/camel/schema/osgi http://activemq.apache.org/camel/schema/osgi/camel-osgi.xsd">
+       http://activemq.apache.org/camel/schema/osgi http://activemq.apache.org/camel/schema/osgi/camel-osgi.xsd
+       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">
     <route>
@@ -33,7 +35,13 @@
   </osgi:camelContext>
 
   <bean id="myTransform" class="org.apache.servicemix.examples.camel.MyTransform">
-    <property name="prefix" value="MyTransform"/>
+    <property name="prefix" value="${prefix}"/>
   </bean>
+   
+  <osgix:property-placeholder persistent-id="org.apache.servicemix.examples">
+        <osgix:default-properties>
+            <prop key="prefix">MyTransform</prop>
+        </osgix:default-properties>
+    </osgix:property-placeholder>
 
 </beans>