[webbeans-dev] Hierarchical Managers

Gavin King gavin at hibernate.org
Tue Nov 18 12:30:53 EST 2008


Oracle have a usecase where they want to be able to define Web Beans
within a particular "context" (in their usecase, the context is
something like an orchestration task). I think we can handle this by
providing a hierarchy of Managers. We would add a method to Manager to
create a child, and a method to associate a child (or root) Manager
with the current context associated with a certain active scope:

   public interface Manager {
      ...
      public Manager createChild();
      public void setCurrent(Class<Annotation> scopeType);
   }

A child Manager would inherit all Web Beans, interceptors, decorators,
contexts of its parent, but would allow addition of now ones. So
Oracle's orchestration engine could create a Manager object for each
task definition at startup time, and then when the task started
processing, call setCurrent(TaskScoped.class). When the context ends,
web beans automagically reverts to the root Manager.

What do you guys think?

Bill, do you think this solves the problem you guys have?


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