org.apache.xbean.osgi.bundle.util
Class BundleUtils
java.lang.Object
org.apache.xbean.osgi.bundle.util.BundleUtils
public class BundleUtils
- extends java.lang.Object
- Version:
- $Rev: 937957 $ $Date: 2010-04-26 10:00:08 +0200 (Mon, 26 Apr 2010) $
Method Summary |
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 java.net.URL |
getEntry(org.osgi.framework.Bundle bundle,
java.lang.String name)
Works like Bundle.getEntry(String) but also checks
attached fragment bundles for the given entry. |
static java.util.Enumeration<java.lang.String> |
getEntryPaths(org.osgi.framework.Bundle bundle,
java.lang.String name)
Works like Bundle.getEntryPaths(String) but also returns paths
in attached fragment bundles. |
static java.util.LinkedHashSet<org.osgi.framework.Bundle> |
getWiredBundles(org.osgi.framework.Bundle bundle)
|
static java.util.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)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BundleUtils
public BundleUtils()
canStart
public static boolean canStart(org.osgi.framework.Bundle bundle)
canStop
public static boolean canStop(org.osgi.framework.Bundle bundle)
canUninstall
public static boolean canUninstall(org.osgi.framework.Bundle bundle)
isFragment
public static boolean isFragment(org.osgi.framework.Bundle bundle)
getContextBundle
public static org.osgi.framework.Bundle getContextBundle(boolean unwrap)
- Returns bundle (if any) associated with current thread's context classloader.
- Parameters:
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.
- Returns:
- The bundle associated with the current thread's context classloader. Might be null.
getEntryPaths
public static java.util.Enumeration<java.lang.String> getEntryPaths(org.osgi.framework.Bundle bundle,
java.lang.String name)
- Works like
Bundle.getEntryPaths(String)
but also returns paths
in attached fragment bundles.
- Parameters:
bundle
- name
-
- Returns:
getEntry
public static java.net.URL getEntry(org.osgi.framework.Bundle bundle,
java.lang.String name)
- Works like
Bundle.getEntry(String)
but also checks
attached fragment bundles for the given entry.
- Parameters:
bundle
- name
-
- Returns:
getWiredBundles
public static java.util.LinkedHashSet<org.osgi.framework.Bundle> getWiredBundles(org.osgi.framework.Bundle bundle)
getWiredBundles
public static java.util.LinkedHashSet<org.osgi.framework.Bundle> getWiredBundles(org.osgi.service.packageadmin.PackageAdmin packageAdmin,
org.osgi.framework.Bundle bundle)
Copyright © 2005-2011. All Rights Reserved.