users@glassfish.java.net

Re: HK2: How to get a list of instances that implement a service

From: Jerome Dochez <Jerome.Dochez_at_Sun.COM>
Date: Wed, 20 Aug 2008 11:00:01 -0700

David Van Couvering wrote:
> I sent this to the HK2 user list but it seems kind of quiet over
> there, so I'm resending here:
>
> Hi, all. I would like to get all instances that implement a given
> service. How do I do this?
> The Javadoc refers to a ServiceLookup
>
> https://hk2.dev.java.net/nonav/hk2/apidocs/com/sun/enterprise/module/ServiceLookup.html
>
>
> but I can't find this in the code repository nor can I find out how I
> gain access to an instance of ServiceLookup.
the easiest is to use the habitat.

habitat.getAllByContract(Class<T> contract).

jerome

>
> Thanks,
>
> David
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>