[webbeans-dev] Re: Suggestion

Gavin King gavin at hibernate.org
Wed Dec 3 15:20:50 EST 2008


On Wed, Dec 3, 2008 at 1:33 PM, Scott Ferguson <ferg at caucho.com> wrote:

> The overhead would be pretty high, I'd think.

Well, the manager would know if there were observers for the event,
and would only need to raise the event if any observers actually
existed.

> The disposal method is fine,
> because it's a fairly infrequent use case (@PreDestroy would be more
> common), so most people can ignore that part of the spec.  In other words,
> disposes doesn't really add to the spec complexity, and it nicely matches
> with the @Produces method.

Yes, I like the symmetry a lot.

> As long as you're thinking about events, an event that would be useful would
> be a startup event for each Bean after all the class scanning and XML
> parsing is complete.  With that event, you can do some clever things like
> starting up singleton services, similar to the Listeners in the Servlet
> spec.

How would this be different to the @Initialized Manager event?

BTW, I already have on my todo list the idea of providing some kind of
hook that allows you to wrap the Bean object created by the Manager.
I'm not 100% sure that we will get up to actually doing this in this
release, but it would for the extensibility usecase...

-- 
Gavin King
gavin.king at gmail.com
http://in.relation.to/Bloggers/Gavin
http://hibernate.org
http://seamframework.org



More information about the weld-dev mailing list