On Tue, Sep 6, 2011 at 18:26, Pete Muir <pmuir@redhat.com> wrote:
Regarding https://issues.jboss.org/browse/CDI-14, I've created this patch https://github.com/jboss/cdi/pull/43.

This also touches on CDI-26, which is about providing an embedded mode (API for starting CDI) - it covers about 50% of that issue. It doesn't provide a bootstrap API, but it does provide a programmatic API to access the container:

CDI.current().getBeanManager();

CDI.current().select(MyBean.class).select(new MyQualifierLiteral()).doSomething();

(CDI implements Instance)

I like the approach. The name of the current() method doesn't feel quite right. What about:

CDI.getRuntime()

(this was also suggested by Laird Neslon).

-Dan
 
--
Dan Allen
Principal Software Engineer, Red Hat | Author of Seam in Action
Registered Linux User #231597

http://www.google.com/profiles/dan.j.allen#about
http://mojavelinux.com
http://mojavelinux.com/seaminaction