cocoon-docs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@cocoon.apache.org
Subject [Cocoon Wiki] Updated: Scheduler
Date Tue, 13 Jul 2004 03:34:12 GMT
   Date: 2004-07-12T20:34:11
   Editor: DavidCrossley <crossley@apache.org>
   Wiki: Cocoon Wiki
   Page: Scheduler
   URL: http://wiki.apache.org/cocoon/Scheduler

   remove an old link

Change Log:

------------------------------------------------------------------------------
@@ -1,5 +1,3 @@
-(Not to be confused with WyonaScheduler)
-
 The Cocoon Scheduler is a recently-added component, which uses the Avalon Cornerstone scheduler.
 It allows you do to anything at a specific interval or at a certain time every day, week,
month, etc, much like the cron daemon.  It currently lives in the 2.1-dev scratchpad. 
 
 == Starting Out ==
@@ -9,48 +7,48 @@
 
 Third, you must make some changes to your {{{WEB-INF/cocoon.xconf}}} file.  Add the following
lines to the bottom of the file, inside the closing {{{</cocoon>}}} tag:
 
-{{{
-<!-- This is the cornerstone scheduler -->
-<component role="org.apache.avalon.cornerstone.services.scheduler.TimeScheduler"
-           class="org.apache.cocoon.components.scheduler.DefaultTimeScheduler"/>
-
-<!-- This is the cornerstone thread manager -->
-<component role="org.apache.avalon.cornerstone.services.threads.ThreadManager"
-           class="org.apache.cocoon.components.scheduler.DefaultThreadManager">
-  <thread-group>
-    <name>default</name>
-  </thread-group>
-</component>
-
-<!-- This is an extended cocoon scheduler -->
-<component role="org.apache.cocoon.components.scheduler.Scheduler"
-           class="org.apache.cocoon.components.scheduler.DefaultScheduler">
-    <triggers>
-        <!-- This is a sample trigger -->
-        <trigger name="aggregatorTrigger"
-                 target="org.apache.avalon.cornerstone.services.scheduler.Target/aggy">
-            <timed type="periodic">
-                <period>10000</period> <!-- ms, e.g. 10 seconds -->
-            </timed>
-        </trigger>
-    </triggers>
-</component>
-
-<!-- This is a sample target, that is called as configured in the sample above -->
-
-<component role="org.apache.avalon.cornerstone.services.scheduler.Target/aggy"
-           class="org.apache.cocoon.components.scheduler.TestTarget"/>
+{{{
+<!-- This is the cornerstone scheduler -->
+<component role="org.apache.avalon.cornerstone.services.scheduler.TimeScheduler"
+           class="org.apache.cocoon.components.scheduler.DefaultTimeScheduler"/>
+
+<!-- This is the cornerstone thread manager -->
+<component role="org.apache.avalon.cornerstone.services.threads.ThreadManager"
+           class="org.apache.cocoon.components.scheduler.DefaultThreadManager">
+  <thread-group>
+    <name>default</name>
+  </thread-group>
+</component>
+
+<!-- This is an extended cocoon scheduler -->
+<component role="org.apache.cocoon.components.scheduler.Scheduler"
+           class="org.apache.cocoon.components.scheduler.DefaultScheduler">
+    <triggers>
+        <!-- This is a sample trigger -->
+        <trigger name="aggregatorTrigger"
+                 target="org.apache.avalon.cornerstone.services.scheduler.Target/aggy">
+            <timed type="periodic">
+                <period>10000</period> <!-- ms, e.g. 10 seconds -->
+            </timed>
+        </trigger>
+    </triggers>
+</component>
+
+<!-- This is a sample target, that is called as configured in the sample above -->
+
+<component role="org.apache.avalon.cornerstone.services.scheduler.Target/aggy"
+           class="org.apache.cocoon.components.scheduler.TestTarget"/>
 }}}
 
 Now, restart your servlet container of choice, and check it's STDOUT.  In Tomcat you probably
want {{{$TOMCAT_HOME/logs/stdout.log}}}.  Once everything has started, you should now notice
a message popping up every ten seconds:
 
-{{{
-Target aggregatorTrigger triggered at Mon Aug 25 01:21:16 CDT 2003
-Target aggregatorTrigger triggered at Mon Aug 25 01:21:26 CDT 2003
-Target aggregatorTrigger triggered at Mon Aug 25 01:21:36 CDT 2003
-Target aggregatorTrigger triggered at Mon Aug 25 01:21:46 CDT 2003
-Target aggregatorTrigger triggered at Mon Aug 25 01:21:56 CDT 2003
-Target aggregatorTrigger triggered at Mon Aug 25 01:22:06 CDT 2003
+{{{
+Target aggregatorTrigger triggered at Mon Aug 25 01:21:16 CDT 2003
+Target aggregatorTrigger triggered at Mon Aug 25 01:21:26 CDT 2003
+Target aggregatorTrigger triggered at Mon Aug 25 01:21:36 CDT 2003
+Target aggregatorTrigger triggered at Mon Aug 25 01:21:46 CDT 2003
+Target aggregatorTrigger triggered at Mon Aug 25 01:21:56 CDT 2003
+Target aggregatorTrigger triggered at Mon Aug 25 01:22:06 CDT 2003
 }}}
 
 Obviously, this is a very basic example, and a more complicated example could involve periodic
file downloading, user management, database operations, etc.
@@ -67,14 +65,14 @@
 
 The following trigger will wait 2 seconds before triggering, and then trigger every 10 seconds
afterwards:
 
-{{{
-<trigger name="test"
-         target="org.apache.avalon.cornerstone.services.scheduler.Target/test">
-  <timed type="periodic">
-    <offset>2000</offset> 
-    <period>10000</period> <!-- ms, e.g. 10 seconds -->
-  </timed>
-</trigger>
+{{{
+<trigger name="test"
+         target="org.apache.avalon.cornerstone.services.scheduler.Target/test">
+  <timed type="periodic">
+    <offset>2000</offset> 
+    <period>10000</period> <!-- ms, e.g. 10 seconds -->
+  </timed>
+</trigger>
 }}}
 
 
@@ -96,18 +94,18 @@
 
 '''is!DayOfWeek''': set to {{{true}}} if you want '''day''' to represent the day of the week
(1-7), otherwise, set to {{{false}}} to represent the day of the month (1-31).
 
-{{{
-<trigger name="test"
-         target="org.apache.avalon.cornerstone.services.scheduler.Target/test">
-  <timed type="cron">
-    <minute>34</minute>
-    <hour>11</hour>
-    <month>-1</month>
-    <year>-1</year>
-    <day>-1</day>
-    <isDayOfWeek>true</isDayOfWeek>
-  </timed>
-</trigger>
+{{{
+<trigger name="test"
+         target="org.apache.avalon.cornerstone.services.scheduler.Target/test">
+  <timed type="cron">
+    <minute>34</minute>
+    <hour>11</hour>
+    <month>-1</month>
+    <year>-1</year>
+    <day>-1</day>
+    <isDayOfWeek>true</isDayOfWeek>
+  </timed>
+</trigger>
 }}}
 
 === Coming Soon: Creating your own trigger target. ===

Mime
View raw message