I want to use the TimeScheduler componente in a phoenix-based server environment and, 
for some reasons, need a slightly different behaviour of the TimeSchedule component 
concering periodic triggers:

In the current implementation the target is triggerd in a separate thread. For this 
reason, the next trigger is triggerd with a duration relative to the *start* of the 
target execution. This is a problem with long running tasks in this target execution, 
because several executions would overlap (or - using synchronized - queue up and 
executly immediately several times).

Attached is a patch that corrects this: rescheduleEntry is called when the separate 
thread for target executions finishes, not when it starts.

If this patch makes sense please apply it to the cvs repository. If not, please let me 
know; in this case i have to create my own time scheduler block with my needed 
behavior (unfortunately it is not possible to sublcass DefaultTimeScheduler and 
override this, because the relevant methods/fields are private).

Stefan
Index: DefaultTimeScheduler.java
===================================================================
RCS file: 
/home/cvspublic/avalon-components/scheduler-impl/src/java/org/apache/avalon/cornerstone/blocks/scheduler/DefaultTimeScheduler.java,v
retrieving revision 1.2
diff -u -r1.2 DefaultTimeScheduler.java
--- DefaultTimeScheduler.java   19 Jun 2003 20:31:29 -0000      1.2
+++ DefaultTimeScheduler.java   12 Aug 2003 12:51:43 -0000
@@ -253,6 +253,7 @@
             public void run()
             {
                 doRunEntry( entry );
+                                                               rescheduleEntry( 
entry, false );
             }
         };
 
@@ -349,7 +350,6 @@
                 if( duration < 0 )
                 {
                     runEntry( entry );
-                    rescheduleEntry( entry, false );
                     continue;
                 }
                 else if( 0 == duration )
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to