[webbeans-dev] Replacement pattern for Manager.getInstanceByType

Gavin King gavin.king at gmail.com
Tue May 26 22:20:44 EDT 2009


yes, that's right.

On Tue, May 26, 2009 at 6:42 PM, Clint Popetz <cpopetz at gmail.com> wrote:
> >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
>
> _______________________________________________
> webbeans-dev mailing list
> webbeans-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/webbeans-dev
>
>



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