Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2007-09-13 16:12:05 -0400
committerThomas Watson2007-09-13 16:12:05 -0400
commit90da1046c654a7e8adb83d26c9eb8e14fc7c3766 (patch)
treec9d9c943e8767300d1f1ba35a109b25332773f1e
parente79e3c06bd1b2ab805d099444a02ddca2cc92de0 (diff)
downloadrt.equinox.framework-90da1046c654a7e8adb83d26c9eb8e14fc7c3766.tar.gz
rt.equinox.framework-90da1046c654a7e8adb83d26c9eb8e14fc7c3766.tar.xz
rt.equinox.framework-90da1046c654a7e8adb83d26c9eb8e14fc7c3766.zip
Bug 202282 Support a proposed extension:="ext"v20070914
-rw-r--r--bundles/org.eclipse.osgi.tests/.classpath6
-rw-r--r--bundles/org.eclipse.osgi.tests/META-INF/MANIFEST.MF1
-rw-r--r--bundles/org.eclipse.osgi.tests/build.properties14
-rw-r--r--bundles/org.eclipse.osgi.tests/bundles_src/ext.extclasspath.a.importer/META-INF/MANIFEST.MF9
-rw-r--r--bundles/org.eclipse.osgi.tests/bundles_src/ext.extclasspath.a.importer/ext/extclasspath/a/importer/Activator.java30
-rw-r--r--bundles/org.eclipse.osgi.tests/bundles_src/ext.extclasspath.a/META-INF/MANIFEST.MF7
-rw-r--r--bundles/org.eclipse.osgi.tests/bundles_src/ext.extclasspath.a/ext/extclasspath/a/ExtClasspathExtTest.java7
-rw-r--r--bundles/org.eclipse.osgi.tests/bundles_src/ext.extclasspath.a/ext/extclasspath/a/extresource.txt1
-rw-r--r--bundles/org.eclipse.osgi.tests/bundles_src/ext.framework.a.importer/META-INF/MANIFEST.MF9
-rw-r--r--bundles/org.eclipse.osgi.tests/bundles_src/ext.framework.a.importer/ext/framework/a/importer/Activator.java30
-rw-r--r--bundles/org.eclipse.osgi.tests/bundles_src/ext.framework.a/META-INF/MANIFEST.MF7
-rw-r--r--bundles/org.eclipse.osgi.tests/bundles_src/ext.framework.a/ext/framework/a/FrameworkExtTest.java7
-rw-r--r--bundles/org.eclipse.osgi.tests/bundles_src/ext.framework.a/ext/framework/a/fwkresource.txt1
-rw-r--r--bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/BundleInstaller.java9
-rw-r--r--bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/BundleTests.java1
-rw-r--r--bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/ExtensionBundleTests.java47
-rw-r--r--bundles/org.eclipse.osgi/core/adaptor/org/eclipse/osgi/framework/adaptor/BundleData.java15
-rw-r--r--bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/AbstractBundle.java26
-rw-r--r--bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/BundleLoader.java2
-rw-r--r--bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/Framework.java6
-rw-r--r--bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/PackageAdminImpl.java2
-rw-r--r--bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/SystemBundleLoader.java103
-rw-r--r--bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/internal/baseadaptor/BaseStorage.java108
-rw-r--r--bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/internal/baseadaptor/BaseStorageHook.java4
24 files changed, 375 insertions, 77 deletions
diff --git a/bundles/org.eclipse.osgi.tests/.classpath b/bundles/org.eclipse.osgi.tests/.classpath
index 57d389db3..4157c67dd 100644
--- a/bundles/org.eclipse.osgi.tests/.classpath
+++ b/bundles/org.eclipse.osgi.tests/.classpath
@@ -40,7 +40,11 @@
<classpathentry kind="src" output="bundle_tests/xfriends.test1" path="bundles_src/xfriends.test1"/>
<classpathentry kind="src" output="bundle_tests/xfriends.test2" path="bundles_src/xfriends.test2"/>
<classpathentry kind="src" output="bundle_tests/xfriends.test3" path="bundles_src/xfriends.test3"/>
+ <classpathentry kind="src" output="bundle_tests/ext.framework.a" path="bundles_src/ext.framework.a"/>
+ <classpathentry kind="src" output="bundle_tests/ext.framework.a.importer" path="bundles_src/ext.framework.a.importer"/>
+ <classpathentry kind="src" output="bundle_tests/ext.extclasspath.a" path="bundles_src/ext.extclasspath.a"/>
+ <classpathentry kind="src" output="bundle_tests/ext.extclasspath.a.importer" path="bundles_src/ext.extclasspath.a.importer"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/bundles/org.eclipse.osgi.tests/META-INF/MANIFEST.MF b/bundles/org.eclipse.osgi.tests/META-INF/MANIFEST.MF
index 0feba26f6..b1ce8c83d 100644
--- a/bundles/org.eclipse.osgi.tests/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.osgi.tests/META-INF/MANIFEST.MF
@@ -14,3 +14,4 @@ Require-Bundle:
Eclipse-LazyStart: true
Bundle-Activator: org.eclipse.osgi.tests.OSGiTestsActivator
Export-Package: org.eclipse.osgi.tests.bundles
+Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff --git a/bundles/org.eclipse.osgi.tests/build.properties b/bundles/org.eclipse.osgi.tests/build.properties
index 3378c02de..84912bea3 100644
--- a/bundles/org.eclipse.osgi.tests/build.properties
+++ b/bundles/org.eclipse.osgi.tests/build.properties
@@ -94,6 +94,14 @@ source.bundle_tests/xfriends.test2.jar = bundles_src/xfriends.test2/
manifest.bundle_tests/xfriends.test2.jar = META-INF/MANIFEST.MF
source.bundle_tests/xfriends.test3.jar = bundles_src/xfriends.test3/
manifest.bundle_tests/xfriends.test3.jar = META-INF/MANIFEST.MF
+source.bundle_tests/ext.framework.a.jar = bundles_src/ext.framework.a/
+manifest.bundle_tests/ext.framework.a.jar = META-INF/MANIFEST.MF
+source.bundle_tests/ext.framework.a.importer.jar = bundles_src/ext.framework.a.importer/
+manifest.bundle_tests/ext.framework.a.importer.jar = META-INF/MANIFEST.MF
+source.bundle_tests/ext.extclasspath.a.jar = bundles_src/ext.extclasspath.a/
+manifest.bundle_tests/ext.extclasspath.a.jar = META-INF/MANIFEST.MF
+source.bundle_tests/ext.extclasspath.a.importer.jar = bundles_src/ext.extclasspath.a.importer/
+manifest.bundle_tests/ext.extclasspath.a.importer.jar = META-INF/MANIFEST.MF
jars.compile.order = osgitests.jar,\
bundle_tests/test.jar,\
@@ -134,4 +142,8 @@ jars.compile.order = osgitests.jar,\
bundle_tests/client2.multiple.exports.jar,\
bundle_tests/xfriends.test1.jar,\
bundle_tests/xfriends.test2.jar,\
- bundle_tests/xfriends.test3.jar
+ bundle_tests/xfriends.test3.jar,\
+ bundle_tests/ext.framework.a.jar,\
+ bundle_tests/ext.framework.a.importer.jar,\
+ bundle_tests/ext.extclasspath.a.jar,\
+ bundle_tests/ext.extclasspath.a.importer.jar \ No newline at end of file
diff --git a/bundles/org.eclipse.osgi.tests/bundles_src/ext.extclasspath.a.importer/META-INF/MANIFEST.MF b/bundles/org.eclipse.osgi.tests/bundles_src/ext.extclasspath.a.importer/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..10f2e2e6f
--- /dev/null
+++ b/bundles/org.eclipse.osgi.tests/bundles_src/ext.extclasspath.a.importer/META-INF/MANIFEST.MF
@@ -0,0 +1,9 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: ext.extclasspath.a.importer
+Bundle-SymbolicName: ext.extclasspath.a.importer
+Bundle-Version: 1.0.0
+Import-Package: org.osgi.framework,
+ org.eclipse.osgi.tests.bundles,
+ ext.extclasspath.a
+Bundle-Activator: ext.extclasspath.a.importer.Activator
diff --git a/bundles/org.eclipse.osgi.tests/bundles_src/ext.extclasspath.a.importer/ext/extclasspath/a/importer/Activator.java b/bundles/org.eclipse.osgi.tests/bundles_src/ext.extclasspath.a.importer/ext/extclasspath/a/importer/Activator.java
new file mode 100644
index 000000000..3198a351a
--- /dev/null
+++ b/bundles/org.eclipse.osgi.tests/bundles_src/ext.extclasspath.a.importer/ext/extclasspath/a/importer/Activator.java
@@ -0,0 +1,30 @@
+package ext.extclasspath.a.importer;
+
+import ext.extclasspath.a.ExtClasspathExtTest;
+import java.io.*;
+import java.net.URL;
+import org.eclipse.osgi.tests.bundles.AbstractBundleTests;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class Activator implements BundleActivator {
+
+ public void start(BundleContext context) throws Exception {
+ AbstractBundleTests.simpleResults.addEvent(new ExtClasspathExtTest().toString());
+ AbstractBundleTests.simpleResults.addEvent(getURLContent(this.getClass().getResource("/ext/extclasspath/a/extresource.txt"))); //$NON-NLS-1$
+ }
+
+ private String getURLContent(URL resource) throws IOException {
+ BufferedReader br = new BufferedReader(new InputStreamReader(resource.openStream()));
+ try {
+ return br.readLine();
+ } finally {
+ br.close();
+ }
+ }
+
+ public void stop(BundleContext context) throws Exception {
+ // nothing
+ }
+
+}
diff --git a/bundles/org.eclipse.osgi.tests/bundles_src/ext.extclasspath.a/META-INF/MANIFEST.MF b/bundles/org.eclipse.osgi.tests/bundles_src/ext.extclasspath.a/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..f230f0c42
--- /dev/null
+++ b/bundles/org.eclipse.osgi.tests/bundles_src/ext.extclasspath.a/META-INF/MANIFEST.MF
@@ -0,0 +1,7 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: ext.extclasspath.a
+Bundle-SymbolicName: ext.extclasspath.a
+Bundle-Version: 1.0.0
+Fragment-Host: system.bundle; extension:=extclasspath
+Export-Package: ext.extclasspath.a
diff --git a/bundles/org.eclipse.osgi.tests/bundles_src/ext.extclasspath.a/ext/extclasspath/a/ExtClasspathExtTest.java b/bundles/org.eclipse.osgi.tests/bundles_src/ext.extclasspath.a/ext/extclasspath/a/ExtClasspathExtTest.java
new file mode 100644
index 000000000..9d3168fa9
--- /dev/null
+++ b/bundles/org.eclipse.osgi.tests/bundles_src/ext.extclasspath.a/ext/extclasspath/a/ExtClasspathExtTest.java
@@ -0,0 +1,7 @@
+package ext.extclasspath.a;
+
+public class ExtClasspathExtTest {
+ public String toString() {
+ return "success";
+ }
+}
diff --git a/bundles/org.eclipse.osgi.tests/bundles_src/ext.extclasspath.a/ext/extclasspath/a/extresource.txt b/bundles/org.eclipse.osgi.tests/bundles_src/ext.extclasspath.a/ext/extclasspath/a/extresource.txt
new file mode 100644
index 000000000..2e9ba477f
--- /dev/null
+++ b/bundles/org.eclipse.osgi.tests/bundles_src/ext.extclasspath.a/ext/extclasspath/a/extresource.txt
@@ -0,0 +1 @@
+success
diff --git a/bundles/org.eclipse.osgi.tests/bundles_src/ext.framework.a.importer/META-INF/MANIFEST.MF b/bundles/org.eclipse.osgi.tests/bundles_src/ext.framework.a.importer/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..e0f78c72f
--- /dev/null
+++ b/bundles/org.eclipse.osgi.tests/bundles_src/ext.framework.a.importer/META-INF/MANIFEST.MF
@@ -0,0 +1,9 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: ext.framework.a.importer
+Bundle-SymbolicName: ext.framework.a.importer
+Bundle-Version: 1.0.0
+Import-Package: org.osgi.framework,
+ ext.framework.a,
+ org.eclipse.osgi.tests.bundles
+Bundle-Activator: ext.framework.a.importer.Activator
diff --git a/bundles/org.eclipse.osgi.tests/bundles_src/ext.framework.a.importer/ext/framework/a/importer/Activator.java b/bundles/org.eclipse.osgi.tests/bundles_src/ext.framework.a.importer/ext/framework/a/importer/Activator.java
new file mode 100644
index 000000000..1c1120040
--- /dev/null
+++ b/bundles/org.eclipse.osgi.tests/bundles_src/ext.framework.a.importer/ext/framework/a/importer/Activator.java
@@ -0,0 +1,30 @@
+package ext.framework.a.importer;
+
+import ext.framework.a.FrameworkExtTest;
+import java.io.*;
+import java.net.URL;
+import org.eclipse.osgi.tests.bundles.AbstractBundleTests;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class Activator implements BundleActivator {
+
+ public void start(BundleContext context) throws Exception {
+ AbstractBundleTests.simpleResults.addEvent(new FrameworkExtTest().testIt("success")); //$NON-NLS-1$
+ AbstractBundleTests.simpleResults.addEvent(getURLContent(this.getClass().getResource("/ext/framework/a/fwkresource.txt"))); //$NON-NLS-1$
+ }
+
+ private String getURLContent(URL resource) throws IOException {
+ BufferedReader br = new BufferedReader(new InputStreamReader(resource.openStream()));
+ try {
+ return br.readLine();
+ } finally {
+ br.close();
+ }
+ }
+
+ public void stop(BundleContext context) throws Exception {
+ // nothing
+ }
+
+}
diff --git a/bundles/org.eclipse.osgi.tests/bundles_src/ext.framework.a/META-INF/MANIFEST.MF b/bundles/org.eclipse.osgi.tests/bundles_src/ext.framework.a/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..346e72566
--- /dev/null
+++ b/bundles/org.eclipse.osgi.tests/bundles_src/ext.framework.a/META-INF/MANIFEST.MF
@@ -0,0 +1,7 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: ext.framework.a
+Bundle-SymbolicName: ext.framework.a
+Bundle-Version: 1.0.0
+Fragment-Host: system.bundle; extension:=framework
+Export-Package: ext.framework.a
diff --git a/bundles/org.eclipse.osgi.tests/bundles_src/ext.framework.a/ext/framework/a/FrameworkExtTest.java b/bundles/org.eclipse.osgi.tests/bundles_src/ext.framework.a/ext/framework/a/FrameworkExtTest.java
new file mode 100644
index 000000000..8c8956016
--- /dev/null
+++ b/bundles/org.eclipse.osgi.tests/bundles_src/ext.framework.a/ext/framework/a/FrameworkExtTest.java
@@ -0,0 +1,7 @@
+package ext.framework.a;
+
+public class FrameworkExtTest {
+ public String testIt(String value) {
+ return value;
+ }
+}
diff --git a/bundles/org.eclipse.osgi.tests/bundles_src/ext.framework.a/ext/framework/a/fwkresource.txt b/bundles/org.eclipse.osgi.tests/bundles_src/ext.framework.a/ext/framework/a/fwkresource.txt
new file mode 100644
index 000000000..2e9ba477f
--- /dev/null
+++ b/bundles/org.eclipse.osgi.tests/bundles_src/ext.framework.a/ext/framework/a/fwkresource.txt
@@ -0,0 +1 @@
+success
diff --git a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/BundleInstaller.java b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/BundleInstaller.java
index ea0d50b17..fd756a8f8 100644
--- a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/BundleInstaller.java
+++ b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/BundleInstaller.java
@@ -43,7 +43,11 @@ public class BundleInstaller {
}
synchronized public Bundle installBundle(String name) throws BundleException {
- if (bundles == null)
+ return installBundle(name, true);
+ }
+
+ synchronized public Bundle installBundle(String name, boolean track) throws BundleException {
+ if (bundles == null && track)
return null;
String bundleFileName = rootLocation + "/" + name;
URL bundleURL = context.getBundle().getEntry(bundleFileName);
@@ -58,7 +62,8 @@ public class BundleInstaller {
if ("file".equals(bundleURL.getProtocol()))
location = "reference:" + location;
Bundle bundle = context.installBundle(location);
- bundles.put(name, bundle);
+ if (track)
+ bundles.put(name, bundle);
return bundle;
}
diff --git a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/BundleTests.java b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/BundleTests.java
index 691812b12..0565d84f3 100644
--- a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/BundleTests.java
+++ b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/BundleTests.java
@@ -16,6 +16,7 @@ import junit.framework.TestSuite;
public class BundleTests {
public static Test suite() {
TestSuite suite = new TestSuite(BundleTests.class.getName());
+ suite.addTest(ExtensionBundleTests.suite());
suite.addTest(ClassLoadingBundleTests.suite());
suite.addTest(NativeCodeBundleTests.suite());
return suite;
diff --git a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/ExtensionBundleTests.java b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/ExtensionBundleTests.java
new file mode 100644
index 000000000..35f55e758
--- /dev/null
+++ b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/ExtensionBundleTests.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osgi.tests.bundles;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import org.osgi.framework.Bundle;
+
+public class ExtensionBundleTests extends AbstractBundleTests {
+ public static Test suite() {
+ return new TestSuite(ExtensionBundleTests.class);
+ }
+
+ public void testFrameworkExtension01() throws Exception {
+ Bundle fwkext = installer.installBundle("ext.framework.a", false); //$NON-NLS-1$
+ Bundle importer = installer.installBundle("ext.framework.a.importer"); //$NON-NLS-1$
+ installer.resolveBundles(new Bundle[] {fwkext, importer});
+
+ importer.start();
+ importer.stop();
+ Object[] results = simpleResults.getResults(2);
+ assertTrue("1.0", results.length == 2); //$NON-NLS-1$
+ assertEquals("1.1", "success", results[0]); //$NON-NLS-1$ //$NON-NLS-2$
+ assertEquals("1.2", "success", results[1]); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ public void testExtClasspathExtension01() throws Exception {
+ Bundle fwkext = installer.installBundle("ext.extclasspath.a", false); //$NON-NLS-1$
+ Bundle importer = installer.installBundle("ext.extclasspath.a.importer"); //$NON-NLS-1$
+ installer.resolveBundles(new Bundle[] {fwkext, importer});
+
+ importer.start();
+ importer.stop();
+ Object[] results = simpleResults.getResults(2);
+ assertTrue("1.0", results.length == 2); //$NON-NLS-1$
+ assertEquals("1.1", "success", results[0]); //$NON-NLS-1$ //$NON-NLS-2$
+ assertEquals("1.2", "success", results[1]); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+}
diff --git a/bundles/org.eclipse.osgi/core/adaptor/org/eclipse/osgi/framework/adaptor/BundleData.java b/bundles/org.eclipse.osgi/core/adaptor/org/eclipse/osgi/framework/adaptor/BundleData.java
index 6769ca816..675764b16 100644
--- a/bundles/org.eclipse.osgi/core/adaptor/org/eclipse/osgi/framework/adaptor/BundleData.java
+++ b/bundles/org.eclipse.osgi/core/adaptor/org/eclipse/osgi/framework/adaptor/BundleData.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
+ * Copyright (c) 2003, 2007 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -17,8 +17,6 @@ import java.net.URL;
import java.util.Dictionary;
import java.util.Enumeration;
import org.osgi.framework.*;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleException;
/**
* The <code>BundleData</code> represents a single bundle that is persistently
@@ -35,14 +33,15 @@ import org.osgi.framework.BundleException;
public interface BundleData {
/** The BundleData is for a fragment bundle */
- public static final int TYPE_FRAGMENT = 0x00000001;
+ public static final int TYPE_FRAGMENT = 0x00000001;
/** The BundleData is for a framework extension bundle */
- public static final int TYPE_FRAMEWORK_EXTENSION = 0x00000002;
+ public static final int TYPE_FRAMEWORK_EXTENSION = 0x00000002;
/** The BundleData is for a bootclasspath extension bundle */
- public static final int TYPE_BOOTCLASSPATH_EXTENSION = 0x00000004;
+ public static final int TYPE_BOOTCLASSPATH_EXTENSION = 0x00000004;
/** The BundleData is for a singleton bundle */
- public static final int TYPE_SINGLETON = 0x00000008;
-
+ public static final int TYPE_SINGLETON = 0x00000008;
+ /** The BundleData is for an extension classpath bundle */
+ public static final int TYPE_EXTCLASSPATH_EXTENSION = 0x00000010;
/**
* Creates the ClassLoader for the BundleData. The ClassLoader created
diff --git a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/AbstractBundle.java b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/AbstractBundle.java
index 46422fa92..59470f4ca 100644
--- a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/AbstractBundle.java
+++ b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/AbstractBundle.java
@@ -598,7 +598,7 @@ public abstract class AbstractBundle implements Bundle, Comparable, KeyedElement
Debug.println("update location " + bundledata.getLocation()); //$NON-NLS-1$
}
framework.checkAdminPermission(this, AdminPermission.LIFECYCLE);
- if ((bundledata.getType() & (BundleData.TYPE_BOOTCLASSPATH_EXTENSION | BundleData.TYPE_FRAMEWORK_EXTENSION)) != 0)
+ if ((bundledata.getType() & (BundleData.TYPE_BOOTCLASSPATH_EXTENSION | BundleData.TYPE_FRAMEWORK_EXTENSION | BundleData.TYPE_EXTCLASSPATH_EXTENSION)) != 0)
// need special permission to update extensions
framework.checkAdminPermission(this, AdminPermission.EXTENSIONLIFECYCLE);
checkValid();
@@ -646,7 +646,7 @@ public abstract class AbstractBundle implements Bundle, Comparable, KeyedElement
Debug.println(" from: " + in); //$NON-NLS-1$
}
framework.checkAdminPermission(this, AdminPermission.LIFECYCLE);
- if ((bundledata.getType() & (BundleData.TYPE_BOOTCLASSPATH_EXTENSION | BundleData.TYPE_FRAMEWORK_EXTENSION)) != 0)
+ if ((bundledata.getType() & (BundleData.TYPE_BOOTCLASSPATH_EXTENSION | BundleData.TYPE_FRAMEWORK_EXTENSION | BundleData.TYPE_EXTCLASSPATH_EXTENSION)) != 0)
// need special permission to update extensions
framework.checkAdminPermission(this, AdminPermission.EXTENSIONLIFECYCLE);
checkValid();
@@ -724,7 +724,7 @@ public abstract class AbstractBundle implements Bundle, Comparable, KeyedElement
// indicate we have loaded from the new version of the bundle
reloaded = true;
if (System.getSecurityManager() != null) {
- final boolean extension = (bundledata.getType() & (BundleData.TYPE_BOOTCLASSPATH_EXTENSION | BundleData.TYPE_FRAMEWORK_EXTENSION)) != 0;
+ final boolean extension = (bundledata.getType() & (BundleData.TYPE_BOOTCLASSPATH_EXTENSION | BundleData.TYPE_FRAMEWORK_EXTENSION | BundleData.TYPE_EXTCLASSPATH_EXTENSION)) != 0;
// must check for AllPermission before allow a bundle extension to be updated
if (extension && !hasPermission(new AllPermission()))
throw new BundleException(Msg.BUNDLE_EXTENSION_PERMISSION, new SecurityException(Msg.BUNDLE_EXTENSION_PERMISSION));
@@ -749,9 +749,9 @@ public abstract class AbstractBundle implements Bundle, Comparable, KeyedElement
try {
storage.undo();
if (reloaded) /*
- * if we loaded from the new version of the
- * bundle
- */{
+ * if we loaded from the new version of the
+ * bundle
+ */{
synchronized (bundles) {
reload(oldBundle); /* revert to old version */
}
@@ -821,7 +821,7 @@ public abstract class AbstractBundle implements Bundle, Comparable, KeyedElement
Debug.println("uninstall location: " + bundledata.getLocation()); //$NON-NLS-1$
}
framework.checkAdminPermission(this, AdminPermission.LIFECYCLE);
- if ((bundledata.getType() & (BundleData.TYPE_BOOTCLASSPATH_EXTENSION | BundleData.TYPE_FRAMEWORK_EXTENSION)) != 0)
+ if ((bundledata.getType() & (BundleData.TYPE_BOOTCLASSPATH_EXTENSION | BundleData.TYPE_FRAMEWORK_EXTENSION | BundleData.TYPE_EXTCLASSPATH_EXTENSION)) != 0)
// need special permission to uninstall extensions
framework.checkAdminPermission(this, AdminPermission.EXTENSIONLIFECYCLE);
checkValid();
@@ -1144,9 +1144,9 @@ public abstract class AbstractBundle implements Bundle, Comparable, KeyedElement
start = System.currentTimeMillis();
}
statechangeLock.wait(5000); /*
- * wait for other thread to
- * finish changing state
- */
+ * wait for other thread to
+ * finish changing state
+ */
if (Debug.DEBUG && Debug.DEBUG_GENERAL) {
long end = System.currentTimeMillis();
if (end - start > 0)
@@ -1169,9 +1169,9 @@ public abstract class AbstractBundle implements Bundle, Comparable, KeyedElement
if (stateChanging != null) {
stateChanging = null;
statechangeLock.notify(); /*
- * notify one waiting thread that the
- * state change is complete
- */
+ * notify one waiting thread that the
+ * state change is complete
+ */
}
}
}
diff --git a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/BundleLoader.java b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/BundleLoader.java
index f78648352..4e78995ac 100644
--- a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/BundleLoader.java
+++ b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/BundleLoader.java
@@ -888,7 +888,7 @@ public class BundleLoader implements ClassLoaderDelegate {
addDynamicImportPackage((String[]) dynamicImports.toArray(new String[dynamicImports.size()]));
}
- final synchronized void attachFragment(BundleFragment fragment) throws BundleException {
+ synchronized void attachFragment(BundleFragment fragment) throws BundleException {
if (classloader == null)
return;
String[] classpath = fragment.getBundleData().getClassPath();
diff --git a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/Framework.java b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/Framework.java
index 2b5d3a2b8..39ffa84f6 100644
--- a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/Framework.java
+++ b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/Framework.java
@@ -912,7 +912,7 @@ public class Framework implements EventDispatcher, EventPublisher {
try {
bundle.load();
if (System.getSecurityManager() != null) {
- final boolean extension = (bundledata.getType() & (BundleData.TYPE_BOOTCLASSPATH_EXTENSION | BundleData.TYPE_FRAMEWORK_EXTENSION)) != 0;
+ final boolean extension = (bundledata.getType() & (BundleData.TYPE_BOOTCLASSPATH_EXTENSION | BundleData.TYPE_FRAMEWORK_EXTENSION | BundleData.TYPE_EXTCLASSPATH_EXTENSION)) != 0;
// must check for AllPermission before allow a bundle extension to be installed
if (extension && !bundle.hasPermission(new AllPermission()))
throw new BundleException(Msg.BUNDLE_EXTENSION_PERMISSION, new SecurityException(Msg.BUNDLE_EXTENSION_PERMISSION));
@@ -958,7 +958,7 @@ public class Framework implements EventDispatcher, EventPublisher {
throw new BundleException(t.getMessage(), t);
}
return bundle;
- }
+ }
/**
* Retrieve the bundle that has the given unique identifier.
@@ -1578,7 +1578,7 @@ public class Framework implements EventDispatcher, EventPublisher {
}
BundleContextImpl context = (BundleContextImpl) l;
publishFrameworkEvent(FrameworkEvent.ERROR, context.bundle, t);
- }
+ }
}
}
diff --git a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/PackageAdminImpl.java b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/PackageAdminImpl.java
index a38376b65..f9fc67d41 100644
--- a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/PackageAdminImpl.java
+++ b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/PackageAdminImpl.java
@@ -394,6 +394,8 @@ public class PackageAdminImpl implements PackageAdmin {
restart = true;
else if ((refresh[i].bundledata.getType() & BundleData.TYPE_BOOTCLASSPATH_EXTENSION) != 0)
restart = true;
+ else if ((refresh[i].bundledata.getType() & BundleData.TYPE_EXTCLASSPATH_EXTENSION) != 0 && previouslyResolved[i])
+ restart = true;
}
if (restart) {
FrameworkProperties.setProperty("osgi.forcedRestart", "true"); //$NON-NLS-1$ //$NON-NLS-2$
diff --git a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/SystemBundleLoader.java b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/SystemBundleLoader.java
index 986dc388f..d2ab69df6 100644
--- a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/SystemBundleLoader.java
+++ b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/SystemBundleLoader.java
@@ -13,8 +13,11 @@ package org.eclipse.osgi.framework.internal.core;
import java.io.IOException;
import java.net.URL;
-import java.util.*;
+import java.util.Enumeration;
+import java.util.HashSet;
+import org.eclipse.osgi.framework.adaptor.BundleData;
import org.eclipse.osgi.service.resolver.ExportPackageDescription;
+import org.osgi.framework.Bundle;
import org.osgi.framework.BundleException;
/**
@@ -23,8 +26,10 @@ import org.osgi.framework.BundleException;
*/
public class SystemBundleLoader extends BundleLoader {
public static final String EQUINOX_EE = "x-equinox-ee"; //$NON-NLS-1$
- ClassLoader classLoader;
- private HashSet eePackages;
+ private final ClassLoader classLoader;
+ private final HashSet eePackages;
+ private final HashSet extPackages;
+ private final ClassLoader extClassLoader;
/**
* @param bundle The system bundle.
@@ -34,24 +39,68 @@ public class SystemBundleLoader extends BundleLoader {
protected SystemBundleLoader(BundleHost bundle, BundleLoaderProxy proxy) throws BundleException {
super(bundle, proxy);
ExportPackageDescription[] exports = proxy.getBundleDescription().getSelectedExports();
- if (exports != null && exports.length > 0) {
+ if (exports == null || exports.length == 0)
+ eePackages = null;
+ else {
eePackages = new HashSet(exports.length);
for (int i = 0; i < exports.length; i++)
if (((Integer) exports[i].getDirective(EQUINOX_EE)).intValue() >= 0)
eePackages.add(exports[i].getName());
}
this.classLoader = getClass().getClassLoader();
+ extPackages = new HashSet(0); // not common; start with 0
+ Bundle[] fragments = bundle.getFragments();
+ if (fragments != null)
+ for (int i = 0; i < fragments.length; i++)
+ addExtPackages((BundleFragment) fragments[i]);
+ ClassLoader extCL = ClassLoader.getSystemClassLoader();
+ if (extCL == null)
+ extClassLoader = null;
+ else {
+ while (extCL.getParent() != null)
+ extCL = extCL.getParent();
+ // make sure extCL is not already on the parent chain of the system classloader
+ boolean found = false;
+ ClassLoader systemExtCL = this.classLoader;
+ while (systemExtCL.getParent() != null && !found) {
+ if (systemExtCL.getParent() == extCL)
+ found = true;
+ else
+ systemExtCL = systemExtCL.getParent();
+ }
+ extClassLoader = found ? null : extCL;
+ }
+ }
+
+ private void addExtPackages(BundleFragment fragment) {
+ if ((fragment.getBundleData().getType() & BundleData.TYPE_EXTCLASSPATH_EXTENSION) == 0)
+ return;
+ ExportPackageDescription[] extExports = fragment.getBundleDescription().getExportPackages();
+ for (int j = 0; j < extExports.length; j++)
+ extPackages.add(extExports[j].getName());
+ }
+
+ synchronized void attachFragment(BundleFragment fragment) throws BundleException {
+ super.attachFragment(fragment);
+ synchronized (extPackages) {
+ addExtPackages(fragment);
+ }
}
/**
* The ClassLoader that loads OSGi framework classes is used to find the class.
+ * This method never gets called because there is no BundleClassLoader for the framework.
*/
public Class findClass(String name) throws ClassNotFoundException {
- return classLoader.loadClass(name);
+ Class result = findLocalClass(name);
+ if (result == null)
+ throw new ClassNotFoundException(name);
+ return result;
}
/**
* This method will always return null.
+ * This method never gets called because there is no BundleClassLoader for the framework.
*/
public String findLibrary(String name) {
return null;
@@ -61,45 +110,71 @@ public class SystemBundleLoader extends BundleLoader {
* The ClassLoader that loads OSGi framework classes is used to find the class.
*/
Class findLocalClass(String name) {
- Class clazz = null;
try {
- clazz = classLoader.loadClass(name);
+ return classLoader.loadClass(name);
} catch (ClassNotFoundException e) {
- // Do nothing, will return null
+ if (extClassLoader != null)
+ synchronized (extPackages) {
+ if (extPackages.size() > 0 && extPackages.contains(BundleLoader.getPackageName(name)))
+ try {
+ return extClassLoader.loadClass(name);
+ } catch (ClassNotFoundException e2) {
+ return null;
+ }
+ }
}
- return clazz;
+ return null;
}
/**
* The ClassLoader that loads OSGi framework classes is used to find the resource.
*/
URL findLocalResource(String name) {
- return classLoader.getResource(name);
+ URL result = classLoader.getResource(name);
+ if (result == null && extClassLoader != null)
+ synchronized (extPackages) {
+ if (extPackages.size() > 0 && extPackages.contains(BundleLoader.getResourcePackageName(name)))
+ result = extClassLoader.getResource(name);
+ }
+ return result;
}
/**
* The ClassLoader that loads OSGi framework classes is used to find the resource.
*/
Enumeration findLocalResources(String name) {
+ Enumeration result = null;
try {
- return classLoader.getResources(name);
+ result = classLoader.getResources(name);
} catch (IOException e) {
- return null;
+ // do nothing
}
+ if ((result == null || !result.hasMoreElements()) && extClassLoader != null)
+ synchronized (extPackages) {
+ if (extPackages.size() > 0 && extPackages.contains(BundleLoader.getResourcePackageName(name)))
+ try {
+ result = extClassLoader.getResources(name);
+ } catch (IOException e) {
+ // do nothing
+ }
+ }
+ return result;
}
/**
* The ClassLoader that loads OSGi framework classes is used to find the resource.
+ * This method never gets called because there is no BundleClassLoader for the framework.
*/
public URL findResource(String name) {
- return classLoader.getResource(name);
+ return findLocalResource(name);
}
/**
* The ClassLoader that loads OSGi framework classes is used to find the resource.
+ * This method never gets called because there is no BundleClassLoader for the framework.
*/
public Enumeration findResources(String name) throws IOException {
- return classLoader.getResources(name);
+ return findLocalResources(name);
}
/**
diff --git a/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/internal/baseadaptor/BaseStorage.java b/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/internal/baseadaptor/BaseStorage.java
index aaeb48392..408a70fe2 100644
--- a/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/internal/baseadaptor/BaseStorage.java
+++ b/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/internal/baseadaptor/BaseStorage.java
@@ -96,7 +96,9 @@ public class BaseStorage implements SynchronousBundleListener {
/**
* The add URL method used to support framework extensions
*/
- private Method addURLMethod;
+ private final Method addFwkURLMethod;
+ private final Method addExtURLMethod;
+
/**
* The list of configured framework extensions
*/
@@ -117,6 +119,9 @@ public class BaseStorage implements SynchronousBundleListener {
BaseStorage() {
// make constructor package private
+ // initialize the addXYZURLMethods to support framework extensions
+ addFwkURLMethod = findAddURLMethod(getFwkClassLoader(), "addURL"); //$NON-NLS-1$
+ addExtURLMethod = findAddURLMethod(getExtClassLoader(), "addURL"); //$NON-NLS-1$
}
public void initialize(BaseAdaptor adaptor) throws IOException {
@@ -124,10 +129,7 @@ public class BaseStorage implements SynchronousBundleListener {
setDebugOptions();
if (Boolean.valueOf(FrameworkProperties.getProperty(BaseStorage.PROP_CLEAN)).booleanValue())
cleanOSGiCache();
- // initialize the addURLMethod to support framework extensions
- ClassLoader fwloader = BaseStorage.class.getClassLoader();
- if (fwloader != null)
- addURLMethod = findaddURLMethod(fwloader.getClass());
+
// we need to set the install path as soon as possible so we can determine
// the absolute location of install relative URLs
Location installLoc = LocationManager.getInstallLocation();
@@ -145,7 +147,50 @@ public class BaseStorage implements SynchronousBundleListener {
storageHooks.add(hooks[i]);
}
- private void setDebugOptions() {
+ private static Method findAddURLMethod(ClassLoader cl, String name) {
+ if (cl == null)
+ return null;
+ return findMethod(cl.getClass(), name, new Class[] {URL.class});
+ }
+
+ // recursively searches a class and it's superclasses for a (potentially inaccessable) method
+ private static Method findMethod(Class clazz, String name, Class[] args) {
+ if (clazz == null)
+ return null; // ends the recursion when getSuperClass returns null
+ try {
+ Method result = clazz.getDeclaredMethod(name, args);
+ result.setAccessible(true);
+ return result;
+ } catch (NoSuchMethodException e) {
+ // do nothing look in super class below
+ } catch (SecurityException e) {
+ // if we do not have the permissions then we will not find the method
+ }
+ return findMethod(clazz.getSuperclass(), name, args);
+ }
+
+ private static void callAddURLMethod(ClassLoader cl, Method meth, URL arg) throws InvocationTargetException {
+ try {
+ meth.invoke(cl, new Object[] {arg});
+ } catch (Throwable t) {
+ throw new InvocationTargetException(t);
+ }
+ }
+
+ private ClassLoader getFwkClassLoader() {
+ return this.getClass().getClassLoader();
+ }
+
+ private ClassLoader getExtClassLoader() {
+ ClassLoader cl = ClassLoader.getSystemClassLoader();
+ ClassLoader extcl = cl.getParent();
+ while ((extcl != null) && (extcl.getParent() != null)) {
+ extcl = extcl.getParent();
+ }
+ return extcl;
+ }
+
+ private static void setDebugOptions() {
FrameworkDebugOptions options = FrameworkDebugOptions.getDefault();
// may be null if debugging is not enabled
if (options == null)
@@ -783,7 +828,7 @@ public class BaseStorage implements SynchronousBundleListener {
public void addProperties(Properties properties) {
// set the extension support if we found the addURL method
- if (addURLMethod != null)
+ if (addFwkURLMethod != null)
properties.put(Constants.SUPPORTS_FRAMEWORK_EXTENSION, "true"); //$NON-NLS-1$
// store bundleStore back into adaptor properties for others to see
properties.put(BaseStorage.PROP_BUNDLE_STORE, getBundleStoreRoot().getAbsolutePath());
@@ -873,6 +918,9 @@ public class BaseStorage implements SynchronousBundleListener {
} else if ((bundleData.getType() & BundleData.TYPE_BOOTCLASSPATH_EXTENSION) != 0) {
validateExtension(bundleData);
processBootExtension(bundleData, type);
+ } else if ((bundleData.getType() & BundleData.TYPE_EXTCLASSPATH_EXTENSION) != 0) {
+ validateExtension(bundleData);
+ processExtExtension(bundleData, type);
}
}
@@ -898,8 +946,18 @@ public class BaseStorage implements SynchronousBundleListener {
* @throws BundleException on errors or if framework extensions are not supported
*/
protected void processFrameworkExtension(BaseData bundleData, byte type) throws BundleException {
- if (addURLMethod == null)
+ if (addFwkURLMethod == null)
throw new BundleException("Framework extensions are not supported.", new UnsupportedOperationException()); //$NON-NLS-1$
+ addExtensionContent(bundleData, type, getFwkClassLoader(), addFwkURLMethod);
+ }
+
+ protected void processExtExtension(BaseData bundleData, byte type) throws BundleException {
+ if (addExtURLMethod == null)
+ throw new BundleException("Extension classpath extensions are not supported.", new UnsupportedOperationException()); //$NON-NLS-1$
+ addExtensionContent(bundleData, type, getExtClassLoader(), addExtURLMethod);
+ }
+
+ private void addExtensionContent(BaseData bundleData, byte type, ClassLoader addToLoader, Method addToMethod) throws BundleException {
if ((type & (EXTENSION_UNINSTALLED | EXTENSION_UPDATED)) != 0)
// if uninstalled or updated then do nothing framework must be restarted.
return;
@@ -920,24 +978,21 @@ public class BaseStorage implements SynchronousBundleListener {
File[] files = getExtensionFiles(bundleData);
if (files == null)
return;
- ClassLoader cl = getClass().getClassLoader();
+
for (int i = 0; i < files.length; i++) {
if (files[i] == null)
continue;
- Throwable exceptionLog = null;
try {
- addURLMethod.invoke(cl, new Object[] {AdaptorUtil.encodeFileURL(files[i])});
+ callAddURLMethod(addToLoader, addToMethod, AdaptorUtil.encodeFileURL(files[i]));
} catch (InvocationTargetException e) {
- exceptionLog = e.getTargetException();
- } catch (Throwable t) {
- exceptionLog = t;
- } finally {
- if (exceptionLog != null)
- adaptor.getEventPublisher().publishFrameworkEvent(FrameworkEvent.ERROR, bundleData.getBundle(), exceptionLog);
+ adaptor.getEventPublisher().publishFrameworkEvent(FrameworkEvent.ERROR, bundleData.getBundle(), e);
+ } catch (MalformedURLException e) {
+ adaptor.getEventPublisher().publishFrameworkEvent(FrameworkEvent.ERROR, bundleData.getBundle(), e);
}
}
+
try {
- cl.loadClass("thisIsNotAClass"); // initialize the new urls //$NON-NLS-1$
+ addToLoader.loadClass("thisIsNotAClass"); // initialize the new urls //$NON-NLS-1$
} catch (ClassNotFoundException e) {
// do nothing
}
@@ -1127,21 +1182,6 @@ public class BaseStorage implements SynchronousBundleListener {
}
}
- private static Method findaddURLMethod(Class clazz) {
- if (clazz == null)
- return null; // ends the recursion when getSuperClass returns null
- try {
- Method result = clazz.getDeclaredMethod("addURL", new Class[] {URL.class}); //$NON-NLS-1$
- result.setAccessible(true);
- return result;
- } catch (NoSuchMethodException e) {
- // do nothing look in super class below
- } catch (SecurityException e) {
- // if we do not have the permissions then we will not find the method
- }
- return findaddURLMethod(clazz.getSuperclass());
- }
-
private class StateSaver implements Runnable {
private long delay_interval = 30000; // 30 seconds.
private long max_total_delay_interval = 1800000; // 30 minutes.
@@ -1243,6 +1283,8 @@ public class BaseStorage implements SynchronousBundleListener {
processFrameworkExtension(data, EXTENSION_INITIALIZE);
else if ((data.getType() & BundleData.TYPE_BOOTCLASSPATH_EXTENSION) != 0)
processBootExtension(data, EXTENSION_INITIALIZE);
+ else if ((data.getType() & BundleData.TYPE_EXTCLASSPATH_EXTENSION) != 0)
+ processExtExtension(data, EXTENSION_INITIALIZE);
} catch (BundleException e) {
// do nothing;
}
diff --git a/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/internal/baseadaptor/BaseStorageHook.java b/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/internal/baseadaptor/BaseStorageHook.java
index 573a8568f..39403328f 100644
--- a/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/internal/baseadaptor/BaseStorageHook.java
+++ b/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/internal/baseadaptor/BaseStorageHook.java
@@ -105,8 +105,10 @@ public class BaseStorageHook implements StorageHook, AdaptorHook {
String extensionType = hostElement[0].getDirective("extension"); //$NON-NLS-1$
if (extensionType == null || extensionType.equals("framework")) //$NON-NLS-1$
bundleType |= BundleData.TYPE_FRAMEWORK_EXTENSION;
- else
+ else if (extensionType.equals("bootclasspath")) //$NON-NLS-1$
bundleType |= BundleData.TYPE_BOOTCLASSPATH_EXTENSION;
+ else if (extensionType.equals("extclasspath")) //$NON-NLS-1$
+ bundleType |= BundleData.TYPE_EXTCLASSPATH_EXTENSION;
}
}
target.setType(bundleType);

Back to the top