Helle Leo.

Thanks, looks great! Thats exactly what i needed.

I've just a last small enhancement request, to make overriding the rescheduling 
behaviour even easier:
I've moved the call of "rescheduleEntry" from method run() to the end of method 
runEntry().

This does not change the current behaviour at all, but it is possible to override the 
rescheduling behaviour without need to copy and modify the relative complex run() 
method in the overriding class.

What's your opinion?

Stefan

> Hi Stefan,
> 
> I took a more detailed look at the package (tried both 
> patches), and I 
> figured the most acceptable solution was probably a little 
> refactoring.
> 
> So, how? Since the class previously didn't require any configuration, 
> I'd like to keep things that way. After all, it is still a 
> pretty simple 
> tool, for good reason.
> 
> Yet I agree just making a few random fields / methods 
> protected is ugly 
> because it makes the next person to look at the code scratch 
> his head. 
> The package implementation is pretty well-hidden, which is normally a 
> good thing to do (imo) until you find you need to expose it. Since we 
> now have found that need, I figured we'd just expose it.
> 
> Could you please take a look at the changes I made to the class and 
> lemme know if this works for you?
> 
> - Leo
> 
> PS: the fact that I didn't apply your patches as-sent does 
> not mean they 
> were not valuable in figuring out what to do nor that you 
> should refrain 
> from sending them in for any future issues :D
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.4
diff -u -r1.4 DefaultTimeScheduler.java
--- DefaultTimeScheduler.java   23 Aug 2003 09:46:56 -0000      1.4
+++ DefaultTimeScheduler.java   23 Aug 2003 11:00:10 -0000
@@ -206,8 +206,8 @@
 
                 if( duration < 0 )
                 {
-                    runEntry( entry );
-                    rescheduleEntry( entry, false );
+                    // runs and reschedules the entry
+                    runEntry( entry );                    
                     continue;
                 }
                 else if( 0 == duration )
@@ -423,7 +423,7 @@
     }
 
     /**
-     * Rune entry in a separate thread.
+     * Run entry in a separate thread and reschedule it.
      *
      * @param entry the entry to run
      */
@@ -434,10 +434,10 @@
             public void run()
             {
                 doRunEntry( entry );
-                // Stefan Scheifert:
+                // Stefan Seifert:
                 // rescheduleEntry( entry, false );
                 //
-                // and then don't reschedule in the main run()
+                // and then don't reschedule at the end of runEntry
                 // this will ensure long-running events are
                 // queued
                 //
@@ -456,6 +456,9 @@
             final String message = "Error executing trigger " + entry.getName();
             getLogger().warn( message, e );
         }
+        
+                               // reschedule entry
+                               rescheduleEntry( entry, false );
     }
 
     /**
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to