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

Key: QUARTZ-314
Type: New Feature New Feature
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: James House
Reporter: Aaron Craven
Votes: 0
Watchers: 0
Operations

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

CronExpression and CronCalendar

Created: 22/Jan/06 04:30 PM   Updated: 20/Feb/06 08:25 PM
Component/s: Core
Affects Version/s: None
Fix Version/s: 1.5.2

File Attachments: 1. Java Source File CronCalendar.java (7 kb)
2. Java Source File CronExpression.java (51 kb)

Environment: n/a
Issue Links:
Duplicate
This issue duplicates:
QUARTZ-117 Remove CronExpression logic from Cron... Trivial Closed
 


 Description  « Hide
Okay, I created this based on ideas I got on the forum (http://forums.opensymphony.com/click.jspa?searchID=131303&messageID=15999, http://forums.opensymphony.com/thread.jspa?messageID=10987&#10987).

The first new class, CronExpression, is just an externalization of the Cron code in CronTrigger, and thus, I don't really consider any of it my own work (the @author tags point out my contribution as simple refactoring of the code). Also, as a side note, since CronTrigger doesn't really provide 'C' character support (should it really even be in the docs?), I have commented it out in the javadocs for CronExpression. See the various public methods for more information on this. I've tried to javadoc everything fairly well.

The second class was the real impetus behind this code, and it defines a new org.quartz.Calendar, called CronCalendar. This allows users to build a calendar using cron expressions to define the excluded times for any trigger. This could be very powerful when used in conjunction with a CronTrigger, although I think the most common use would be with SimpleTriggers. In any case, I thought it was a cool idea, so I thought I'd see if I could make it work.

Note, I did not remove CronTrigger's cron-related code, because I don't know how that would affect the persistence designs. But the changes shouldn't be too hard for the trigger itself.

 All   Comments   Change History      Sort Order:
Aaron Craven - [22/Jan/06 04:36 PM ]
Okay, for some reason, I can't find the file attachment link...

Aaron Craven - [27/Jan/06 06:01 AM ]
CronExpression implementation

Aaron Craven - [27/Jan/06 06:02 AM ]
CronCalendar implementation

Aaron Craven - [27/Jan/06 06:03 AM ]
Nevermind, it's back.

Aaron Craven - [31/Jan/06 08:52 PM ]
I just set up my first persistant jobStore -- I know sad, right?

Anyway, I realized I missed something...

I'm not going to re-upload to fix this, but CronExpression should be marked as Serializable or the persistance stuff won't work for CronCalendar, I don't think. Other than that, it seems to BLOB its way into the database just fine!

Aaron Craven - [11/Feb/06 03:59 PM ]
Note: the changes made in QUARTZ-317 should be made here as well (in CronExpression)

Aaron Craven - [11/Feb/06 09:58 PM ]
Ignore my last comment... I don't know what I was thinking... CronExpression doesn't have a willFireOn method... sorry... long day.

James House - [20/Feb/06 08:19 PM ]

Thanks as always!