History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: QUARTZ-192
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: James House
Reporter: Sean Owen
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Quartz Scheduler

Support config file extensions in JobSchedulingDataProcessor

Created: 10/May/05 01:26 PM   Updated: 15/Jul/05 01:12 PM
Component/s: Core
Affects Version/s: 1.4.5
Fix Version/s: 1.5


 Description  « Hide
I would like to be able to support additional elements in the Quartz configuration file for my own project purposes. Currently I extend JobSchedulingDataProcessor for this purpose, so that I can add and/or modify rules in the config processor's Digester instance.

While subclasses can access the protected Digester instance, they can't add rules between the time the Digester is instantiated and the time that Quartz adds its own rules, since both are done in initDigester(). Since one can't remove or replace Digester rules once set, this means that I can't modify the rules.

I get around this with a big hack: I override initSchemaValidation(), which is called between instantation and configuration of the Digester, in order to insert my rules.

I realize that most applications will never want to do such a thing, but just a small change could make it possible, cleanly:

1. Set Digester in the constructor, rather than in initDigester(). Then applications can add their own rules by overriding initDigester(), adding rules, then calling super.initDigester(). Incidentally, the Digester instance could then be declared final.

2. Or, move rule configuration into a separate addDigesterRules() method that could be overridden.

3. Or, add an addCustomDigesterRules() method that can be overridden, that does nothing in JobSchedulingDataProcessor, that is called in initDigester() just after the Digester is instantiated.

Thanks!

 All   Comments   Change History      Sort Order:
James House - [15/Jul/05 01:12 PM ]
I did option #3 above, but a tad more fancy than suggested. ;-)