Skip to main content

Source code revision

svn

summary: 1. Integrating 0.3.10-SNAPSHOT version of HK2. We should no longer see the annoying exception that was reported by repeated attempts to install
revision: 21565
author: Sahoo
date: 2008-08-04 12:20:43 UTC (6 years)
message: 1. Integrating 0.3.10-SNAPSHOT version of HK2. We should no longer see the
annoying exception that was reported by repeated attempts to install
auto-start bundles. We also need other changes that have gone in HK2 to
allow the class loader hiearchy changes that is being commited as part of this
check in. BTW, I am forced to use a SNAPSHOT version of HK2, as Hudson is not
able to perform a release. When Hudson is fixed, we can switch to using 0.3.10.
Affected file:
M pom.xml

2. HK2 bundles now import javax.xml.stream, so we have to add
javax.xml.stream-$version.jar to auto-start bundle list
in felix/connf/config.properties. This explains the change made to following
files:
M osgi-platforms/felix/src/main/resources/glassfish/felix/conf/config.properties
M osgi-platforms/felix/pom.xml
M osgi-platforms/felix/build.xml

3. Now, the most important change. It's to do with the application class loader
hierarchy. As discussed in the OSGi/V3 one-pager, application class loader
in v3 behaves very similarly to v2, with the exception that not all server
classes are visible. Only classes exported by implementation bundles for
public use are available to application class loader. The hierarchy looks like
this:

archive class loader [H]
-> Modules class loader [G]
-> applib class loader [F]
-> connector class loader [E]
-> common class loader [D]
-> public API class loader [C]
-> extension class loader [B]
-> null (a.k.a. bootstrap class loader) [A]

Description of each element of the above delegation chain is given below:

A. null: This is the bootstrap class loader of JRE. loads classes from rt.jar.

B. extension class loader: It is JRE supplied class loader. Takes care of
installed extensions (i.e. java.ext.dirs).

C. public API class loader: It makes available all classes specifically
exported by OSGi bundles installed in the runtime. This typically includes,
but not limited to, Java EE APIs and other GlassFish APIs that we want
applications to have access to. Currently, our OSGi bundles pretty much expose
every package for public use. This should be fixed as described in
https://glassfish.dev.java.net/issues/show_bug.cgi?id=5385.
This class loader is implemented as a class loader of a OSGi bundle which
has following import statement:
DynamicImport-Package: *

D. common class loader: This is responsible for making available libraries and
classes installed in following places (in the order mentioned below):
domain/lib/, domain/classes/, domain/lib/

E. connector class loader: This is responsible for making standalone connectors
available to deployed applications. It is written such that we can easily
implement the new recommendation of Java EE 6 spec, which says a container
should only make those standalone RARs available to applications that
applications specifically depend on.

F. applib class loader: Respondible for taking care of scoped libraries. These
are libraries that an application depends on by specifying --libraries option
during deployment.

G: Modules class loader: This has visibility to all OSGi bundles that
an application specifically requests access to either using HK2-Import-Bundles
header or GlassFish-Requires-Service headers in manifest.mf. I strongly
discourage using those techniques.

H. archive class loader: Responsible for loading classes from application
archive.

This hierarchy is pretty similar to what we have in v2: http://docs.sun.com/app/docs/doc/819-3659/beadf?a=view

To get hold of various elements of the hierarchy, a new API has been
introduced in internal-api module called ClassLoaderHierarchy.

4. Changed webtier-all to be a pom type project. It was an empty jar used
only for distribution. There is a bug in distribution logic which copies
pom.xml to modules dir. It is filed as
https://glassfish.dev.java.net/issues/show_bug.cgi?id=5424

5. As part of this change, I also fixed following bug:
https://glassfish.dev.java.net/issues/show_bug.cgi?id=5419

TODO:
I have temporarily disable reusability of Felix cache. Need to investigate
further as part of https://glassfish.dev.java.net/issues/show_bug.cgi?id=5425

Change Path Actions
A trunk/v3/common/internal-api/src/main/java/org/glassfish/internal/api/ClassLoaderHierarchy.java
A trunk/v3/common/internal-api/src/main/java/org/glassfish/internal/api/DelegatingClassLoader.java
M trunk/v3/connectors/connectors-runtime/pom.xml
M trunk/v3/connectors/connectors-runtime/src/main/java/com/sun/enterprise/connectors/ConnectorRuntime.java
M trunk/v3/connectors/connectors-runtime/src/main/java/com/sun/enterprise/connectors/service/ResourceAdapterAdminServiceImpl.java
M trunk/v3/core/bootstrap/src/main/java/com/sun/enterprise/glassfish/bootstrap/ASMainHelper.java
M trunk/v3/core/bootstrap/src/main/java/com/sun/enterprise/glassfish/bootstrap/ASMainOSGi.java
M trunk/v3/core/kernel/pom.xml
A trunk/v3/core/kernel/src/main/java/com/sun/enterprise/v3/server/APIClassLoaderServiceImpl.java
A trunk/v3/core/kernel/src/main/java/com/sun/enterprise/v3/server/AppLibClassLoaderServiceImpl.java
M trunk/v3/core/kernel/src/main/java/com/sun/enterprise/v3/server/ApplicationLifecycle.java
M trunk/v3/core/kernel/src/main/java/com/sun/enterprise/v3/server/ApplicationLoaderInjector.java
M trunk/v3/core/kernel/src/main/java/com/sun/enterprise/v3/server/ApplicationLoaderService.java
A trunk/v3/core/kernel/src/main/java/com/sun/enterprise/v3/server/ClassLoaderHierarchyImpl.java
A trunk/v3/core/kernel/src/main/java/com/sun/enterprise/v3/server/CommonClassLoaderServiceImpl.java
A trunk/v3/core/kernel/src/main/java/com/sun/enterprise/v3/server/ConnectorClassLoaderServiceImpl.java
M trunk/v3/osgi-platforms/felix/build.xml
M trunk/v3/osgi-platforms/felix/pom.xml
M trunk/v3/osgi-platforms/felix/src/main/resources/glassfish/felix/conf/config.properties
M trunk/v3/pom.xml
M trunk/v3/web/jsf-connector/pom.xml
M trunk/v3/web/webtier-all/pom.xml
 
 
Close
loading
Please Confirm
Close