This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Other Open Source Projects and the fly likes Quartz Scheduler Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Quartz Scheduler " Watch "Quartz Scheduler " New topic
Author

Quartz Scheduler

Sonam Zam
Greenhorn

Joined: Apr 18, 2007
Posts: 9
Hi,

I have set my quartz.properties with following configurations.

But the jobs are not scheduled in the same order as I have specified the files.
i.e sometimes jobs2.xml is read before reading job1.xml.

Then whats the significance of the property 'overWriteExistingJobs' ?

If i want that the jobs in job1.xml to get overwritten if job2.xml has the same entry.
In other words, how can I enforce that file2 should always have higher precedence than file1? And if file2 contains same job as file1 then the jobs from file2 should overwrite file1 jobs.

please suggest.
thanks.
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

Sonam Zam wrote:Then whats the significance of the property 'overWriteExistingJobs' ?

I think, 'overWriteExistingJobs' property will overwrite the currently running "same" job.

Sonam Zam wrote:If i want that the jobs in job1.xml to get overwritten if job2.xml has the same entry.

Two Jobs are same when they share the same "group" and same "name". So if job1.xml and job2.xml contains the same name and group then they get overwritten.

Sonam Zam wrote:In other words, how can I enforce that file2 should always have higher precedence than file1? And if file2 contains same job as file1 then the jobs from file2 should overwrite file1 jobs.

Search the JavaDocs, for that information. BTW, why do you want to create the same job in 2 different file ?


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Looking at Quartz sources, it looks like the jobs are stored in a HashMap. The values of the map are iterated using Map#values().iterator(), which is probably why the initialization order is undefined. Now, the problem is to know what the overWriteExistingJobs's real purpose is...


[My Blog]
All roads lead to JavaRanch
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

Christophe Verré wrote:Looking at Quartz sources, it looks like the jobs are stored in a HashMap. The values of the map are iterated using Map#values().iterator(), which is probably why the initialization order is undefined.

That means if someone really want an ORDER of execution, then try defining a separate class and not this PlugIn thing.
Christophe Verré wrote:Now, the problem is to know what the overWriteExistingJobs's real purpose is...

That question leads me to Google, and I found this link from the creator itself:
http://www.opensymphony.com/quartz/wikidocs/JobInitPlugin.html

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Quartz Scheduler
 
Similar Threads
how to read an XML file in java?
file renameTo() method
Windows File Paths
FileSets, any way to order them?
how to set an application context constructor with an array of strings