|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.aries.jmx.util.FrameworkUtils
public class FrameworkUtils
This class contains common utilities related to Framework operations for the MBean implementations
| Method Summary | |
|---|---|
static boolean |
arrayContains(Object[] array,
Object value)
|
static List<String> |
extractHeaderDeclaration(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 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(List<org.osgi.framework.Bundle> bundles)
|
static 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 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 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static org.osgi.framework.Bundle resolveBundle(org.osgi.framework.BundleContext bundleContext,
long bundleId)
throws IOException
bundleContext - bundleId -
IllegalArgumentException - if no Bundle is found with matching bundleId
IOExceptionpublic static long[] getBundleIds(org.osgi.framework.Bundle[] bundles)
bundles - array of Bundle objects
public static long[] getBundleIds(List<org.osgi.framework.Bundle> bundles)
public static org.osgi.framework.ServiceReference resolveService(org.osgi.framework.BundleContext bundleContext,
long serviceId)
throws IOException
bundleContext - serviceId -
IllegalArgumentException - if bundleContext is null
IOException - if no service is found with the given idpublic static long[] getServiceIds(org.osgi.framework.ServiceReference[] serviceReferences)
serviceReferences - array of ServiceReference objects
public static String[] getBundleExportedPackages(org.osgi.framework.Bundle bundle,
org.osgi.service.packageadmin.PackageAdmin packageAdmin)
throws IllegalArgumentException
bundle - packageAdmin -
IllegalArgumentException - if bundle or packageAdmin are null
public static long[] getFragmentIds(org.osgi.framework.Bundle bundle,
org.osgi.service.packageadmin.PackageAdmin packageAdmin)
throws IllegalArgumentException
bundle - packageAdmin -
IllegalArgumentException - if bundle or packageAdmin are null
public static long[] getHostIds(org.osgi.framework.Bundle fragment,
org.osgi.service.packageadmin.PackageAdmin packageAdmin)
throws IllegalArgumentException
fragment - packageAdmin -
IllegalArgumentException - if fragment or packageAdmin are null
public static String[] getBundleImportedPackages(org.osgi.framework.BundleContext localBundleContext,
org.osgi.framework.Bundle bundle,
org.osgi.service.packageadmin.PackageAdmin packageAdmin)
throws IllegalArgumentException
localBundleContext - BundleContext object of this bundle/callerbundle - target Bundle object to query imported packages forpackageAdmin -
IllegalArgumentException - if fragment or packageAdmin are null
public static long[] getRegisteredServiceIds(org.osgi.framework.Bundle bundle)
throws IllegalArgumentException,
IllegalStateException
bundle -
IllegalArgumentException - if bundle is null
IlleglStateException - if bundle has been uninstalled
IllegalStateException
public static long[] getServicesInUseByBundle(org.osgi.framework.Bundle bundle)
throws IllegalArgumentException,
IllegalStateException
bundle -
IllegalArgumentException - if bundle is null
IlleglStateException - if bundle has been uninstalled
IllegalStateException
public static boolean isBundlePendingRemoval(org.osgi.framework.Bundle bundle,
org.osgi.service.packageadmin.PackageAdmin packageAdmin)
throws IllegalArgumentException
bundle -
IllegalArgumentException - if bundle or packageAdmin are null
public static boolean isBundleRequiredByOthers(org.osgi.framework.Bundle bundle,
org.osgi.service.packageadmin.PackageAdmin packageAdmin)
throws IllegalArgumentException
bundle - packageAdmin -
IllegalArgumentException - if bundle or packageAdmin are null
public static long[] getBundleDependencies(org.osgi.framework.BundleContext localBundleContext,
org.osgi.framework.Bundle bundle,
org.osgi.service.packageadmin.PackageAdmin packageAdmin)
throws IllegalArgumentException
localBundleContext - BundleContext object of this bundle/callerbundle - target Bundle object to query dependencies forpackageAdmin -
IllegalArgumentException - if bundle or packageAdmin are null
public static long[] getDependentBundles(org.osgi.framework.Bundle bundle,
org.osgi.service.packageadmin.PackageAdmin packageAdmin)
throws IllegalArgumentException
bundle - packageAdmin -
IllegalArgumentException - if bundle or packageAdmin are nullpublic static String getBundleState(org.osgi.framework.Bundle bundle)
bundle -
public static boolean arrayContains(Object[] array,
Object value)
public static List<String> extractHeaderDeclaration(String headerStatement)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||