[seam-dev] Seam Cron API for scheduled .... things

Pete Royle pete at screamingcoder.com
Thu May 12 20:30:34 EDT 2011


George that's a really great suggestion!

Unfortunately there's a couple of teeny tiny hiccups:

- TimeUnit only goes up to SECONDS in JDK 1.5, and I want to support 1.5 
so that Seam Cron can be used n the various CDI JavaSE flavors.
- TimeUnit values are pluralised which don't read very well, eg: 
@Observes @Every(HOURS)

So obviously, we just create our own replacement for TimeUnit. I guess 
it will have to be ... CronTimeUnit ...  *sigh*

:)

https://issues.jboss.org/browse/SEAMCRON-11

Pete R

George Gastaldi wrote:
> I suggest adding a java.util.concurrent.TimeUnit attribute to @Every
> annotation and stick to CronEvent naming standard.
>
> 2011/5/12 Pete Royle <howardmoon at screamingcoder.com>:
>   
>> Hi All,
>>
>> Having trouble deciding on something. Originally observer methods for
>> scheduled events were quite readable and intuitive, eg:
>>
>> public void doStuff(@Observes @Scheduled("10:00") Event e) { ... }
>>
>> However, due to possible confusion between org.jboss.seam.cron.events.Event
>> and javax.enterprise.event.Event Event was renamed to CronEvent. This is
>> fine, but I wonder if there's any better options. Viable options I've
>> thought of so far include:
>>
>> @Observes @Scheduled("10:00") CronEvent ce
>> @Observes @Scheduled("10:00") Instant i
>> @Observes @Scheduled("10:00") Moment m
>> @Observes @Scheduled("10:00") Tick t
>> @Observes @Scheduled("10:00") Occurrence o
>> @Observes @Scheduled("10:00") Appointment a
>>
>> Or maybe go for something different like:
>>
>> @Observes @At("10:00") Schedule s
>> @Observes @Recurring("10:00") Schedule s
>>
>> I figured since this is going to be the most used part of the API I would
>> throw it out there for discussion and to see if there are any better ideas
>> out there.
>>
>> It's probably worth mentioining that another part of the API looks like
>> this:
>>
>> @Observes @Every Second s
>> @Observes @Every Minute m
>> @Observes @Every Hour h
>>
>> Thanks for the feedback.
>>
>> Pete R
>>
>> _______________________________________________
>> seam-dev mailing list
>> seam-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/seam-dev
>>
>>
>>     


More information about the seam-dev mailing list