Author: asankha
Date: Thu Nov 23 05:46:54 2006
New Revision: 478572

URL: http://svn.apache.org/viewvc?view=rev&rev=478572
Log:
add a sample to illustrate dynamic endpoints

Added:
    incubator/synapse/trunk/java/repository/conf/sample/resources/endpoint/
    
incubator/synapse/trunk/java/repository/conf/sample/resources/endpoint/dynamic_endpt_1.xml
    incubator/synapse/trunk/java/repository/conf/sample/synapse_sample_10.xml
Modified:
    incubator/synapse/trunk/java/src/site/resources/Synapse_Samples.html

Added: 
incubator/synapse/trunk/java/repository/conf/sample/resources/endpoint/dynamic_endpt_1.xml
URL: 
http://svn.apache.org/viewvc/incubator/synapse/trunk/java/repository/conf/sample/resources/endpoint/dynamic_endpt_1.xml?view=auto&rev=478572
==============================================================================
--- 
incubator/synapse/trunk/java/repository/conf/sample/resources/endpoint/dynamic_endpt_1.xml
 (added)
+++ 
incubator/synapse/trunk/java/repository/conf/sample/resources/endpoint/dynamic_endpt_1.xml
 Thu Nov 23 05:46:54 2006
@@ -0,0 +1,2 @@
+<endpoint name="simple" 
address="http://localhost:9000/axis2/services/SimpleStockQuoteService"; 
+               xmlns="http://ws.apache.org/ns/synapse"/>
\ No newline at end of file

Added: incubator/synapse/trunk/java/repository/conf/sample/synapse_sample_10.xml
URL: 
http://svn.apache.org/viewvc/incubator/synapse/trunk/java/repository/conf/sample/synapse_sample_10.xml?view=auto&rev=478572
==============================================================================
--- incubator/synapse/trunk/java/repository/conf/sample/synapse_sample_10.xml 
(added)
+++ incubator/synapse/trunk/java/repository/conf/sample/synapse_sample_10.xml 
Thu Nov 23 05:46:54 2006
@@ -0,0 +1,46 @@
+<!--
+  ~  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.
+  -->
+
+<synapse xmlns="http://ws.apache.org/ns/synapse";>
+
+    <!-- introduction dynamic endpoints -->
+
+    <registry provider="org.apache.synapse.registry.url.SimpleURLRegistry">
+        <!-- the root property of the simple URL registry helps resolve a 
resource URL as root + key -->
+        <property name="root" value="file:repository/conf/sample/resources/"/>
+        <!-- all resources loaded from the URL registry would be cached for 
this number of milli seconds -->
+        <property name="cachableDuration" value="15000"/>
+    </registry>
+
+    <definitions>
+        <endpoint name="dynamic_endpoint" key="endpoint/dynamic_endpt_1.xml"/>
+    </definitions>
+
+    <rules>
+        <in>
+               <send>
+                       <endpoint ref="dynamic_endpoint"/>
+               </send>
+        </in>
+        <out>
+               <send/>
+        </out>
+    </rules>
+
+</synapse> 
\ No newline at end of file

Modified: incubator/synapse/trunk/java/src/site/resources/Synapse_Samples.html
URL: 
http://svn.apache.org/viewvc/incubator/synapse/trunk/java/src/site/resources/Synapse_Samples.html?view=diff&rev=478572&r1=478571&r2=478572
==============================================================================
--- incubator/synapse/trunk/java/src/site/resources/Synapse_Samples.html 
(original)
+++ incubator/synapse/trunk/java/src/site/resources/Synapse_Samples.html Thu 
Nov 23 05:46:54 2006
@@ -488,6 +488,32 @@
 <p>The cache timeout could be tuned appropriately by configuring the URL
 registry to suite the environment and the needs.</p>
 
+<h2>Sample 9:</h2>
+
+<p><strong>Objective: Introduction to dynamic endpoints with a
+Registry</strong></p>
+
+<p><strong>Pre-Requisites:</strong><br>
+Start the Synapse configuration numbered 10: i.e. synapse -sample 10<br>
+Start the Axis2 server and deploy the SimpleStockQuoteService and the
+SimpleStockQuoteervice1 (Refer steps above)</p>
+
+<p>This example introduces dynamic endpoints, where the definition of an
+endpoint is stored in a Registry. To follow this example execute the stock
+quote client as 'ant stockquote' and see that the message is routed to the
+SimpleStockQuoteService on the Axis2 instance. Repeat the above example and
+notice that the endpoint is cached and reused by Synapse - similarly to
+example # 8. </p>
+<pre>SimpleStockQuoteService :: Generating quote for : IBM</pre>
+
+<p>Now edit the repository/conf/sample/resources/endpoint/dynamic_endpt_1.xml
+definition and update the address to
+"http://localhost:9000/axis2/services/SimpleStockQuoteService1";. After the
+cached value expires, the Registry loads the new definition of the endpoint,
+and then the messages can be seen being routed to the
+SimpleStockQuoteService1.</p>
+<pre>SimpleStockQuoteService 1 :: Generating quote for : IBM</pre>
+
 <p></p>
 
 <h2>Sample 50:</h2>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to