dev@glassfish.java.net

Re: [Asking]About META-INF/hk2-locator/default

From: Tang Yong <tangyong_at_cn.fujitsu.com>
Date: Thu, 25 Apr 2013 13:36:11 +0900

Thanks! I see.

If john has other suggestions, please telling me.

Thanks
Tang

Sahoo wrote:
> That file does not contain @inject details. Only @service details.
>
> The format may have been documented in hk2 project website. John and co have taken a lot of care to document things. If you don't find any such document, then look at the maven plugin that generates this file.
>
> Since anyway you have to scan classes for @inject annotations, you might as well scan @service annotations. That way you don't have to deal with this file format.
>
> John may also point you in some good direction.
> Thank,
> Sahoo
>
> Sent from my Android phone, please excuse me for its brevity.
>
> -----Original Message-----
> From: Tang Yong [tangyong_at_cn.fujitsu.com]
> Received: Thursday, 25 Apr 2013, 9:11
> To: John Wells [john.wells_at_oracle.com]
> CC: Sahoo [sanjeeb.sahoo_at_oracle.com]; dev_at_glassfish.java.net [dev_at_glassfish.java.net]
> Subject: [Asking]About META-INF/hk2-locator/default
>
> Hi JWells,
> CC: Sahoo,
>
> I have two questions about META-INF/hk2-locator/default file,
> eg. for web-glue.jar,
>
> 1. in the default file, whether containing metadata generated by
> @Inject? That is to say, if some class in web-glue module defines the
> following,
>
> @Inject
> private JCDIService jcdiService;
>
> Then, whether generating @Inject related info(JCDIService,...) into
> META-INF/hk2-locator/default.
>
> As far as I know, I found META-INF/hk2-locator/default seems to only
> write @Service related info.
>
> 2. in web-glue.jar's META-INF/hk2-locator/default file, the following,
>
> ...
> [com.sun.enterprise.web.PEWebContainerFeatureFactoryImpl]S
> contract={com.sun.enterprise.web.pluggable.WebContainerFeatureFactory}
> name=pe
>
> [com.sun.enterprise.web.ServerConfigLookup]
> ...
>
> 1) whether "S" in
> [com.sun.enterprise.web.PEWebContainerFeatureFactoryImpl]S means the
> entry is @Service info?
>
> 2) [com.sun.enterprise.web.ServerConfigLookup] entry has not "S", I want
> to know the meaning?
>
> Finally, if META-INF/hk2-locator/default file does not generate @Inject
> info, I wish that @Inject info can be added into the file because on
> some scenes, I need to introspect glassfish modules(class file) to find
> @Inject info, if the @Inject info can be added into
> META-INF/hk2-locator/default file, that will avoid redundant things by
> pasing the file directly.
>
> Thanks
> --Tang
>

-- 
----------------------
Tang Yong
Senior Engineer
Glassfish Team Developer(OSGi&OSGi-JavaEE)
OSGi Alliance Supporter
Blog: http://osgizone.typepad.com/tangyong/
Nanjing Fujitsu NanDa Software Tec CO.,LTD
http://www.fujitsu.com/cn/fnst
Tel: +86-25-86630566-8310
Fax: +86-25-83317685              
----------------------