[webbeans-dev] Replacement pattern for Manager.getInstanceByType

Clint Popetz cpopetz at gmail.com
Tue May 26 21:42:13 EDT 2009


>From what I can tell, code that used to do:

   manager.getInstanceByType(clazz)

now need to do:

   manager.getReference(manager.getBeans(clazz).iterator().next(),clazz);

(plus checking that the set contains only one element and throwing an
exception if not.)

Is that really true?  Is there no more direct way to obtain this in the
SPI?  It seems like a pretty common case.  If not, I can have a utility
method to do the above in the core, as many things don't cast to
ManagerImpl, so I'd rather not put it there.

-Clint


-- 
Clint Popetz
http://42lines.net
Scalable Web Application Development
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/weld-dev/attachments/20090526/540da187/attachment.html 


More information about the weld-dev mailing list