dev@glassfish.java.net

[Discussion]About GLASSFISH-20937

From: Tang Yong <tangyong_at_cn.fujitsu.com>
Date: Thu, 19 Dec 2013 17:10:58 +0900

Sahoo
JWells

I just created a jira(GLASSFISH-20937). Pl. seeing it.

I think that current so-called starting modules on-demand is Brute Force
, :)

The following two behaviors cause such Brute Force.

1) kernel starting
Kernel starting will proceed to some higher hk2 start level, and attempt
to start these modules. Eg.

proceedTo(PostStartupRunLevel.VAL)

Finally, RunLevel task will use getService form to start the module, So,
 just as the point, osgiModule.start() is right.

2) serviceLocator.getService from general injection
Some module injects some hk2 service from another module. This only
requires us to load class from the module rather than starting the module.

So, just as the point, osgiModule.start() is Brute Force.

Based on the above analyse, I drew a conclusion:

OSGiModuleImpl or Module Interface should add public API(Eg.
isNeedStart()). Then, based on HK2 descriptor or others, isNeedStart()
can tell us whether needing to start the module. If yes, firstly
executing osgiModule.start(), otherwise, directly executing
Bundle.loadClass.

Want to listen your ideas.

Thanks
Tang
-- 
−−−−−−−−−−−−−−−−−−−−−−
Tang Yong
Senior Engineer
GlassFish Committer (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              
−−−−−−−−−−−−−−−−−−−−−−