[webbeans-dev] CDI Quartz Extension and SE Example

howardmoon at screamingcoder.com howardmoon at screamingcoder.com
Tue Jun 30 19:32:18 EDT 2009


OK then, I'll include the sample app. Cheers.

On Tue, 30 Jun 2009 12:03:50 +0100, Pete Muir <pmuir at redhat.com> wrote:
> I agree that the primary focus of Seam 3 is around writing enterprise  
> applications (which of course doesn't exclude SE apps!), but I see no  
> problem with having other example apps, especially in the sandbox.
> 
> On 30 Jun 2009, at 09:34, <pete at screamingcoder.com>
> <pete at screamingcoder.com 
>  > wrote:
> 
>> OK that's all implemented. The only slight differences are:
>>
>> - the properties file where the named scheduls are defined is called
>> scheduler.properties and lives at the root of the classpath  
>> (optionally
>> provided by the client application)
>>
>> - typesafe schedule binding types use the same mechanism as used by
>> interceptor binding types to approximate inheritence, ie:
>>
>> @Scheduled("after.hours")
>> @BindingType
>> @Retention(RUNTIME)
>> public @interface AfterHours {};
>>
>> - the type for arbitrarily scheduled events is now called Event, not
>> Schedule.
>>
>> I'm ready to check this in, just need to find some decent internet  
>> access
>> (probably next week) so I can chat with Pete M and Dan, and then  
>> perform
>> the checkin.
>>
>> Just have one question: Do you want the free-memory grapher example  
>> app
>> which demostrates usage of this module? If so the I'm not sure how  
>> that
>> will work since it is a SE/Swing app and this module will be going  
>> into the
>> Seam modules sandbox. I think it will look a little weird for an SE  
>> app to
>> depend on a Seam module. I guess I'm really wondering why the ties  
>> to Seam
>> when this is a generally useful module?
>>
>> Cheers,
>>
>> Pete.
>>
>>
>>
>>
>>
>> On Thu, 25 Jun 2009 11:37:46 +0100, Peter Royle
>> <howardmoon at screamingcoder.com> wrote:
>>> OK will do. I'm just implementing the stuff below and cleaning up a
>>> bit first. Got a 24hr flight ahead of me so should be able to get a
>>> lot done - if I'm not rendered a zombie :).
>>>
>>>
>>> On 19/06/2009, at 7:12 PM, Pete Muir wrote:
>>>
>>>> How about putting this in Seam sandbox/modules for now?
>>>>
>>>> Talk to Dan Allen offline about the structure for the code (but
>>>> basically it is like webbeans-extensions).
>>>>
>>>> Also, ping me and I'll sort out the SVN permissions.
>>>>
>>>> On 28 May 2009, at 22:45, Peter Royle wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I know you're all really busy right now with the spec updates, but
>>>>> I've got a new extension for possible inclusion into WebBeans, plus
>>>>> a new example app for SE which uses it.
>>>>>
>>>>> == Quartz Extension ==
>>>>>
>>>>> WebBeans-Quartz.zip
>>>>>
>>>>> The extension is a Quartz extension. It basically fires events
>>>>> @Every Second, @Every Minute and @Every Hour, which can be observed
>>>>> like so:
>>>>>
>>>>> public void updateSomething(@Observes @Every Hour hour) { // blah }
>>>>>
>>>>> On startup the extension first checks for the presence of observers
>>>>> for each type of event and if there are no observers for a
>>>>> particular type of event, no events will be scheduled.
>>>>>
>>>>> I intend to extend it by:
>>>>> 1)  introducing a way to define arbitrary schedules (in annotations
>>>>> or in a properties file which is then referenced by name in an
>>>>> annotation - which can then be made typesafe by subclassing the
>>>>> annotation). Eg:
>>>>>
>>>>>   package org.jboss.webbeans.extension.scheduler;
>>>>>   public @interface Scheduled {
>>>>>       String name();
>>>>>   }
>>>>> -----------
>>>>>   public @interface AfterHours extends Scheduled{
>>>>>        String name() default "afterHours";
>>>>>   }
>>>>> -----------
>>>>>   schedule.properties:
>>>>>   afterHours=0 1 * * * *
>>>>> -----------
>>>>>   public void batchProcess(@Observes @AfterHours Schedule
>>>>> schedule) { ... }
>>>>>
>>>>> 2) Adding whatever is necessary to make this usable in EE
>>>>> environment. Any pointers?
>>>>>
>>>>> 3) Any other suggestions?
>>>>>
>>>>> == Memory Graph Example ==
>>>>>
>>>>> MemoryGrapher.zip
>>>>>
>>>>> This is another Swing based example, which renders a graph of the
>>>>> VM's free memory, updating every second and calling garbage
>>>>> collection every minute using the above extension. It's a nice
>>>>> concise example of how to bootstrap and shutdown SE, how to observe
>>>>> events and how to use the injectable logger. Plus everyone loves a
>>>>> pretty graph!
>>>>>
>>>>> I know there is some obvious clean up work required, and maybe
>>>>> removing the name Quartz (?) - which I'm happy to do prior to
>>>>> checking in.
>>>>>
>>>>> What do you think?
>>>>>
>>>>>
>>>>> Pete.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> webbeans-dev mailing list
>>>>> webbeans-dev at lists.jboss.org
>>>>> https://lists.jboss.org/mailman/listinfo/webbeans-dev
>>>>
>>>
>>> _______________________________________________
>>> webbeans-dev mailing list
>>> webbeans-dev at lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/webbeans-dev



More information about the weld-dev mailing list