public abstract class OsgiBundleUtils extends Object
Bundle
s. Provides convenience methods for
interacting with a Bundle object.OsgiStringUtils
Constructor and Description |
---|
OsgiBundleUtils() |
Modifier and Type | Method and Description |
---|---|
static org.osgi.framework.Bundle |
findBundleBySymbolicName(org.osgi.framework.BundleContext bundleContext,
String symbolicName)
Finds an install bundle based by its symbolic name.
|
static org.osgi.framework.BundleContext |
getBundleContext(org.osgi.framework.Bundle bundle)
Returns the underlying BundleContext for the given Bundle.
|
static org.osgi.framework.Version |
getBundleVersion(org.osgi.framework.Bundle bundle)
Returns the given bundle version.
|
static org.osgi.framework.Version |
getHeaderAsVersion(org.osgi.framework.Bundle bundle,
String header)
Returns the version for a given bundle manifest header.
|
static boolean |
isBundleActive(org.osgi.framework.Bundle bundle)
Indicates if the given bundle is active or not.
|
static boolean |
isBundleLazyActivated(org.osgi.framework.Bundle bundle)
Indicates if the given bundle is lazily activated or not.
|
static boolean |
isBundleResolved(org.osgi.framework.Bundle bundle)
Indicates if the given bundle is resolved or not.
|
static boolean |
isFragment(org.osgi.framework.Bundle bundle)
Indicates if the given bundle is a fragment or not.
|
static boolean |
isSystemBundle(org.osgi.framework.Bundle bundle)
Indicates if the given bundle is the system bundle or not.
|
public static org.osgi.framework.BundleContext getBundleContext(org.osgi.framework.Bundle bundle)
bundle
- OSGi bundlepublic static boolean isBundleActive(org.osgi.framework.Bundle bundle)
bundle
- OSGi bundleBundle.ACTIVE
public static boolean isBundleResolved(org.osgi.framework.Bundle bundle)
bundle
- OSGi bundleBundle.RESOLVED
public static boolean isBundleLazyActivated(org.osgi.framework.Bundle bundle)
bundle
- OSGi bundlepublic static boolean isFragment(org.osgi.framework.Bundle bundle)
bundle
- OSGi bundleConstants.FRAGMENT_HOST
public static boolean isSystemBundle(org.osgi.framework.Bundle bundle)
bundle
- OSGi bundlepublic static org.osgi.framework.Version getBundleVersion(org.osgi.framework.Bundle bundle)
bundle
- OSGi bundleConstants.BUNDLE_VERSION
public static org.osgi.framework.Bundle findBundleBySymbolicName(org.osgi.framework.BundleContext bundleContext, String symbolicName)
bundleContext
- OSGi bundle contextsymbolicName
- bundle symbolic namenull
if none is
found)public static org.osgi.framework.Version getHeaderAsVersion(org.osgi.framework.Bundle bundle, String header)
bundle
- OSGi bundleheader
- bundle manifest headerCopyright © 2006–2018. All rights reserved.