Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2008-09-05 18:56:04 +0000
committerThomas Watson2008-09-05 18:56:04 +0000
commit176301c454104d46df56da5719315be6668bf7ad (patch)
treeb78e4f60944fd83fd2e001a21458c605ab4edef1
parenta7ebfdbdf9801cadbe5bf55b272169dae8f93077 (diff)
downloadrt.equinox.framework-176301c454104d46df56da5719315be6668bf7ad.tar.gz
rt.equinox.framework-176301c454104d46df56da5719315be6668bf7ad.tar.xz
rt.equinox.framework-176301c454104d46df56da5719315be6668bf7ad.zip
Bug 246132 Refactor loader layer
-rw-r--r--bundles/org.eclipse.osgi/console/src/org/eclipse/osgi/framework/internal/core/FrameworkCommandProvider.java6
-rw-r--r--bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/AbstractBundle.java9
-rw-r--r--bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/BundleFragment.java35
-rw-r--r--bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/BundleHost.java26
-rw-r--r--bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/ExportedPackageImpl.java2
-rw-r--r--bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/Framework.java42
-rw-r--r--bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/ManifestLocalization.java2
-rw-r--r--bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/PackageAdminImpl.java13
-rw-r--r--bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/internal/loader/BundleLoader.java (renamed from bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/BundleLoader.java)92
-rw-r--r--bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/internal/loader/BundleLoaderProxy.java (renamed from bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/BundleLoaderProxy.java)20
-rw-r--r--bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/internal/loader/FilteredSourcePackage.java (renamed from bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/FilteredSourcePackage.java)4
-rw-r--r--bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/internal/loader/MultiSourcePackage.java (renamed from bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/MultiSourcePackage.java)4
-rw-r--r--bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/internal/loader/NullPackageSource.java (renamed from bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/NullPackageSource.java)2
-rw-r--r--bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/internal/loader/PackageSource.java (renamed from bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/PackageSource.java)4
-rw-r--r--bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/internal/loader/SingleSourcePackage.java (renamed from bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/SingleSourcePackage.java)4
-rw-r--r--bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/internal/loader/SystemBundleLoader.java (renamed from bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/SystemBundleLoader.java)8
-rw-r--r--bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/internal/loader/buddy/DependentPolicy.java4
-rw-r--r--bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/internal/loader/buddy/GlobalPolicy.java4
-rw-r--r--bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/internal/loader/buddy/ParentPolicy.java33
-rw-r--r--bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/internal/loader/buddy/PolicyHandler.java3
-rw-r--r--bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/internal/loader/buddy/RegisteredPolicy.java5
-rw-r--r--bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/framework/internal/core/BundleResourceHandler.java3
22 files changed, 163 insertions, 162 deletions
diff --git a/bundles/org.eclipse.osgi/console/src/org/eclipse/osgi/framework/internal/core/FrameworkCommandProvider.java b/bundles/org.eclipse.osgi/console/src/org/eclipse/osgi/framework/internal/core/FrameworkCommandProvider.java
index b9e277d71..9d4faa2a6 100644
--- a/bundles/org.eclipse.osgi/console/src/org/eclipse/osgi/framework/internal/core/FrameworkCommandProvider.java
+++ b/bundles/org.eclipse.osgi/console/src/org/eclipse/osgi/framework/internal/core/FrameworkCommandProvider.java
@@ -1383,12 +1383,12 @@ public class FrameworkCommandProvider implements CommandProvider, SynchronousBun
label = label + "_" + b.getVersion(); //$NON-NLS-1$
intp.println(b.getBundleId() + "\t" + getStateName(b) + label); //$NON-NLS-1$
if (b.isFragment()) {
- BundleLoaderProxy[] hosts = b.getHosts();
+ Bundle[] hosts = b.getHosts();
if (hosts != null)
for (int j = 0; j < hosts.length; j++)
- intp.println("\t Master=" + hosts[j].getBundleHost().getBundleId()); //$NON-NLS-1$
+ intp.println("\t Master=" + hosts[j].getBundleId()); //$NON-NLS-1$
} else {
- org.osgi.framework.Bundle fragments[] = b.getFragments();
+ Bundle[] fragments = b.getFragments();
if (fragments != null) {
intp.print("\t Fragments="); //$NON-NLS-1$
for (int f = 0; f < fragments.length; f++) {
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 9eadfb6cd..debc84769 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
@@ -19,6 +19,7 @@ import java.util.*;
import org.eclipse.osgi.framework.adaptor.*;
import org.eclipse.osgi.framework.debug.Debug;
import org.eclipse.osgi.framework.util.KeyedElement;
+import org.eclipse.osgi.internal.loader.BundleLoader;
import org.eclipse.osgi.internal.permadmin.EquinoxProtectionDomain;
import org.eclipse.osgi.internal.permadmin.EquinoxSecurityManager;
import org.eclipse.osgi.service.resolver.BundleDescription;
@@ -175,6 +176,10 @@ public abstract class AbstractBundle implements Bundle, Comparable, KeyedElement
return (state);
}
+ public Framework getFramework() {
+ return framework;
+ }
+
/**
* Return true if the bundle is starting or active.
*
@@ -187,7 +192,7 @@ public abstract class AbstractBundle implements Bundle, Comparable, KeyedElement
* Return true if the bundle is resolved.
*
*/
- protected boolean isResolved() {
+ public boolean isResolved() {
return (state & (INSTALLED | UNINSTALLED)) == 0;
}
@@ -1249,7 +1254,7 @@ public abstract class AbstractBundle implements Bundle, Comparable, KeyedElement
return false;
}
- protected BundleLoaderProxy[] getHosts() {
+ BundleHost[] getHosts() {
checkValid();
return null;
}
diff --git a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/BundleFragment.java b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/BundleFragment.java
index 0c5bfc4e7..29031d485 100644
--- a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/BundleFragment.java
+++ b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/BundleFragment.java
@@ -16,13 +16,14 @@ import java.net.URL;
import java.util.Enumeration;
import org.eclipse.osgi.framework.adaptor.BundleData;
import org.eclipse.osgi.framework.debug.Debug;
+import org.eclipse.osgi.internal.loader.BundleLoader;
import org.eclipse.osgi.util.NLS;
import org.osgi.framework.*;
public class BundleFragment extends AbstractBundle {
/** The resolved host that this fragment is attached to */
- protected BundleLoaderProxy[] hosts;
+ protected BundleHost[] hosts;
/**
* @param bundledata
@@ -278,7 +279,7 @@ public class BundleFragment extends AbstractBundle {
return null;
}
- protected BundleLoaderProxy[] getHosts() {
+ synchronized BundleHost[] getHosts() {
return hosts;
}
@@ -290,27 +291,29 @@ public class BundleFragment extends AbstractBundle {
* Adds a host bundle for this fragment.
* @param host the BundleHost to add to the set of host bundles
*/
- protected boolean addHost(BundleLoaderProxy host) {
+ boolean addHost(BundleHost host) {
if (host == null)
return false;
try {
- ((BundleHost) host.getBundleHost()).attachFragment(this);
+ host.attachFragment(this);
} catch (BundleException be) {
- framework.publishFrameworkEvent(FrameworkEvent.ERROR, host.getBundleHost(), be);
+ framework.publishFrameworkEvent(FrameworkEvent.ERROR, host, be);
return false;
}
- if (hosts == null) {
- hosts = new BundleLoaderProxy[] {host};
- return true;
- }
- for (int i = 0; i < hosts.length; i++) {
- if (host.getBundleHost() == hosts[i].getBundleHost())
- return true; // already a host
+ synchronized (this) {
+ if (hosts == null) {
+ hosts = new BundleHost[] {host};
+ return true;
+ }
+ for (int i = 0; i < hosts.length; i++) {
+ if (host == hosts[i])
+ return true; // already a host
+ }
+ BundleHost[] newHosts = new BundleHost[hosts.length + 1];
+ System.arraycopy(hosts, 0, newHosts, 0, hosts.length);
+ newHosts[newHosts.length - 1] = host;
+ hosts = newHosts;
}
- BundleLoaderProxy[] newHosts = new BundleLoaderProxy[hosts.length + 1];
- System.arraycopy(hosts, 0, newHosts, 0, hosts.length);
- newHosts[newHosts.length - 1] = host;
- hosts = newHosts;
return true;
}
diff --git a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/BundleHost.java b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/BundleHost.java
index 249504ed0..b83723e7c 100644
--- a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/BundleHost.java
+++ b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/BundleHost.java
@@ -17,6 +17,8 @@ import java.util.Enumeration;
import org.eclipse.osgi.framework.adaptor.*;
import org.eclipse.osgi.framework.debug.Debug;
import org.eclipse.osgi.framework.log.FrameworkLogEntry;
+import org.eclipse.osgi.internal.loader.BundleLoader;
+import org.eclipse.osgi.internal.loader.BundleLoaderProxy;
import org.eclipse.osgi.service.resolver.BundleDescription;
import org.eclipse.osgi.util.NLS;
import org.osgi.framework.*;
@@ -89,7 +91,7 @@ public class BundleHost extends AbstractBundle {
// make sure the BundleLoader is created.
curProxy.getBundleLoader().createClassLoader();
else
- closeBundleLoader(proxy);
+ BundleLoader.closeBundleLoader(proxy);
state = INSTALLED;
proxy = null;
fragments = null;
@@ -123,7 +125,7 @@ public class BundleHost extends AbstractBundle {
}
}
if (state == RESOLVED) {
- closeBundleLoader(proxy);
+ BundleLoader.closeBundleLoader(proxy);
proxy = null;
fragments = null;
state = INSTALLED;
@@ -157,7 +159,7 @@ public class BundleHost extends AbstractBundle {
// make sure the BundleLoader is created.
curProxy.getBundleLoader().createClassLoader();
else
- closeBundleLoader(proxy);
+ BundleLoader.closeBundleLoader(proxy);
state = INSTALLED;
proxy = null;
@@ -529,7 +531,7 @@ public class BundleHost extends AbstractBundle {
return context.getFramework().getServiceRegistry().getServicesInUse(context);
}
- protected Bundle[] getFragments() {
+ public Bundle[] getFragments() {
synchronized (framework.bundles) {
if (fragments == null)
return null;
@@ -589,7 +591,7 @@ public class BundleHost extends AbstractBundle {
return curProxy == null ? null : curProxy.getBundleLoader();
}
- protected synchronized BundleLoaderProxy getLoaderProxy() {
+ public synchronized BundleLoaderProxy getLoaderProxy() {
if (proxy != null)
return proxy;
BundleDescription bundleDescription = getBundleDescription();
@@ -599,18 +601,4 @@ public class BundleHost extends AbstractBundle {
bundleDescription.setUserObject(proxy);
return proxy;
}
-
- static void closeBundleLoader(BundleLoaderProxy proxy) {
- if (proxy == null)
- return;
- // First close the BundleLoader
- BundleLoader loader = proxy.getBasicBundleLoader();
- if (loader != null)
- loader.close();
- proxy.setStale();
- // if proxy is not null then make sure to unset user object
- // associated with the proxy in the state
- BundleDescription description = proxy.getBundleDescription();
- description.setUserObject(null);
- }
}
diff --git a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/ExportedPackageImpl.java b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/ExportedPackageImpl.java
index 3e0798175..9554ad548 100644
--- a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/ExportedPackageImpl.java
+++ b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/ExportedPackageImpl.java
@@ -10,6 +10,8 @@
*******************************************************************************/
package org.eclipse.osgi.framework.internal.core;
+import org.eclipse.osgi.internal.loader.*;
+
import java.util.ArrayList;
import org.eclipse.osgi.service.resolver.BundleDescription;
import org.eclipse.osgi.service.resolver.ExportPackageDescription;
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 8627753ff..8ad79f415 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
@@ -25,6 +25,7 @@ import org.eclipse.osgi.framework.internal.protocol.StreamHandlerFactory;
import org.eclipse.osgi.framework.log.FrameworkLog;
import org.eclipse.osgi.framework.log.FrameworkLogEntry;
import org.eclipse.osgi.framework.util.SecureAction;
+import org.eclipse.osgi.internal.loader.*;
import org.eclipse.osgi.internal.permadmin.EquinoxSecurityManager;
import org.eclipse.osgi.internal.permadmin.SecurityAdmin;
import org.eclipse.osgi.internal.profile.Profile;
@@ -99,11 +100,11 @@ public class Framework implements EventDispatcher, EventPublisher, Runnable {
protected Hashtable installLock;
/** System Bundle object */
protected SystemBundle systemBundle;
- String[] bootDelegation;
- String[] bootDelegationStems;
- boolean bootDelegateAll = false;
- boolean contextBootDelegation = "true".equals(FrameworkProperties.getProperty("osgi.context.bootdelegation", "true")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- boolean compatibiltyBootDelegation = false;
+ private String[] bootDelegation;
+ private String[] bootDelegationStems;
+ private boolean bootDelegateAll = false;
+ public final boolean contextBootDelegation = "true".equals(FrameworkProperties.getProperty("osgi.context.bootdelegation", "true")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ public final boolean compatibiltyBootDelegation = "true".equals(FrameworkProperties.getProperty(Constants.OSGI_COMPATIBILITY_BOOTDELEGATION)); //$NON-NLS-1$
ClassLoaderDelegateHook[] delegateHooks;
private volatile boolean forcedRestart = false;
/**
@@ -252,6 +253,10 @@ public class Framework implements EventDispatcher, EventPublisher, Runnable {
return adaptor;
}
+ public ClassLoaderDelegateHook[] getDelegateHooks() {
+ return delegateHooks;
+ }
+
public ServiceRegistry getServiceRegistry() {
return serviceRegistry;
}
@@ -381,8 +386,6 @@ public class Framework implements EventDispatcher, EventPublisher, Runnable {
}
private void setBootDelegation() {
- // set the compatibility boot delegation flag
- compatibiltyBootDelegation = "true".equals(FrameworkProperties.getProperty(Constants.OSGI_COMPATIBILITY_BOOTDELEGATION)); //$NON-NLS-1$
// set the boot delegation according to the osgi boot delegation property
String bootDelegationProp = properties.getProperty(Constants.OSGI_BOOTDELEGATION);
if (bootDelegationProp == null)
@@ -1005,6 +1008,16 @@ public class Framework implements EventDispatcher, EventPublisher, Runnable {
}
}
+ public BundleContextImpl getSystemBundleContext() {
+ if (systemBundle == null)
+ return null;
+ return systemBundle.context;
+ }
+
+ public PackageAdminImpl getPackageAdmin() {
+ return packageAdmin;
+ }
+
/**
* Retrieve the bundle that has the given symbolic name and version.
*
@@ -1762,7 +1775,7 @@ public class Framework implements EventDispatcher, EventPublisher, Runnable {
if (consumerSource == null)
return true;
// work around the issue when the package is in the EE and we delegate to boot for that package
- if (producerBL.isBootDelegationPackage(pkgName)) {
+ if (isBootDelegationPackage(pkgName)) {
SystemBundleLoader systemLoader = (SystemBundleLoader) systemBundle.getBundleLoader();
if (systemLoader.isEEPackage(pkgName))
return true; // in this case we have a common source from the EE
@@ -1803,4 +1816,17 @@ public class Framework implements EventDispatcher, EventPublisher, Runnable {
return getPackageSource(serviceClass.getSuperclass(), pkgName);
}
+ public boolean isBootDelegationPackage(String name) {
+ if (bootDelegateAll)
+ return true;
+ if (bootDelegation != null)
+ for (int i = 0; i < bootDelegation.length; i++)
+ if (name.equals(bootDelegation[i]))
+ return true;
+ if (bootDelegationStems != null)
+ for (int i = 0; i < bootDelegationStems.length; i++)
+ if (name.startsWith(bootDelegationStems[i]))
+ return true;
+ return false;
+ }
}
diff --git a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/ManifestLocalization.java b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/ManifestLocalization.java
index 4c0f8b5ee..825ae8d94 100644
--- a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/ManifestLocalization.java
+++ b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/ManifestLocalization.java
@@ -142,7 +142,7 @@ public class ManifestLocalization {
if (bundle.isResolved()) {
if (bundle.isFragment() && bundle.getHosts() != null) {
//if the bundle is a fragment, look in the host first
- searchBundle = bundle.getHosts()[0].getBundleHost();
+ searchBundle = bundle.getHosts()[0];
if (searchBundle.getState() == Bundle.UNINSTALLED)
searchBundle = bundle;
}
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 1df117a75..a74ca3933 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
@@ -18,6 +18,8 @@ import java.util.*;
import org.eclipse.osgi.framework.adaptor.BundleClassLoader;
import org.eclipse.osgi.framework.adaptor.BundleData;
import org.eclipse.osgi.framework.debug.Debug;
+import org.eclipse.osgi.internal.loader.BundleLoader;
+import org.eclipse.osgi.internal.loader.BundleLoaderProxy;
import org.eclipse.osgi.internal.profile.Profile;
import org.eclipse.osgi.service.resolver.*;
import org.eclipse.osgi.util.NLS;
@@ -309,7 +311,7 @@ public class PackageAdminImpl implements PackageAdmin {
}
BundleLoaderProxy proxy = (BundleLoaderProxy) bundle.getUserObject();
if (proxy != null) {
- BundleHost.closeBundleLoader(proxy);
+ BundleLoader.closeBundleLoader(proxy);
try {
proxy.getBundleHost().getBundleData().close();
} catch (IOException e) {
@@ -333,7 +335,7 @@ public class PackageAdminImpl implements PackageAdmin {
BundleDescription[] hosts = bundleDescription.getHost().getHosts();
for (int i = 0; i < hosts.length; i++) {
BundleHost host = (BundleHost) framework.getBundle(hosts[i].getBundleId());
- resolve = ((BundleFragment) bundle).addHost(host.getLoaderProxy());
+ resolve = ((BundleFragment) bundle).addHost(host);
}
}
if (resolve)
@@ -558,19 +560,20 @@ public class PackageAdminImpl implements PackageAdmin {
}
public Bundle[] getHosts(Bundle bundle) {
- BundleLoaderProxy[] hosts = ((AbstractBundle) bundle).getHosts();
+ BundleHost[] hosts = ((AbstractBundle) bundle).getHosts();
if (hosts == null)
return null;
+ // copy the array to protect modification
Bundle[] result = new Bundle[hosts.length];
for (int i = 0; i < hosts.length; i++)
- result[i] = hosts[i].getBundleHost();
+ result[i] = hosts[i];
return result;
}
Bundle getBundlePriv(Class clazz) {
ClassLoader cl = clazz.getClassLoader();
if (cl instanceof BundleClassLoader)
- return ((BundleLoader) ((BundleClassLoader) cl).getDelegate()).bundle;
+ return ((BundleLoader) ((BundleClassLoader) cl).getDelegate()).getBundle();
if (cl == getClass().getClassLoader())
return framework.systemBundle;
return null;
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/internal/loader/BundleLoader.java
index 8e102434d..126ba9941 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/internal/loader/BundleLoader.java
@@ -9,7 +9,7 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.osgi.framework.internal.core;
+package org.eclipse.osgi.internal.loader;
import java.io.FileNotFoundException;
import java.io.IOException;
@@ -19,6 +19,7 @@ import java.security.PrivilegedAction;
import java.util.*;
import org.eclipse.osgi.framework.adaptor.*;
import org.eclipse.osgi.framework.debug.Debug;
+import org.eclipse.osgi.framework.internal.core.*;
import org.eclipse.osgi.framework.util.KeyedHashSet;
import org.eclipse.osgi.internal.loader.buddy.PolicyHandler;
import org.eclipse.osgi.service.resolver.*;
@@ -31,7 +32,7 @@ import org.osgi.framework.FrameworkEvent;
* It represents the loaded state of the bundle. BundleLoader objects
* are created lazily; care should be taken not to force the creation
* of a BundleLoader unless it is necessary.
- * @see org.eclipse.osgi.framework.internal.core.BundleLoaderProxy
+ * @see org.eclipse.osgi.internal.loader.BundleLoaderProxy
*/
public class BundleLoader implements ClassLoaderDelegate {
public final static String DEFAULT_PACKAGE = "."; //$NON-NLS-1$
@@ -223,9 +224,9 @@ public class BundleLoader implements ClassLoaderDelegate {
} catch (BundleException e) {
// do nothing; buddyList == null
}
- policy = buddyList != null ? new PolicyHandler(this, buddyList, bundle.framework.packageAdmin) : null;
+ policy = buddyList != null ? new PolicyHandler(this, buddyList, bundle.getFramework().getPackageAdmin()) : null;
if (policy != null)
- policy.open(bundle.framework.systemBundle.context);
+ policy.open(bundle.getFramework().getSystemBundleContext());
}
private synchronized KeyedHashSet getImportedSources(KeyedHashSet visited) {
@@ -281,7 +282,7 @@ public class BundleLoader implements ClassLoaderDelegate {
if (sourceProxy == null) {
// may need to force the proxy to be created
long exportingID = source.getBundleId();
- BundleHost exportingBundle = (BundleHost) bundle.framework.getBundle(exportingID);
+ BundleHost exportingBundle = (BundleHost) bundle.getFramework().getBundle(exportingID);
if (exportingBundle == null)
return null;
sourceProxy = exportingBundle.getLoaderProxy();
@@ -299,7 +300,7 @@ public class BundleLoader implements ClassLoaderDelegate {
if (classloader != null)
classloader.close();
if (policy != null)
- policy.close(bundle.framework.systemBundle.context);
+ policy.close(bundle.getFramework().getSystemBundleContext());
loaderFlags |= FLAG_CLOSED; /* This indicates the BundleLoader is destroyed */
}
@@ -312,7 +313,7 @@ public class BundleLoader implements ClassLoaderDelegate {
* @return the resulting Class
* @exception java.lang.ClassNotFoundException if the class definition was not found.
*/
- final Class loadClass(String name) throws ClassNotFoundException {
+ final public Class loadClass(String name) throws ClassNotFoundException {
return createClassLoader().loadClass(name);
}
@@ -336,7 +337,7 @@ public class BundleLoader implements ClassLoaderDelegate {
return parent;
}
- final synchronized BundleClassLoader createClassLoader() {
+ final public synchronized BundleClassLoader createClassLoader() {
if (classloader != null)
return classloader;
String[] classpath;
@@ -345,12 +346,12 @@ public class BundleLoader implements ClassLoaderDelegate {
} catch (BundleException e) {
// no classpath
classpath = new String[0];
- bundle.framework.publishFrameworkEvent(FrameworkEvent.ERROR, bundle, e);
+ bundle.getFramework().publishFrameworkEvent(FrameworkEvent.ERROR, bundle, e);
}
if (classpath == null) {
// no classpath
classpath = new String[0];
- bundle.framework.publishFrameworkEvent(FrameworkEvent.ERROR, bundle, new BundleException(Msg.BUNDLE_NO_CLASSPATH_MATCH, BundleException.MANIFEST_ERROR));
+ bundle.getFramework().publishFrameworkEvent(FrameworkEvent.ERROR, bundle, new BundleException(Msg.BUNDLE_NO_CLASSPATH_MATCH, BundleException.MANIFEST_ERROR));
}
BundleClassLoader bcl = createBCLPrevileged(bundle.getProtectionDomain(), classpath);
parent = getParentPrivileged(bcl);
@@ -410,7 +411,7 @@ public class BundleLoader implements ClassLoaderDelegate {
String pkgName = getPackageName(name);
boolean bootDelegation = false;
// follow the OSGi delegation model
- if (checkParent && parentCL != null && isBootDelegationPackage(pkgName))
+ if (checkParent && parentCL != null && bundle.getFramework().isBootDelegationPackage(pkgName))
// 2) if part of the bootdelegation list then delegate to parent and continue of failure
try {
return parentCL.loadClass(name);
@@ -474,7 +475,7 @@ public class BundleLoader implements ClassLoaderDelegate {
return result;
// hack to support backwards compatibiility for bootdelegation
// or last resort; do class context trick to work around VM bugs
- if (parentCL != null && !bootDelegation && ((checkParent && bundle.framework.compatibiltyBootDelegation) || isRequestFromVM()))
+ if (parentCL != null && !bootDelegation && ((checkParent && bundle.getFramework().compatibiltyBootDelegation) || isRequestFromVM()))
// we don't need to continue if a CNFE is thrown here.
try {
return parentCL.loadClass(name);
@@ -485,35 +486,35 @@ public class BundleLoader implements ClassLoaderDelegate {
}
private Object searchHooks(String name, int type) throws ClassNotFoundException, FileNotFoundException {
- ClassLoaderDelegateHook[] delegateHooks = bundle.framework.delegateHooks;
+ ClassLoaderDelegateHook[] delegateHooks = bundle.getFramework().getDelegateHooks();
if (delegateHooks == null)
return null;
Object result = null;
for (int i = 0; i < delegateHooks.length && result == null; i++) {
switch (type) {
case PRE_CLASS :
- result = delegateHooks[i].preFindClass(name, createClassLoader(), bundle.bundledata);
+ result = delegateHooks[i].preFindClass(name, createClassLoader(), bundle.getBundleData());
break;
case POST_CLASS :
- result = delegateHooks[i].postFindClass(name, createClassLoader(), bundle.bundledata);
+ result = delegateHooks[i].postFindClass(name, createClassLoader(), bundle.getBundleData());
break;
case PRE_RESOURCE :
- result = delegateHooks[i].preFindResource(name, createClassLoader(), bundle.bundledata);
+ result = delegateHooks[i].preFindResource(name, createClassLoader(), bundle.getBundleData());
break;
case POST_RESOURCE :
- result = delegateHooks[i].postFindResource(name, createClassLoader(), bundle.bundledata);
+ result = delegateHooks[i].postFindResource(name, createClassLoader(), bundle.getBundleData());
break;
case PRE_RESOURCES :
- result = delegateHooks[i].preFindResources(name, createClassLoader(), bundle.bundledata);
+ result = delegateHooks[i].preFindResources(name, createClassLoader(), bundle.getBundleData());
break;
case POST_RESOURCES :
- result = delegateHooks[i].postFindResources(name, createClassLoader(), bundle.bundledata);
+ result = delegateHooks[i].postFindResources(name, createClassLoader(), bundle.getBundleData());
break;
case PRE_LIBRARY :
- result = delegateHooks[i].preFindLibrary(name, createClassLoader(), bundle.bundledata);
+ result = delegateHooks[i].preFindLibrary(name, createClassLoader(), bundle.getBundleData());
break;
case POST_LIBRARY :
- result = delegateHooks[i].postFindLibrary(name, createClassLoader(), bundle.bundledata);
+ result = delegateHooks[i].postFindLibrary(name, createClassLoader(), bundle.getBundleData());
break;
}
}
@@ -521,7 +522,7 @@ public class BundleLoader implements ClassLoaderDelegate {
}
private boolean isRequestFromVM() {
- if (bundle.framework.bootDelegateAll || !bundle.framework.contextBootDelegation)
+ if (bundle.getFramework().isBootDelegationPackage("*") || !bundle.getFramework().contextBootDelegation) //$NON-NLS-1$
return false;
// works around VM bugs that require all classloaders to have access to parent packages
Class[] context = CLASS_CONTEXT.getClassContext();
@@ -572,7 +573,7 @@ public class BundleLoader implements ClassLoaderDelegate {
// 1) if startsWith "java." delegate to parent and terminate search
// we never delegate java resource requests past the parent
return parentCL.getResource(name);
- else if (isBootDelegationPackage(pkgName)) {
+ else if (bundle.getFramework().isBootDelegationPackage(pkgName)) {
// 2) if part of the bootdelegation list then delegate to parent and continue of failure
URL result = parentCL.getResource(name);
if (result != null)
@@ -629,26 +630,12 @@ public class BundleLoader implements ClassLoaderDelegate {
return result;
// hack to support backwards compatibiility for bootdelegation
// or last resort; do class context trick to work around VM bugs
- if (parentCL != null && !bootDelegation && ((checkParent && bundle.framework.compatibiltyBootDelegation) || isRequestFromVM()))
+ if (parentCL != null && !bootDelegation && ((checkParent && bundle.getFramework().compatibiltyBootDelegation) || isRequestFromVM()))
// we don't need to continue if the resource is not found here
return parentCL.getResource(name);
return result;
}
- boolean isBootDelegationPackage(String name) {
- if (bundle.framework.bootDelegateAll)
- return true;
- if (bundle.framework.bootDelegation != null)
- for (int i = 0; i < bundle.framework.bootDelegation.length; i++)
- if (name.equals(bundle.framework.bootDelegation[i]))
- return true;
- if (bundle.framework.bootDelegationStems != null)
- for (int i = 0; i < bundle.framework.bootDelegationStems.length; i++)
- if (name.startsWith(bundle.framework.bootDelegationStems[i]))
- return true;
- return false;
- }
-
/**
* Finds the resources for a bundle. This method is used for delegation by the bundle's classloader.
*/
@@ -707,14 +694,14 @@ public class BundleLoader implements ClassLoaderDelegate {
/*
* This method is used by Bundle.getResources to do proper parent delegation.
*/
- Enumeration getResources(String name) throws IOException {
+ public Enumeration getResources(String name) throws IOException {
if ((name.length() > 1) && (name.charAt(0) == '/')) /* if name has a leading slash */
name = name.substring(1); /* remove leading slash before search */
String pkgName = getResourcePackageName(name);
// follow the OSGi delegation model
// First check the parent classloader for system resources, if it is a java resource.
Enumeration result = null;
- if (pkgName.startsWith(JAVA_PACKAGE) || isBootDelegationPackage(pkgName)) {
+ if (pkgName.startsWith(JAVA_PACKAGE) || bundle.getFramework().isBootDelegationPackage(pkgName)) {
// 1) if startsWith "java." delegate to parent and terminate search
// 2) if part of the bootdelegation list then delegate to parent and continue of failure
ClassLoader parentCL = getParentClassLoader();
@@ -838,9 +825,9 @@ public class BundleLoader implements ClassLoaderDelegate {
for (int i = 0; i < fragments.length; i++) {
AbstractBundle fragment = (AbstractBundle) fragments[i];
try {
- bcl.attachFragment(fragment.getBundleData(), fragment.domain, fragment.getBundleData().getClassPath());
+ bcl.attachFragment(fragment.getBundleData(), fragment.getProtectionDomain(), fragment.getBundleData().getClassPath());
} catch (BundleException be) {
- bundle.framework.publishFrameworkEvent(FrameworkEvent.ERROR, bundle, be);
+ bundle.getFramework().publishFrameworkEvent(FrameworkEvent.ERROR, bundle, be);
}
}
@@ -1021,12 +1008,12 @@ public class BundleLoader implements ClassLoaderDelegate {
addDynamicImportPackage((String[]) dynamicImports.toArray(new String[dynamicImports.size()]));
}
- synchronized void attachFragment(BundleFragment fragment) throws BundleException {
+ synchronized public void attachFragment(BundleFragment fragment) throws BundleException {
if (classloader == null)
return;
String[] classpath = fragment.getBundleData().getClassPath();
if (classpath != null)
- classloader.attachFragment(fragment.getBundleData(), fragment.domain, classpath);
+ classloader.attachFragment(fragment.getBundleData(), fragment.getProtectionDomain(), classpath);
}
/*
@@ -1054,7 +1041,7 @@ public class BundleLoader implements ClassLoaderDelegate {
private PackageSource findDynamicSource(String pkgName) {
if (isDynamicallyImported(pkgName)) {
- ExportPackageDescription exportPackage = bundle.framework.adaptor.getState().linkDynamicImport(proxy.getBundleDescription(), pkgName);
+ ExportPackageDescription exportPackage = bundle.getFramework().getAdaptor().getState().linkDynamicImport(proxy.getBundleDescription(), pkgName);
if (exportPackage != null) {
PackageSource source = createExportPackageSource(exportPackage, null);
synchronized (this) {
@@ -1111,7 +1098,7 @@ public class BundleLoader implements ClassLoaderDelegate {
* if the bundle exports the package. This is used to compare the PackageSource of a
* package from two different bundles.
*/
- final PackageSource getPackageSource(String pkgName) {
+ public final PackageSource getPackageSource(String pkgName) {
PackageSource result = findSource(pkgName);
if (!isExportedPackage(pkgName))
return result;
@@ -1229,4 +1216,17 @@ public class BundleLoader implements ClassLoaderDelegate {
}
}
+ static public void closeBundleLoader(BundleLoaderProxy proxy) {
+ if (proxy == null)
+ return;
+ // First close the BundleLoader
+ BundleLoader loader = proxy.getBasicBundleLoader();
+ if (loader != null)
+ loader.close();
+ proxy.setStale();
+ // if proxy is not null then make sure to unset user object
+ // associated with the proxy in the state
+ BundleDescription description = proxy.getBundleDescription();
+ description.setUserObject(null);
+ }
}
diff --git a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/BundleLoaderProxy.java b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/internal/loader/BundleLoaderProxy.java
index de536ab2b..e6311ca1b 100644
--- a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/BundleLoaderProxy.java
+++ b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/internal/loader/BundleLoaderProxy.java
@@ -8,9 +8,11 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.osgi.framework.internal.core;
+package org.eclipse.osgi.internal.loader;
import java.util.ArrayList;
+import org.eclipse.osgi.framework.internal.core.*;
+import org.eclipse.osgi.framework.internal.core.Constants;
import org.eclipse.osgi.framework.util.KeyedHashSet;
import org.eclipse.osgi.service.resolver.BundleDescription;
import org.eclipse.osgi.service.resolver.ExportPackageDescription;
@@ -53,18 +55,18 @@ public class BundleLoaderProxy implements RequiredBundle {
else
loader = new BundleLoader(bundle, this);
} catch (BundleException e) {
- bundle.framework.publishFrameworkEvent(FrameworkEvent.ERROR, bundle, e);
+ bundle.getFramework().publishFrameworkEvent(FrameworkEvent.ERROR, bundle, e);
return null;
}
}
return loader;
}
- BundleLoader getBasicBundleLoader() {
+ public BundleLoader getBasicBundleLoader() {
return loader;
}
- AbstractBundle getBundleHost() {
+ public AbstractBundle getBundleHost() {
return bundle;
}
@@ -72,7 +74,7 @@ public class BundleLoaderProxy implements RequiredBundle {
stale = true;
}
- boolean isStale() {
+ public boolean isStale() {
return stale;
}
@@ -166,12 +168,12 @@ public class BundleLoaderProxy implements RequiredBundle {
return pkgSource;
}
- boolean inUse() {
+ public boolean inUse() {
return description.getDependents().length > 0;
}
boolean forceSourceCreation(ExportPackageDescription export) {
- boolean strict = Constants.STRICT_MODE.equals(bundle.framework.adaptor.getState().getPlatformProperties()[0].get(Constants.OSGI_RESOLVER_MODE));
+ boolean strict = Constants.STRICT_MODE.equals(FrameworkProperties.getProperty(Constants.OSGI_RESOLVER_MODE));
return (export.getDirective(Constants.INCLUDE_DIRECTIVE) != null) || (export.getDirective(Constants.EXCLUDE_DIRECTIVE) != null) || (strict && export.getDirective(Constants.FRIENDS_DIRECTIVE) != null);
}
@@ -181,7 +183,7 @@ public class BundleLoaderProxy implements RequiredBundle {
// that the source for special case package sources (filtered or re-exported should be stored
// in the cache. if this flag is set then a normal SinglePackageSource will not be created
// (i.e. it will be created lazily)
- PackageSource createPackageSource(ExportPackageDescription export, boolean storeSource) {
+ public PackageSource createPackageSource(ExportPackageDescription export, boolean storeSource) {
PackageSource pkgSource = null;
// check to see if it is a filtered export
@@ -189,7 +191,7 @@ public class BundleLoaderProxy implements RequiredBundle {
String excludes = (String) export.getDirective(Constants.EXCLUDE_DIRECTIVE);
String[] friends = (String[]) export.getDirective(Constants.FRIENDS_DIRECTIVE);
if (friends != null) {
- boolean strict = Constants.STRICT_MODE.equals(bundle.framework.adaptor.getState().getPlatformProperties()[0].get(Constants.OSGI_RESOLVER_MODE));
+ boolean strict = Constants.STRICT_MODE.equals(FrameworkProperties.getProperty(Constants.OSGI_RESOLVER_MODE));
if (!strict)
friends = null; // do not pay attention to friends if not in strict mode
}
diff --git a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/FilteredSourcePackage.java b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/internal/loader/FilteredSourcePackage.java
index bb1e4cf55..f14829397 100644
--- a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/FilteredSourcePackage.java
+++ b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/internal/loader/FilteredSourcePackage.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 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
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.osgi.framework.internal.core;
+package org.eclipse.osgi.internal.loader;
import java.net.URL;
import java.util.Enumeration;
diff --git a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/MultiSourcePackage.java b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/internal/loader/MultiSourcePackage.java
index b82ac7439..3155fa52f 100644
--- a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/MultiSourcePackage.java
+++ b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/internal/loader/MultiSourcePackage.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
+ * Copyright (c) 2003, 2008 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
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.osgi.framework.internal.core;
+package org.eclipse.osgi.internal.loader;
import java.net.URL;
import java.util.Enumeration;
diff --git a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/NullPackageSource.java b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/internal/loader/NullPackageSource.java
index ec9b621ae..b70b4837a 100644
--- a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/NullPackageSource.java
+++ b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/internal/loader/NullPackageSource.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.osgi.framework.internal.core;
+package org.eclipse.osgi.internal.loader;
import java.net.URL;
import java.util.Enumeration;
diff --git a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/PackageSource.java b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/internal/loader/PackageSource.java
index 428dbda29..6b4eaeb66 100644
--- a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/PackageSource.java
+++ b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/internal/loader/PackageSource.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2006 IBM Corporation and others.
+ * Copyright (c) 2003, 2008 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
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.osgi.framework.internal.core;
+package org.eclipse.osgi.internal.loader;
import java.io.IOException;
import java.net.URL;
diff --git a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/SingleSourcePackage.java b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/internal/loader/SingleSourcePackage.java
index 57dba1e06..bdab8f289 100644
--- a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/SingleSourcePackage.java
+++ b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/internal/loader/SingleSourcePackage.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * Copyright (c) 2003, 2008 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
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.osgi.framework.internal.core;
+package org.eclipse.osgi.internal.loader;
import java.net.URL;
import java.util.Enumeration;
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/internal/loader/SystemBundleLoader.java
index d2ab69df6..b45d4a1bc 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/internal/loader/SystemBundleLoader.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
+ * Copyright (c) 2003, 2008 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
@@ -9,13 +9,15 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.osgi.framework.internal.core;
+package org.eclipse.osgi.internal.loader;
import java.io.IOException;
import java.net.URL;
import java.util.Enumeration;
import java.util.HashSet;
import org.eclipse.osgi.framework.adaptor.BundleData;
+import org.eclipse.osgi.framework.internal.core.BundleFragment;
+import org.eclipse.osgi.framework.internal.core.BundleHost;
import org.eclipse.osgi.service.resolver.ExportPackageDescription;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleException;
@@ -80,7 +82,7 @@ public class SystemBundleLoader extends BundleLoader {
extPackages.add(extExports[j].getName());
}
- synchronized void attachFragment(BundleFragment fragment) throws BundleException {
+ synchronized public void attachFragment(BundleFragment fragment) throws BundleException {
super.attachFragment(fragment);
synchronized (extPackages) {
addExtPackages(fragment);
diff --git a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/internal/loader/buddy/DependentPolicy.java b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/internal/loader/buddy/DependentPolicy.java
index f1897f180..85240f288 100644
--- a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/internal/loader/buddy/DependentPolicy.java
+++ b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/internal/loader/buddy/DependentPolicy.java
@@ -14,8 +14,8 @@ package org.eclipse.osgi.internal.loader.buddy;
import java.io.IOException;
import java.net.URL;
import java.util.*;
-import org.eclipse.osgi.framework.internal.core.BundleLoader;
-import org.eclipse.osgi.framework.internal.core.BundleLoaderProxy;
+import org.eclipse.osgi.internal.loader.BundleLoader;
+import org.eclipse.osgi.internal.loader.BundleLoaderProxy;
import org.eclipse.osgi.service.resolver.BundleDescription;
/**
diff --git a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/internal/loader/buddy/GlobalPolicy.java b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/internal/loader/buddy/GlobalPolicy.java
index ca4cbf9f1..e1dc69b3a 100644
--- a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/internal/loader/buddy/GlobalPolicy.java
+++ b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/internal/loader/buddy/GlobalPolicy.java
@@ -10,12 +10,10 @@
*******************************************************************************/
package org.eclipse.osgi.internal.loader.buddy;
-import org.eclipse.osgi.framework.internal.core.BundleLoader;
-
import java.io.IOException;
import java.net.URL;
import java.util.Enumeration;
-
+import org.eclipse.osgi.internal.loader.BundleLoader;
import org.osgi.service.packageadmin.ExportedPackage;
import org.osgi.service.packageadmin.PackageAdmin;
diff --git a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/internal/loader/buddy/ParentPolicy.java b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/internal/loader/buddy/ParentPolicy.java
deleted file mode 100644
index 0c730a126..000000000
--- a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/internal/loader/buddy/ParentPolicy.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 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.internal.loader.buddy;
-
-import java.net.URL;
-import java.util.Enumeration;
-
-public class ParentPolicy implements IBuddyPolicy {
-
- public Class loadClass(String name) {
- // TODO Auto-generated method stub
- return null;
- }
-
- public URL loadResource(String name) {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Enumeration loadResources(String name) {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
diff --git a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/internal/loader/buddy/PolicyHandler.java b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/internal/loader/buddy/PolicyHandler.java
index 99a992f24..f5df49d6f 100644
--- a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/internal/loader/buddy/PolicyHandler.java
+++ b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/internal/loader/buddy/PolicyHandler.java
@@ -10,9 +10,10 @@
*******************************************************************************/
package org.eclipse.osgi.internal.loader.buddy;
+import org.eclipse.osgi.internal.loader.BundleLoader;
+
import java.net.URL;
import java.util.*;
-import org.eclipse.osgi.framework.internal.core.BundleLoader;
import org.eclipse.osgi.framework.internal.core.Constants;
import org.osgi.framework.*;
import org.osgi.service.packageadmin.PackageAdmin;
diff --git a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/internal/loader/buddy/RegisteredPolicy.java b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/internal/loader/buddy/RegisteredPolicy.java
index b02add967..9623081d2 100644
--- a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/internal/loader/buddy/RegisteredPolicy.java
+++ b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/internal/loader/buddy/RegisteredPolicy.java
@@ -14,7 +14,10 @@ import java.io.IOException;
import java.net.URL;
import java.util.Enumeration;
import java.util.Iterator;
-import org.eclipse.osgi.framework.internal.core.*;
+import org.eclipse.osgi.framework.internal.core.AbstractBundle;
+import org.eclipse.osgi.framework.internal.core.Constants;
+import org.eclipse.osgi.internal.loader.BundleLoader;
+import org.eclipse.osgi.internal.loader.BundleLoaderProxy;
import org.eclipse.osgi.service.resolver.BundleDescription;
import org.eclipse.osgi.util.ManifestElement;
import org.osgi.framework.BundleException;
diff --git a/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/framework/internal/core/BundleResourceHandler.java b/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/framework/internal/core/BundleResourceHandler.java
index 4e697f415..34e870b23 100644
--- a/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/framework/internal/core/BundleResourceHandler.java
+++ b/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/framework/internal/core/BundleResourceHandler.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 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
@@ -19,6 +19,7 @@ import org.eclipse.osgi.baseadaptor.loader.BaseClassLoader;
import org.eclipse.osgi.framework.adaptor.FrameworkAdaptor;
import org.eclipse.osgi.framework.internal.protocol.ProtocolActivator;
import org.eclipse.osgi.internal.baseadaptor.AdaptorMsg;
+import org.eclipse.osgi.internal.loader.BundleLoader;
import org.eclipse.osgi.util.NLS;
import org.osgi.framework.*;

Back to the top