|
From: Trevor C. <pr...@se...> - 2003-11-03 17:02:53
|
Ivan, while you're working on the unit tests, would it be possible to post your current source (probably just as a zip in this thread) for comparing with how to reconcile it with Quartz. My early findings are based on assumptions I'm making about "Chronos". If any of my assumptions are incorrect, please let me know (I should be more accurate once I can examine the source). COMPARISON ---------- Chronos is create explicitly as a cron scheduler. Quartz is created as a "generic" scheduler, using different trigger types to control scheduling type (SimpleTrigger vs CronTrigger). Chronos uses 2 different methods for creating tasks, one for "in-memory" and one for "persistent". Quartz uses a single scheduling mechanism. The underlying store (ram or jdbc) is determined by the schedulers configuration. Chronos allows any POJO to be turned into a task by wrapping it. Quartz requires objects to implement "Job" which contains a single method "execute(JobExecutionContext context)". Chronos allows a single parameter to be added to the job during creation, and does not appear to have a method of passing additional information when the task is actually run. Quartz stores parameters with the Job, and also allows modifying the "JobExecutionContext" just before execution through the use of a "JobListener". Quartz uses names for the tasks (and also has groups). Chronos does not appear to have any naming for it's tasks. RECOMMENDATION -------------- 1. The scheduler's persistence mechanism should be part of the scheduler configuration rather than as seperate methods (similiar to Quartz). This would mean that Chronos would need to be changed to set this configuration. 2. The scheduling mechansim should use a task/trigger mechansim (similiar to Quartz). Chronos could still provide a single type of trigger (Cron), but this would change the scheduling mechanism. 3. No special interface should be required thus allowing any POJO to function as a job (similiar to Chronos). I'm also thinking that Spring's bean handling could be used to mask any parameters passed to the job so that a map could be converted to actual objects (especially for Quartz where you're bascially doing "(cast)map.get(x)" for all parameters). 4. Naming of jobs should be allowed but not required (allowing "simple" usage"). Once I get the Chronos source-code, I'll try to make a few concrete examples. If there are no objections, I'll put the examples, initial Spring scheduling interfaces, and Chronos code into the sandbox so everyone can see it and make comments. This will also require adding Quartz to Spring, although this will only affect developer/cvs downloads (I won't be adding it to the distribution build scripts). Any objections? Trevor |