[webbeans-dev] Bean removal

Gavin King gavin at hibernate.org
Fri Nov 14 11:32:02 EST 2008


Nick, please see (and review) the attached latest draft which has
changes in this area.

Answers inline.

On Fri, Nov 14, 2008 at 2:14 AM, Nicklas Karlsson <nickarls at gmail.com> wrote:
> Some question on bean removal / contexts:
>
> * 8.2 says destroying a context calls all Bean.destroy methods. Is it
> implied that they are also removed from the context?
> Or are the bean instances just flagged "destroyed"?

8.1 says:

"The Context implementation is responsible for destroying any Web Bean
instance it creates by passing the instance to the destroy() method of
the Bean object representing the Web Bean. A destroyed instance must
not subsequently be returned by the get() method."

Perhaps 8.2 could be slightly more explicit, but I think 8.1 captures it, right?


> * How is a bean removed from a context manually? Currently, there is
> no API on ManagerImp/NormalContext for this, should there be?

Right, it is not supported.

> * Calling a bean destroy method manually does nothing extra from
> lifecycle point of view?

"extra" in what sense? What is a "bean destroy method"?

> * Calling an EJB remove method triggers the (currently non-existent)
> remove method on the Manager impl which then calls the destroy method
> and removes the bean from the context (with the currently
> non-existent) Context impl remove method?

This requirement could not be implemented without a Context.remove()
method, and so I have removed it from the spec.

> * Can a bean be removed from a context that is not currently active?

No.


-- 
Gavin King
gavin.king at gmail.com
http://in.relation.to/Bloggers/Gavin
http://hibernate.org
http://seamframework.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Web Beans 20081114.pdf
Type: application/pdf
Size: 512137 bytes
Desc: not available
Url : http://lists.jboss.org/pipermail/weld-dev/attachments/20081114/36c9c074/attachment.pdf 


More information about the weld-dev mailing list