PackageAdmin changes from RFC 71.
diff --git a/bundles/org.eclipse.osgi/console/src/org/eclipse/osgi/framework/internal/core/ConsoleMessages.properties b/bundles/org.eclipse.osgi/console/src/org/eclipse/osgi/framework/internal/core/ConsoleMessages.properties
index 0a554d8..35c3700 100644
--- a/bundles/org.eclipse.osgi/console/src/org/eclipse/osgi/framework/internal/core/ConsoleMessages.properties
+++ b/bundles/org.eclipse.osgi/console/src/org/eclipse/osgi/framework/internal/core/ConsoleMessages.properties
@@ -145,4 +145,16 @@
STARTLEVEL_ARGUMENT_DESCRIPTION = <start level>
STARTLEVEL_IDLOCATION_ARGUMENT_DESCRIPTION = <start level> (<id>|<location>)
BUNDLE_CANT_FIND_BUNDLE=Can not find bundle.
-STARTLEVEL_POSITIVE_INTEGER=Startlevel must be a positive integer.
\ No newline at end of file
+STARTLEVEL_POSITIVE_INTEGER=Startlevel must be a positive integer.
+CONSOLE_NO_SYMBOLIC_BUNDLE_MESSAGE=No symbolic bundle
+CONSOLE_SYMBOLIC_BUNDLE_MESSAGE=Symbolic Bundle
+CONSOLE_PROVIDED_MESSAGE=[provided]
+CONSOLE_HOST_MESSAGE=Host bundles
+CONSOLE_NO_HOST_MESSAGE=No host bundles
+CONSOLE_FRAGMENT_MESSAGE=Fragment bundles
+CONSOLE_NO_FRAGMENT_MESSAGE=No fragment bundles
+CONSOLE_SYMBOLIC_BUNDLES_MESSAGE=Symbolic bundles
+CONSOLE_NO_SYMBOLIC_BUNDLE_MESSAGE=No symbolic bundles
+CONSOLE_REQUIRED_BUNDLES_MESSAGE=Required bundles
+CONSOLE_NO_REQUIRED_BUNDLES_MESSAGE=No required bundles
+CONSOLE_REQUIRES_MESSAGE=[requires]
\ No newline at end of file
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 72602bd..75a4dac 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
@@ -20,6 +20,7 @@
import org.eclipse.osgi.framework.console.CommandProvider;
import org.eclipse.osgi.framework.launcher.Launcher;
import org.osgi.framework.BundleException;
+import org.osgi.service.packageadmin.SymbolicBundle;
/**
* This class provides methods to execute commands from the command line. It registers
@@ -772,6 +773,91 @@
intp.println(ConsoleMsg.formatter.getString("CONSOLE_NO_IMPORTED_PACKAGES_MESSAGE"));
}
+ intp.print(" ");
+ if (packageAdmin.isFragment(bundle)) {
+ org.osgi.framework.Bundle[] hosts = packageAdmin.getHosts(bundle);
+ if (hosts != null) {
+ intp.println(ConsoleMsg.formatter.getString("CONSOLE_HOST_MESSAGE"));
+ for (int i=0; i<hosts.length; i++) {
+ intp.print(" ");
+ intp.println(hosts[i]);
+ }
+ }
+ else {
+ intp.println(ConsoleMsg.formatter.getString("CONSOLE_NO_HOST_MESSAGE"));
+ }
+ }
+ else {
+ org.osgi.framework.Bundle[] fragments = packageAdmin.getFragments(bundle);
+ if (fragments != null) {
+ intp.println(ConsoleMsg.formatter.getString("CONSOLE_FRAGMENT_MESSAGE"));
+ for (int i=0; i<fragments.length; i++) {
+ intp.print(" ");
+ intp.println(fragments[i]);
+ }
+ }
+ else {
+ intp.println(ConsoleMsg.formatter.getString("CONSOLE_NO_FRAGMENT_MESSAGE"));
+ }
+ }
+
+ SymbolicBundle[] symbolicBundles = packageAdmin.getSymbolicBundles(null);
+ SymbolicBundle symbolicBundle = null;
+ if (symbolicBundles != null) {
+ for (int i=0; i<symbolicBundles.length; i++) {
+ if (symbolicBundles[i].getProvidingBundle() == bundle) {
+ symbolicBundle = symbolicBundles[i];
+ break;
+ }
+ }
+ }
+
+ if (symbolicBundle == null) {
+ intp.print(" ");
+ intp.println(ConsoleMsg.formatter.getString("CONSOLE_NO_SYMBOLIC_BUNDLES_MESSAGE"));
+ } else {
+ intp.print(" ");
+ intp.println(ConsoleMsg.formatter.getString("CONSOLE_SYMBOLIC_BUNDLE_MESSAGE"));
+ intp.print(" ");
+ intp.print(symbolicBundle);
+ if (symbolicBundle.isRemovalPending()) {
+ intp.println(ConsoleMsg.formatter.getString("CONSOLE_REMOVAL_PENDING_MESSAGE"));
+ } else {
+ intp.println(ConsoleMsg.formatter.getString("CONSOLE_PROVIDED_MESSAGE"));
+ }
+ }
+
+ title = true;
+ for(int i=0; i<symbolicBundles.length; i++) {
+ if (symbolicBundles[i] == symbolicBundle)
+ continue;
+
+ org.osgi.framework.Bundle[] depBundles = symbolicBundles[i].getRequiringBundles();
+ if (depBundles == null)
+ continue;
+
+ for (int j=0; j<depBundles.length; j++) {
+ if (depBundles[j] == bundle) {
+ if (title) {
+ intp.print(" ");
+ intp.println(ConsoleMsg.formatter.getString("CONSOLE_REQUIRED_BUNDLES_MESSAGE"));
+ title = false;
+ }
+ intp.print(" ");
+ intp.print(symbolicBundles[i]);
+
+ org.osgi.framework.Bundle provider = symbolicBundle.getProvidingBundle();
+ intp.print("<");
+ intp.print(provider);
+ intp.println(">");
+ }
+ }
+ }
+ if (title) {
+ intp.print(" ");
+ intp.println(ConsoleMsg.formatter.getString("CONSOLE_NO_REQUIRED_BUNDLES_MESSAGE"));
+ }
+
}
} finally {
context.ungetService(packageAdminRef);
@@ -1413,6 +1499,65 @@
}
}
+ public void _symbolicBundles(CommandInterpreter intp) {
+
+ String token = intp.nextArgument();
+
+ org.osgi.framework.ServiceReference packageAdminRef = context.getServiceReference("org.osgi.service.packageadmin.PackageAdmin");
+ if (packageAdminRef != null) {
+ org.osgi.service.packageadmin.PackageAdmin packageAdmin = (org.osgi.service.packageadmin.PackageAdmin) context.getService(packageAdminRef);
+ if (packageAdmin != null) {
+ try {
+ org.osgi.service.packageadmin.SymbolicBundle[] symBundles = null;
+
+ symBundles = packageAdmin.getSymbolicBundles(token);
+
+ if (symBundles == null) {
+ intp.println(ConsoleMsg.formatter.getString("CONSOLE_NO_SYMBOLIC_BUNDLES_MESSAGE"));
+ } else {
+ for (int i = 0; i < symBundles.length; i++) {
+ org.osgi.service.packageadmin.SymbolicBundle symBundle = symBundles[i];
+ intp.print(symBundle);
+
+ boolean removalPending = symBundle.isRemovalPending();
+ if (removalPending) {
+ intp.print("(");
+ intp.print(ConsoleMsg.formatter.getString("CONSOLE_REMOVAL_PENDING_MESSAGE"));
+ intp.println(")");
+ }
+
+ org.osgi.framework.Bundle provider = symBundle.getProvidingBundle();
+ if (provider != null) {
+ intp.print("<");
+ intp.print(provider);
+ intp.println(">");
+
+ org.osgi.framework.Bundle[] requiring = symBundle.getRequiringBundles();
+ if (requiring != null)
+ for (int j = 0; j < requiring.length; j++) {
+ intp.print(" ");
+ intp.print(requiring[j]);
+ intp.print(" ");
+ intp.println(ConsoleMsg.formatter.getString("CONSOLE_REQUIRES_MESSAGE"));
+ }
+ } else {
+ intp.print("<");
+ intp.print(ConsoleMsg.formatter.getString("CONSOLE_STALE_MESSAGE"));
+ intp.println(">");
+ }
+
+ }
+ }
+ } finally {
+ context.ungetService(packageAdminRef);
+ }
+ }
+ } else {
+ intp.println(ConsoleMsg.formatter.getString("CONSOLE_NO_EXPORTED_PACKAGES_NO_PACKAGE_ADMIN_MESSAGE"));
+ }
+ }
+
+
/**
* Checks for the presence of the StartLevel Service. Outputs a message if it is not present.
* @param intp The CommandInterpreter object to be used to write to the console
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 55b8271..1cd7622 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
@@ -17,6 +17,8 @@
import java.security.ProtectionDomain;
import java.util.Dictionary;
import java.util.Enumeration;
+
+import org.osgi.framework.*;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleException;
diff --git a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/BundleContext.java b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/BundleContext.java
index 0492a59..3efba82 100644
--- a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/BundleContext.java
+++ b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/BundleContext.java
@@ -266,22 +266,7 @@
* object per installed bundle.
*/
public org.osgi.framework.Bundle[] getBundles() {
- BundleRepository bundles = framework.getBundles();
-
- synchronized (bundles) {
- List allBundles = bundles.getBundles();
- int size = allBundles.size();
-
- if (size == 0) {
- return (null);
- }
-
- Bundle[] bundlelist = new Bundle[size];
-
- allBundles.toArray(bundlelist);
-
- return (bundlelist);
- }
+ return framework.getAllBundles();
}
/**
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/framework/internal/core/BundleLoaderProxy.java
index 0250cfb..a46de08 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/framework/internal/core/BundleLoaderProxy.java
@@ -10,13 +10,21 @@
*******************************************************************************/
package org.eclipse.osgi.framework.internal.core;
-import org.eclipse.osgi.framework.debug.Debug;
-import org.eclipse.osgi.service.resolver.*;
+import java.util.ArrayList;
-public class BundleLoaderProxy implements KeyedElement {
+import org.eclipse.osgi.framework.adaptor.Version;
+import org.eclipse.osgi.framework.debug.Debug;
+import org.eclipse.osgi.service.resolver.BundleDescription;
+import org.eclipse.osgi.service.resolver.BundleSpecification;
+import org.eclipse.osgi.service.resolver.PackageSpecification;
+
+import org.osgi.service.packageadmin.SymbolicBundle;
+
+public class BundleLoaderProxy implements KeyedElement, SymbolicBundle{
private BundleLoader loader;
private BundleHost bundle;
private String uniqueId;
+ private Version version;
private String key;
private boolean stale = false;
private KeyedHashSet users;
@@ -28,7 +36,8 @@
if (this.uniqueId == null) {
this.uniqueId = new StringBuffer().append(bundle.id).append("NOUNIQUEID").toString();
}
- this.key = new StringBuffer(uniqueId).append("_").append(bundle.getVersion().toString()).toString();
+ this.version = bundle.getVersion();
+ this.key = new StringBuffer(uniqueId).append("_").append(this.version.toString()).toString();
this.users = new KeyedHashSet(false);
}
public BundleLoader getBundleLoader() {
@@ -63,7 +72,7 @@
if (!(other instanceof BundleLoaderProxy))
return false;
BundleLoaderProxy otherLoaderProxy = (BundleLoaderProxy) other;
- return (uniqueId.equals(otherLoaderProxy.uniqueId) && bundle.getVersion().isPerfect(otherLoaderProxy.bundle.getVersion()));
+ return (uniqueId.equals(otherLoaderProxy.uniqueId) && version.isPerfect(otherLoaderProxy.version));
}
public Object getKey() {
@@ -97,7 +106,10 @@
}
public String toString() {
- return bundle.getLocation();
+ StringBuffer sb = new StringBuffer(bundle.getGlobalName());
+ sb.append("; ").append(Constants.BUNDLE_VERSION_ATTRIBUTE);
+ sb.append("=\"").append(version.toString()).append("\"");
+ return sb.toString();
}
protected void markDependencies() {
@@ -157,4 +169,38 @@
}
}
}
-}
+
+ public org.osgi.framework.Bundle getProvidingBundle() {
+ if (isStale())
+ return null;
+
+ return bundle;
+ }
+ public org.osgi.framework.Bundle[] getRequiringBundles() {
+ if (isStale())
+ return null;
+
+ KeyedElement[] requiringProxies = users.elements();
+ ArrayList requiringBundles = new ArrayList();
+ for (int i = 0; i < requiringProxies.length; i++) {
+ BundleLoaderProxy requiringProxy = (BundleLoaderProxy) requiringProxies[i];
+ BundleLoader requiringLoader = requiringProxy.getBundleLoader();
+ BundleLoaderProxy[] reqBundles = requiringLoader.requiredBundles;
+ if (reqBundles != null)
+ for (int j=0; j<reqBundles.length; j++)
+ if (reqBundles[j] == this)
+ requiringBundles.add(requiringProxy.getBundle());
+ }
+
+ return (Bundle[]) requiringBundles.toArray(new Bundle[requiringBundles.size()]);
+ }
+ public String getName() {
+ return uniqueId;
+ }
+ public String getVersion() {
+ return version.toString();
+ }
+ public boolean isRemovalPending() {
+ return bundle.framework.packageAdmin.removalPending.contains(this);
+ }
+}
\ No newline at end of file
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 c321fe9..93b812a 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
@@ -1010,16 +1010,16 @@
/* Pass 2: perform osversion matching */
Version osversion;
try {
- osversion = new org.eclipse.osgi.framework.adaptor.Version(getProperty(Constants.FRAMEWORK_OS_VERSION));
+ osversion = new Version(getProperty(Constants.FRAMEWORK_OS_VERSION));
} catch (Exception e) {
- osversion = org.eclipse.osgi.framework.adaptor.Version.emptyVersion;
+ osversion = Version.emptyVersion;
}
matches = 0;
maxresult = 0;
Version[] bestVersion = new Version[elements.length];
- Version maxVersion = org.eclipse.osgi.framework.adaptor.Version.emptyVersion;
+ Version maxVersion = Version.emptyVersion;
for (int i = 0; i < elements.length; i++) {
if (score[i] > 0) {
@@ -1182,18 +1182,46 @@
}
/**
- * Retrieve a list of all installed bundles.
+ * Retrieve the BundleRepository of all installed bundles.
* The list is valid at the time
* of the call to getBundles, but the framework is a very dynamic
* environment and bundles can be installed or uninstalled at anytime.
*
- * @return A Vector of {@link Bundle} objects, one
- * object per installed bundle.
+ * @return The BundleRepository.
*/
protected BundleRepository getBundles() {
return (bundles);
}
+ /**
+ * Retrieve a list of all installed bundles.
+ * The list is valid at the time
+ * of the call to getBundleAlls, but the framework is a very dynamic
+ * environment and bundles can be installed or uninstalled at anytime.
+ *
+ * @return An Array of {@link Bundle} objects, one
+ * object per installed bundle.
+ */
+ protected Bundle[] getAllBundles(){
+ synchronized (bundles)
+ {
+ List allBundles = bundles.getBundles();
+ int size = allBundles.size();
+
+ if (size == 0)
+ {
+ return(null);
+ }
+
+ Bundle[] bundlelist = new Bundle[size];
+
+ allBundles.toArray(bundlelist);
+
+ return(bundlelist);
+ }
+ }
+
+
/**
* Resume a bundle.
*
diff --git a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/PackageAdmin.java b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/PackageAdmin.java
index ccb0779..015c743 100644
--- a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/PackageAdmin.java
+++ b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/PackageAdmin.java
@@ -13,11 +13,14 @@
import java.io.IOException;
import java.util.*;
+
+import org.eclipse.osgi.framework.adaptor.Version;
import org.eclipse.osgi.framework.debug.Debug;
import org.eclipse.osgi.framework.debug.DebugOptions;
import org.eclipse.osgi.service.resolver.*;
import org.osgi.framework.*;
import org.osgi.service.packageadmin.ExportedPackage;
+import org.osgi.service.packageadmin.SymbolicBundle;
/**
* PackageAdmin service for the OSGi specification.
@@ -755,7 +758,7 @@
* Resolve the bundles. This will make there exported packages available.
*/
if (Debug.DEBUG && Debug.DEBUG_PACKAGEADMIN) {
- Debug.println("refreshPackages: resolve bundles");
+ Debug.println("refreshBundles: resolve bundles");
}
BundleDescription[] resolved;
@@ -846,4 +849,95 @@
}
return (BundleDescription[]) result.toArray(new BundleDescription[result.size()]);
}
+
+ public SymbolicBundle[] getSymbolicBundles(String symbolicName){
+ if (exportedBundles == null || exportedBundles.size()==0)
+ return null;
+
+ KeyedElement[] allSymbolicBundles = exportedBundles.elements();
+ if (symbolicName == null) {
+ if (allSymbolicBundles.length == 0) {
+ return null;
+ }
+ SymbolicBundle[] result = new SymbolicBundle[allSymbolicBundles.length];
+ System.arraycopy(allSymbolicBundles, 0, result, 0, result.length);
+ return result;
+ }
+ else {
+ ArrayList result = new ArrayList();
+ for (int i=0; i<allSymbolicBundles.length; i++) {
+ SymbolicBundle symBundle = (SymbolicBundle) allSymbolicBundles[i];
+ if (symBundle.getName().equals(symbolicName))
+ result.add(symBundle);
+ }
+ return (SymbolicBundle[]) result.toArray(new SymbolicBundle[result.size()]);
+ }
+ }
+
+ public org.osgi.framework.Bundle getBundle(String symbolicName) {
+ org.osgi.framework.Bundle[] bundles = framework.getBundleByUniqueId(symbolicName);
+ if (bundles == null)
+ return null;
+
+ for (int i=0; i<bundles.length; i++) {
+ if (((Bundle)bundles[i]).isResolved()){
+ return bundles[i];
+ }
+ }
+ return null;
+ }
+
+ public org.osgi.framework.Bundle[] getBundles(String symbolicName, String version, String match) {
+ if (symbolicName == null) {
+ return framework.getAllBundles();
+ }
+ else {
+ Bundle bundles[] = framework.getBundleByUniqueId(symbolicName);
+ if (bundles == null)
+ return null;
+
+ if (version == null)
+ return bundles;
+
+ ArrayList result = new ArrayList();
+ Version ver = new Version(version);
+ for(int i=0; i<bundles.length; i++) {
+ match = match==null ? Constants.VERSION_MATCH_GREATERTHANOREQUAL : match;
+ boolean foundMatch = false;
+ if (match.equalsIgnoreCase(Constants.VERSION_MATCH_PERFECT))
+ foundMatch = bundles[i].getVersion().isPerfect(ver);
+ else if (match.equalsIgnoreCase(Constants.VERSION_MATCH_EQUIVALENT))
+ foundMatch = bundles[i].getVersion().isEquivalentTo(ver);
+ else if (match.equalsIgnoreCase(Constants.VERSION_MATCH_COMPATIBLE))
+ foundMatch = bundles[i].getVersion().isCompatibleWith(ver);
+ else if (match.equalsIgnoreCase(Constants.VERSION_MATCH_GREATERTHANOREQUAL))
+ foundMatch = bundles[i].getVersion().isGreaterOrEqualTo(ver);
+
+ if (foundMatch) {
+ result.add(bundles[i]);
+ }
+ }
+ if (result.size()==0)
+ return null;
+ else
+ return (Bundle[]) result.toArray(new Bundle[result.size()]);
+ }
+ }
+
+ public org.osgi.framework.Bundle[] getFragments(org.osgi.framework.Bundle bundle) {
+ return bundle.getFragments();
+ }
+
+ public org.osgi.framework.Bundle[] getHosts(org.osgi.framework.Bundle bundle) {
+ org.osgi.framework.Bundle host = bundle.getHost();
+ if (host == null)
+ return null;
+ else
+ return new org.osgi.framework.Bundle[] {host};
+ }
+
+ public boolean isFragment(org.osgi.framework.Bundle bundle) {
+ return bundle.isFragment();
+ }
+
}
\ No newline at end of file
diff --git a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/SystemBundleData.java b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/SystemBundleData.java
index 648a4ce..3e075ce 100644
--- a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/SystemBundleData.java
+++ b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/SystemBundleData.java
@@ -19,6 +19,7 @@
import java.util.Enumeration;
import org.eclipse.osgi.framework.adaptor.*;
import org.eclipse.osgi.framework.util.Headers;
+import org.osgi.framework.*;
public class SystemBundleData implements BundleData {
diff --git a/bundles/org.eclipse.osgi/osgi/src/org/osgi/service/packageadmin/PackageAdmin.java b/bundles/org.eclipse.osgi/osgi/src/org/osgi/service/packageadmin/PackageAdmin.java
index 1061bcf..3f84a9a 100644
--- a/bundles/org.eclipse.osgi/osgi/src/org/osgi/service/packageadmin/PackageAdmin.java
+++ b/bundles/org.eclipse.osgi/osgi/src/org/osgi/service/packageadmin/PackageAdmin.java
@@ -1,5 +1,5 @@
/*
- * $Header: /home/technology/org.eclipse.equinox/plugins/org.eclipse.osgi/osgi/src/org/osgi/service/packageadmin/PackageAdmin.java,v 1.1 2003/11/10 17:49:34 jeff Exp $
+ * $Header: /home/eclipse/org.eclipse.osgi/osgi/src/org/osgi/service/packageadmin/PackageAdmin.java,v 1.1 2003/11/25 21:24:14 dj Exp $
*
* Copyright (c) The Open Services Gateway Initiative (2001, 2002).
* All Rights Reserved.
@@ -161,4 +161,13 @@
* permissions.
*/
public void refreshPackages(Bundle[] bundles);
+
+ public SymbolicBundle[] getSymbolicBundles(String symbolicName);
+
+ public Bundle getBundle(String symbolicName);
+ public Bundle[] getBundles(String symbolicName, String version, String match);
+ public Bundle[] getFragments(Bundle bundle);
+ public Bundle[] getHosts(Bundle bundle);
+ public boolean isFragment(Bundle bundle);
+
}
diff --git a/bundles/org.eclipse.osgi/osgi/src/org/osgi/service/packageadmin/SymbolicBundle.java b/bundles/org.eclipse.osgi/osgi/src/org/osgi/service/packageadmin/SymbolicBundle.java
new file mode 100644
index 0000000..a31d4eb
--- /dev/null
+++ b/bundles/org.eclipse.osgi/osgi/src/org/osgi/service/packageadmin/SymbolicBundle.java
@@ -0,0 +1,11 @@
+package org.osgi.service.packageadmin;
+
+import org.osgi.framework.Bundle;
+
+public interface SymbolicBundle {
+ public Bundle getProvidingBundle();
+ public Bundle[] getRequiringBundles();
+ public String getName();
+ public String getVersion();
+ public boolean isRemovalPending();
+}