public class FrameworkUtils
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static boolean |
arrayContains(java.lang.Object[] array,
java.lang.Object value) |
static java.util.List<java.lang.String> |
extractHeaderDeclaration(java.lang.String headerStatement) |
static long[] |
getBundleDependencies(org.osgi.framework.BundleContext localBundleContext,
org.osgi.framework.Bundle bundle,
org.osgi.service.packageadmin.PackageAdmin packageAdmin)
Returns an array of ids of bundles the given bundle depends on
|
static java.lang.String[] |
getBundleExportedPackages(org.osgi.framework.Bundle bundle,
org.osgi.service.packageadmin.PackageAdmin packageAdmin)
Returns the packages exported by the specified bundle
|
static long[] |
getBundleIds(org.osgi.framework.Bundle[] bundles)
Returns an array of bundleIds
|
static long[] |
getBundleIds(java.util.List<org.osgi.framework.Bundle> bundles) |
static java.lang.String[] |
getBundleImportedPackages(org.osgi.framework.BundleContext localBundleContext,
org.osgi.framework.Bundle bundle,
org.osgi.service.packageadmin.PackageAdmin packageAdmin)
Returns the resolved package imports for the given bundle
|
static java.lang.String |
getBundleState(org.osgi.framework.Bundle bundle)
Returns a String representation of the bundles state
|
static long[] |
getDependentBundles(org.osgi.framework.Bundle bundle,
org.osgi.service.packageadmin.PackageAdmin packageAdmin)
Returns an array of ids of bundles that depend on the given bundle
|
static long[] |
getFragmentIds(org.osgi.framework.Bundle bundle,
org.osgi.service.packageadmin.PackageAdmin packageAdmin)
Returns the bundle ids of any resolved fragments
|
static long[] |
getHostIds(org.osgi.framework.Bundle fragment,
org.osgi.service.packageadmin.PackageAdmin packageAdmin)
Returns the bundle ids of any resolved hosts
|
static long[] |
getRegisteredServiceIds(org.osgi.framework.Bundle bundle)
Returns the service.id values for services registered by the given bundle
|
static long[] |
getServiceIds(org.osgi.framework.ServiceReference[] serviceReferences)
Returns an array of service.id values
|
static long[] |
getServicesInUseByBundle(org.osgi.framework.Bundle bundle)
Returns the service.id values of services being used by the given bundle
|
static boolean |
isBundlePendingRemoval(org.osgi.framework.Bundle bundle,
org.osgi.service.packageadmin.PackageAdmin packageAdmin)
Returns the status of pending removal
|
static boolean |
isBundleRequiredByOthers(org.osgi.framework.Bundle bundle,
org.osgi.service.packageadmin.PackageAdmin packageAdmin)
Checks if the given bundle is currently required by other bundles
|
static org.osgi.framework.Bundle |
resolveBundle(org.osgi.framework.BundleContext bundleContext,
long bundleId)
Returns the Bundle object for a given id
|
static org.osgi.framework.ServiceReference |
resolveService(org.osgi.framework.BundleContext bundleContext,
long serviceId)
Returns the ServiceReference object with matching service.id
|
public static org.osgi.framework.Bundle resolveBundle(org.osgi.framework.BundleContext bundleContext,
long bundleId)
throws java.io.IOException
bundleContext - bundleId - java.lang.IllegalArgumentException - if no Bundle is found with matching bundleIdjava.io.IOExceptionpublic static long[] getBundleIds(org.osgi.framework.Bundle[] bundles)
bundles - array of Bundle objectspublic static long[] getBundleIds(java.util.List<org.osgi.framework.Bundle> bundles)
public static org.osgi.framework.ServiceReference resolveService(org.osgi.framework.BundleContext bundleContext,
long serviceId)
throws java.io.IOException
bundleContext - serviceId - java.lang.IllegalArgumentException - if bundleContext is nulljava.io.IOException - if no service is found with the given idpublic static long[] getServiceIds(org.osgi.framework.ServiceReference[] serviceReferences)
serviceReferences - array of ServiceReference objectspublic static java.lang.String[] getBundleExportedPackages(org.osgi.framework.Bundle bundle,
org.osgi.service.packageadmin.PackageAdmin packageAdmin)
throws java.lang.IllegalArgumentException
bundle - packageAdmin - java.lang.IllegalArgumentException - if bundle or packageAdmin are nullpublic static long[] getFragmentIds(org.osgi.framework.Bundle bundle,
org.osgi.service.packageadmin.PackageAdmin packageAdmin)
throws java.lang.IllegalArgumentException
bundle - packageAdmin - java.lang.IllegalArgumentException - if bundle or packageAdmin are nullpublic static long[] getHostIds(org.osgi.framework.Bundle fragment,
org.osgi.service.packageadmin.PackageAdmin packageAdmin)
throws java.lang.IllegalArgumentException
fragment - packageAdmin - java.lang.IllegalArgumentException - if fragment or packageAdmin are nullpublic static java.lang.String[] getBundleImportedPackages(org.osgi.framework.BundleContext localBundleContext,
org.osgi.framework.Bundle bundle,
org.osgi.service.packageadmin.PackageAdmin packageAdmin)
throws java.lang.IllegalArgumentException
localBundleContext - BundleContext object of this bundle/callerbundle - target Bundle object to query imported packages forpackageAdmin - java.lang.IllegalArgumentException - if fragment or packageAdmin are nullpublic static long[] getRegisteredServiceIds(org.osgi.framework.Bundle bundle)
throws java.lang.IllegalArgumentException,
java.lang.IllegalStateException
bundle - java.lang.IllegalArgumentException - if bundle is nullIlleglStateException - if bundle has been uninstalledjava.lang.IllegalStateExceptionpublic static long[] getServicesInUseByBundle(org.osgi.framework.Bundle bundle)
throws java.lang.IllegalArgumentException,
java.lang.IllegalStateException
bundle - java.lang.IllegalArgumentException - if bundle is nullIlleglStateException - if bundle has been uninstalledjava.lang.IllegalStateExceptionpublic static boolean isBundlePendingRemoval(org.osgi.framework.Bundle bundle,
org.osgi.service.packageadmin.PackageAdmin packageAdmin)
throws java.lang.IllegalArgumentException
bundle - java.lang.IllegalArgumentException - if bundle or packageAdmin are nullpublic static boolean isBundleRequiredByOthers(org.osgi.framework.Bundle bundle,
org.osgi.service.packageadmin.PackageAdmin packageAdmin)
throws java.lang.IllegalArgumentException
bundle - packageAdmin - java.lang.IllegalArgumentException - if bundle or packageAdmin are nullpublic static long[] getBundleDependencies(org.osgi.framework.BundleContext localBundleContext,
org.osgi.framework.Bundle bundle,
org.osgi.service.packageadmin.PackageAdmin packageAdmin)
throws java.lang.IllegalArgumentException
localBundleContext - BundleContext object of this bundle/callerbundle - target Bundle object to query dependencies forpackageAdmin - java.lang.IllegalArgumentException - if bundle or packageAdmin are nullpublic static long[] getDependentBundles(org.osgi.framework.Bundle bundle,
org.osgi.service.packageadmin.PackageAdmin packageAdmin)
throws java.lang.IllegalArgumentException
bundle - packageAdmin - java.lang.IllegalArgumentException - if bundle or packageAdmin are nullpublic static java.lang.String getBundleState(org.osgi.framework.Bundle bundle)
bundle - public static boolean arrayContains(java.lang.Object[] array,
java.lang.Object value)
public static java.util.List<java.lang.String> extractHeaderDeclaration(java.lang.String headerStatement)
Copyright © 2009-2019 The Apache Software Foundation. All Rights Reserved.