commit ff72ee01251f3b7a628c511bbb65cf061b224368 Author: Sanjeeb Sahoo Date: Mon Jul 9 04:49:25 2012 +0530 GLASSFISH-18870: Avoid configuring embeddable packages in osgi.properties diff --git a/nucleus/common/simple-glassfish-api/osgi.bundle b/nucleus/common/simple-glassfish-api/osgi.bundle index ffde229..4c6603b 100644 --- a/nucleus/common/simple-glassfish-api/osgi.bundle +++ b/nucleus/common/simple-glassfish-api/osgi.bundle @@ -1,7 +1,7 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. # -# Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2010-2012 Oracle and/or its affiliates. All rights reserved. # # The contents of this file are subject to the terms of either the GNU # General Public License Version 2 only ("GPL") or the Common Development @@ -38,5 +38,17 @@ # holder. # --exportcontents: !* +# This is a framework extension so that any non-osgi app embedding glassfish will share +# org.glassfish.embeddable packages with rest of glassfish modules. +Fragment-Host: system.bundle; extension:=framework + +# For embeddable packages, we use semantic versioning. +# Since they have not changed since 3.1.1, they are exported with that old version even now. +# These packages are also duplicated and exported by glassfish.jar (built from nuclues/core/bootstrap) +# so that anyone can provision glassfish in an existing OSGi runtime using just that bundle. +# That's our ease of use feature, but the duplication has added an overhead as well. +# Everytime we change here, we need to change there as well or vice-versa. +-exportcontents: org.glassfish.embeddable;org.glassfish.embeddable.spi;version=3.1.1 + +# This is a framework extension, so can't import anything Import-Package: !* diff --git a/nucleus/core/bootstrap/osgi.bundle b/nucleus/core/bootstrap/osgi.bundle index 5a530ce..66f9168 100644 --- a/nucleus/core/bootstrap/osgi.bundle +++ b/nucleus/core/bootstrap/osgi.bundle @@ -1,7 +1,7 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. # -# Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011-2012 Oracle and/or its affiliates. All rights reserved. # # The contents of this file are subject to the terms of either the GNU # General Public License Version 2 only ("GPL") or the Common Development @@ -40,7 +40,7 @@ Bundle-Activator: com.sun.enterprise.glassfish.bootstrap.osgi.GlassFishMainActivator -# Please note we don't everything that's required by every class in this module. +# Please note we don't import everything that's required by every class in this module. # We only import packages required by GlassFishMainActivator and its dependencies # such as EmbeddedOSGiGlassFishRuntimeBuilder. The rest of the dependencies are # pulled in dynamically via DynamicImport-Package. By doing this, we will be able @@ -53,9 +53,13 @@ Import-Package: \ DynamicImport-Package: * -# For embeddable packages, we use semantic versioning. Their version is still 3.1.1, -# since they have not changed since 3.1.1. This version must match what is found in -# osgi.properties file. +# For ease of use reasons, we bundle & export embeddable packages in this bundle, +# although the source of those packages is simple-glassfish-api module. +# We have not figured out a way to configure bundle-plugin to deduce the package version +# for a package that's borrowed from another bundle, hence we have to configure the +# version here as well. We understand this is a duplication, but that's easy to manage given that +# we don't revise these packages that often. The version here is same as what's specified in +# simple-glassfish-api/osgi.bundle. That's the source of truth. -exportcontents: \ - org.glassfish.embeddable.*; \ - com.sun.enterprise.glassfish.bootstrap; version=3.1.1 + org.glassfish.embeddable.*; version=3.1.1, \ + com.sun.enterprise.glassfish.bootstrap diff --git a/nucleus/osgi-platforms/felix/src/main/resources/glassfish/config/osgi.properties b/nucleus/osgi-platforms/felix/src/main/resources/glassfish/config/osgi.properties index f67a3f2..ec82341 100755 --- a/nucleus/osgi-platforms/felix/src/main/resources/glassfish/config/osgi.properties +++ b/nucleus/osgi-platforms/felix/src/main/resources/glassfish/config/osgi.properties @@ -87,8 +87,7 @@ Equinox.system.packages=${extra-system-packages} org.osgi.framework.system.packages=${${GlassFish_Platform}.system.packages} -# embeddable package version must match what is found in core/bootstrap/osgi.bundle file. See that file more details. -extra-system-packages=${jre-${java.specification.version}}, org.glassfish.embeddable;org.glassfish.embeddable.spi;version=3.1.1 +extra-system-packages=${jre-${java.specification.version}} # Although Eclipselink imports these packages, in typical GlassFish installation, # Oracle JDBC driver may not be available as a bundle, so we ask user to install it in