[GLASSFISH-19400] Glassfish Domain Ondemand Starting Created: 04/Dec/12  Updated: 05/Dec/12

Status: Open
Project: glassfish
Component/s: OSGi
Affects Version/s: future release
Fix Version/s: None

Type: New Feature Priority: Major
Reporter: TangYong Assignee: Sanjeeb Sahoo
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


This is a big feature and improvement on GF's kernel.
Currently, after starting gf's domain, all bundles in $


modules/ will be installed into felix cache.

Although there is a flag which indicates whether on-demand provisioning, on-demand true means is to only install minimize and reqired set of bundles, then using provisioning tool(eg. felix obr) is to provisioning bundles and dependencies dynamiclly.

Once implementing the feature, glassfish's starting performance and memory consuming will be improved greatly.

In order to attain the goal, we need to do some experiments and tasks.

1) GLASSFISH-19395
2) defining which modules consist of minimize and reqired set while starting domain
3) GLASSFISH-19146

Comment by TangYong [ 04/Dec/12 ]

I have a initial design about gf on-demand starting as following:

1 divide gf's modules into a set of subsystem[1]
[1]: the means of subsystem is similar to jboss 7's subsystem or apache karaf's feature. The following is one of imaginary gf's subsystem,

<subsystems xmlns="http://glassfish.java.net/xmlns/subsystems/v1.0">
<subsystem name="webcontainer" version="">
<module startlevel="XX" start=false>org.glassfish.web.web-glue</module>

Just as the above showing, we define a subsystem called "webcontainer" which is made up of some modules under modules directory[2]. We also define these modules's startlevel in order to start module correctly.

[2]: modules which consist of subsystems of gf should also include "autostat" or other directories apart from "modules".

In order to define a subsystem of gf, we need to define which modules consist of the subsystem correctly.

Then, I start to say why we need to define such subsystems for glassfish and it can bring us which advantages.

Once glassfish started in an on-demand way which only install and start a minimize and reqired set of modules, we will face a problem that how we can activate other modules?

There are two ways:
1) using asadmin deploy command
For example, when we use "asadmin deploy --type=ejb ...", we wish that ejb container(or modules which implements EJB 3.2 spec) can be installed(or provisioning) automaticlly using OBR. If having such a subsystem which clearly defines modules implementing EJB 3.2 spec, we can scan the subsystem definition according to the xml file, then use OBR to install these modules and their dependencies. As to how to start ejb container on-demand, this has been done by HK2 [3].

[3]: as for gf's container starting, hk2 layer along with osgi-adapter can resolve service dependencies and start dependent modules on-demand. However, for some scenes in which we must start some modules ahead of time, we need to define whether module starts in subsystem definition, this is why we define a property called "start=XXX",

<module startlevel="XX" start=false>org.glassfish.web.web-glue</module>

2) creating new command simliar "asadmin install-subsystem XXX"
This will install some subsystem using command.

2 defining which modules consist of minimize and reqired modules while starting domain
Basiclly, according to my understanding, considering the following:
1) modules/endorsed/
2) modules/osgi-resource-locator.jar
3) hk2.bundles
4) obr.bundles
5) modules/glassfish.jar
6) Admin related modules(needing to investigate)

3 enhancing "asadmin deploy --type " in order to support subsystem activation
I have said the point in 1.

As a experiment, I will build a subsystem called "osgi-javaee" which basiclly is made up of modules under "autostat", then, enhancing "asadmin deploy --type=osgi"

Generated at Mon Apr 24 05:01:50 UTC 2017 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.