synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dinusha Dilrukshi <sdddilruk...@gmail.com>
Subject Re: Upgrading quartz version used in synapse-task
Date Thu, 12 Jan 2012 16:56:34 GMT
Hi Hiranya,

Please find the JIRA created to track this in link[1]. And also note that,
other than the synapse-task, synapse-massage-processors code also need to
change according to the quartz2. I ll make necessary changes to that as
well.

As a summarization of major API changes,

1. DSLs for working with jobs and triggers and builder-based API for
construction Jobs and Triggers. Set of new classes has been introduced to
handle Jobs and Triggers : *TriggerBuilder, JobBuilder,
SimpleScheduleBuilder, CronScheduleBuilder,
CalendarIntervalSchedulerBuilder, DateBuilder*. This will simplify current
code and make it more clear, readable, and maintainable.
For example,
*Old code:*

SimpleTrigger trg = new SimpleTrigger("myTrigger", null);
trg.setStartTime(new Date(System.currentTimeMillis() + 10000L));
trg.setPriority(6);
trg.setJobName("myJob");
trg.setJobGroup("myGroup");
trg.setRepeatCount(SimpleTrigger.REPEAT_INDEFINITELY);
trg.setRepeatInterval(30000L)*;*

*New code:*

Trigger trg = newTrigger()
    .withIdentity("myTrigger")
    .startAt(futureDate(10, IntervalUnit.SECONDS))
    .withPriority(6)
    .forJob(job)
    .withSchedule(simpleSchedule()
        .withIntervalInSeconds(30)
        .repeatForever())
    .build();


2. Job and Trigger identification is now based on *JobKey* and *TriggerKey*.
Keys include both name and group. So all the methods which operate on
particular jobs/triggers now take keys as the parameter.
For examples,
*                 - getTrigger(TriggerKey key): Trigger*, rather than
*getTrigger(String
name, String group): Trigger*.
                 - deleteJob(JobKey jobKey): boolean, rather than
 deleteJob(String name, String group): boolean.

3. Introduce of Interfaces instead of classes,
For example,
                 - *Trigger* is now an interface, rather than a class.
Likewise for *SimpleTrigger*, *CronTrigger*, etc.
                 - JobDetail is now an interface.

4. Collections and generics-- getJobGroupNames(): List<String>, no more use
of arrays to get groups of job details, triggers, other clumps of data from
the scheduler

Further details about API changes can be found in discussion link [2] and
 link [3].

[1]. https://issues.apache.org/jira/browse/SYNAPSE-837
[2]. http://forums.terracotta.org/forums/posts/list/0/6480.page#32884
[3].
http://quartz-scheduler.org/documentation/quartz-2.x/new-in-quartz-2#api-changes

Regards,
~Dinusha~



On Wed, Jan 11, 2012 at 9:24 PM, Hiranya Jayathilaka
<hiranya911@gmail.com>wrote:

> Hi Dinusha,
>
> On Wed, Jan 11, 2012 at 6:24 PM, Dinusha Dilrukshi <sdddilrukshi@gmail.com
> > wrote:
>
>> Hi,
>>
>> Current synapse-task implementation has used quartz 1.6.0 version which
>> is something old. The quartz latest stable version 2.1.1 seem to have many
>> functional improvements and new features over 1.6.0 version. So it will be
>> a good idea to upgrade quartz version to 2.1.1 to have future enhancements
>> in synapse-task.
>>
>> Refer to the document what's new in quartz2 [1]
>> [1] http://quartz-scheduler.org/documentation/quartz-2.x/new-in-quartz-2
>>
>> <http://quartz-scheduler.org/documentation/quartz-2.x/new-in-quartz-2>I
>> would happy to provide a patch for this.
>>
>
> Sounds great. Please do provide a patch through the JIRA. BTW can you
> please summarize what are the major API changes between the 2 versions of
> Quartz?
>
> Thanks,
> Hiranya
>
>
>>
>> ~Dinusha~
>>
>>
>
>
> --
> Hiranya Jayathilaka
> Associate Technical Lead;
> WSO2 Inc.;  http://wso2.org
> E-mail: hiranya@wso2.com;  Mobile: +94 77 633 3491
> Blog: http://techfeast-hiranya.blogspot.com
>

Mime
View raw message