Author: ruwan
Date: Tue Nov 6 22:51:57 2007
New Revision: 592634
URL: http://svn.apache.org/viewvc?rev=592634&view=rev
Log:
Adding the task sample documentation
Modified:
webservices/synapse/branches/1.1/src/site/resources/Synapse_Samples.html
Modified:
webservices/synapse/branches/1.1/src/site/resources/Synapse_Samples.html
URL:
http://svn.apache.org/viewvc/webservices/synapse/branches/1.1/src/site/resources/Synapse_Samples.html?rev=592634&r1=592633&r2=592634&view=diff
==============================================================================
--- webservices/synapse/branches/1.1/src/site/resources/Synapse_Samples.html
(original)
+++ webservices/synapse/branches/1.1/src/site/resources/Synapse_Samples.html
Tue Nov 6 22:51:57 2007
@@ -2897,7 +2897,48 @@
<h2><a name="Sample300">Sample 300: Introduction to tasks with simple
trigger</a></h2>
-<!--TODO: fill the sample-->
+<pre><definitions xmlns="http://ws.apache.org/ns/synapse">
+
+ <task class="org.apache.synapse.startup.tasks.MessageInjector"
name="CheckPrice">
+ <property name="to"
value="http://localhost:9000/soap/SimpleStockQuoteService"/>
+ <property name="soapAction" value="urn:getQuote"/>
+ <property name="message">
+ <m0:getQuote xmlns:m0="http://services.samples/xsd">
+ <m0:request>
+ <m0:symbol>IBM</m0:symbol>
+ </m0:request>
+ </m0:getQuote>
+ </property>
+ <trigger interval="5000"/>
+ </task>
+
+ <in>
+ <send/>
+ </in>
+ <out>
+ <log level="custom">
+ <property name="Stock Quote on"
expression="//ns:return/ns:lastTradeTimestamp/child::text()"
xmlns:ns="http://services.samples/xsd"/>
+ <property name="For the organization"
expression="//ns:return/ns:name/child::text()"
xmlns:ns="http://services.samples/xsd"/>
+ <property name="Last Value"
expression="//ns:return/ns:last/child::text()"
xmlns:ns="http://services.samples/xsd"/>
+ </log>
+ </out>
+
+</definitions></pre>
+
+<p><strong>Objective: Introduce the concept of tasks and how simple trigger
works</strong></p>
+
+<p><strong>Prerequisites:</strong><br>
+You will need access to build the SimpleStockQuoteService as mentioned in the
above and start the
+sample axis2 server before staring synapse.</p>
+
+<p>When ever synapse gets started and initialized, this task will run
periodically in 5 second
+intervals. You could limit the number of times that you want to run this task
by adding a count
+attribute with an integer as the value, if the count is not present as in this
sample this task will
+run forever.</p>
+
+<p>One can write his own task class implmenting the
org.apache.synapse.startup.Task interface and
+implementing the execute method to do the task. For this particualr sample we
have used the
+MessageInjector which just injects a message specified in to the synapse
enviorenemnt.</p>
<h1><a name="AdvancedMediation">Advanced mediations with advanced
mediators</a></h1>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]