[webbeans-dev] CreationalContext.destroyDependents()

Gavin King gavin.king at gmail.com
Mon May 25 23:36:30 EDT 2009


Folks, I think we should add a new method to CreationalContext, to
allow for easier and efficient implementation of custom Context
objects.

    public interface CreationalContext<T> {
        public void push(T incompleteInstance);
        public void destroy();
    }

The destroy() method would destroy any dependent objects of the
instance that was created in that CreationalContext.

The custom Context would be responsible for maintaining the list of
CreationalContexts internally, and calling destroy() on each of them
when the context is destroyed. This would allow the container to
optimize out any map lookups, etc.

WDYT?

-- 
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