Author: indika
Date: Wed Jun 24 23:16:54 2009
New Revision: 39859
URL: http://wso2.org/svn/browse/wso2?view=rev&revision=39859

Log:
add task to extensions_guide.xml 

Modified:
   branches/esb/java/2.1/product/docs/xdoc/extensions_guide.xml

Modified: branches/esb/java/2.1/product/docs/xdoc/extensions_guide.xml
URL: 
http://wso2.org/svn/browse/wso2/branches/esb/java/2.1/product/docs/xdoc/extensions_guide.xml?rev=39859&r1=39858&r2=39859&view=diff
==============================================================================
--- branches/esb/java/2.1/product/docs/xdoc/extensions_guide.xml        
(original)
+++ branches/esb/java/2.1/product/docs/xdoc/extensions_guide.xml        Wed Jun 
24 23:16:54 2009
@@ -480,5 +480,81 @@
         org.apache.synapse.config.xml.MediatorFactory
         org.apache.synapse.config.xml.MediatorSerializer
     /... the implementation classes as usual...</pre>
-  </body>
-</html>
\ No newline at end of file
+ 
+
+<h2>Scheduled Tasks</h2>
+
+<p></p>
+
+<p>Task is a one of method to automatically driving the mediation in the ESB.
+This is an implementation of ESB Startup which allowed adding tasks should run
+at ESB startup. Task is a Startup and it is based on Quartz, an open source job
+scheduling system. Task can be used to create simple or complex schedules. A
+simple schedule may be a schedule to run a task periodically. A complex
+schedule may be a schedule to run at specific time in future. A complex
+schedule can be specified using cron expressions.</p>
+
+<p></p>
+<pre>&lt;task class="string" name="string" [group="string"] 
[pinnedServers="(serverName)+"]&gt;
+       &lt;property name="string" value="String"/&gt;
+       &lt;property 
name="string"&gt;&lt;somexml&gt;config&lt;/somexml&gt;&lt;/property&gt;
+       &lt;trigger ([[count="int"]? interval="int"] | [cron="string"] | 
[once=(true | false)])/&gt;
+&lt;/task&gt;</pre>
+
+<p></p>
+
+<p>A task is created and scheduled to run at specified time intervals or as
+specified by the cron expression. The Task class specifies the actual task
+implementation class</p>
+
+<p> (which must implement
+<strong>org.apache.synapse.task.Task</strong><strong>interface</strong>) to be
+executed at the specified interval/s, and name specifies an identifier for the
+scheduled task.</p>
+
+<p> In the current ESB , there is only one implementation -
+<strong>org.apache.synapse.startup.tasks.MessageInjector</strong>.This can be
+used to inject messages at ESB startup.</p>
+
+<p></p>
+
+<p>Fields in the task class can be set using properties provided as string
+literals or as XML fragments. (For example; if the task implementation class
+has a field named "version" with a corresponding setter method, the
+configuration value which will be assigned to this field before running the
+task can be specified using a property with the name 'version')</p>
+
+<p></p>
+
+<p>There are three different trigger mechanisms to schedule tasks. A simple
+trigger is specified specifying a 'count' and an 'interval', implying that the
+task will run a 'count' number of times at specified intervals. A trigger may
+also be specified as a cron trigger using a cron expression. A one-time trigger
+is specified using the 'once' attribute as true in the definition and could be
+specified as true in which case this task will be executed only once just after
+the initialization of ESB. You can give a list of Synapse server names where
+this task should be started using pinnedServers attribute. Refer to the
+explanation of this attribute under proxy services for more information.</p>
+
+<p></p>
+
+<h3>Extending Task</h3>
+
+<p>A custom Task can be developed by writing a custom Java class that
+implements the <strong>org.apache.synapse.task.Task interface</strong>. Task
+interface is shown bellow.</p>
+
+<p></p>
+<pre>package org.apache.synapse.task;
+
+/*** Represents an executable Task*/
+
+public interface Task {
+
+   /*** Execute method will be invoked by the QuartzJOb.
+   */
+   public void execute();
+
+}</pre>
+</body>
+</html>

_______________________________________________
Esb-java-dev mailing list
[email protected]
https://wso2.org/cgi-bin/mailman/listinfo/esb-java-dev

Reply via email to