public class BundleUtils extends Object
Constructor and Description |
---|
BundleUtils() |
Modifier and Type | Method and Description |
---|---|
static boolean |
canStart(org.osgi.framework.Bundle bundle) |
static boolean |
canStop(org.osgi.framework.Bundle bundle) |
static boolean |
canUninstall(org.osgi.framework.Bundle bundle) |
static org.osgi.framework.Bundle |
getContextBundle(boolean unwrap)
Returns bundle (if any) associated with current thread's context classloader.
|
static URL |
getEntry(org.osgi.framework.Bundle bundle,
String name)
Works like
Bundle.getEntry(String) but also checks
attached fragment bundles for the given entry. |
static Enumeration<String> |
getEntryPaths(org.osgi.framework.Bundle bundle,
String name)
Works like
Bundle.getEntryPaths(String) but also returns paths
in attached fragment bundles. |
static LinkedHashSet<org.osgi.framework.Bundle> |
getWiredBundles(org.osgi.framework.Bundle bundle) |
static LinkedHashSet<org.osgi.framework.Bundle> |
getWiredBundles(org.osgi.service.packageadmin.PackageAdmin packageAdmin,
org.osgi.framework.Bundle bundle) |
static boolean |
isFragment(org.osgi.framework.Bundle bundle) |
public BundleUtils()
public static boolean canStart(org.osgi.framework.Bundle bundle)
public static boolean canStop(org.osgi.framework.Bundle bundle)
public static boolean canUninstall(org.osgi.framework.Bundle bundle)
public static boolean isFragment(org.osgi.framework.Bundle bundle)
public static org.osgi.framework.Bundle getContextBundle(boolean unwrap)
unwrap
- if true and if the bundle associated with the context classloader is a
DelegatingBundle
, this function will return the main application bundle
backing with the DelegatingBundle
. Otherwise, the bundle associated with
the context classloader is returned as is. See BundleClassLoader.getBundle(boolean)
for more information.public static Enumeration<String> getEntryPaths(org.osgi.framework.Bundle bundle, String name)
Bundle.getEntryPaths(String)
but also returns paths
in attached fragment bundles.bundle
- name
- public static URL getEntry(org.osgi.framework.Bundle bundle, String name)
Bundle.getEntry(String)
but also checks
attached fragment bundles for the given entry.bundle
- name
- public static LinkedHashSet<org.osgi.framework.Bundle> getWiredBundles(org.osgi.framework.Bundle bundle)
public static LinkedHashSet<org.osgi.framework.Bundle> getWiredBundles(org.osgi.service.packageadmin.PackageAdmin packageAdmin, org.osgi.framework.Bundle bundle)
Copyright © 2005–2014. All rights reserved.