public final class BundleLifecycleUtils extends Object
| Constructor and Description |
|---|
BundleLifecycleUtils() |
| Modifier and Type | Method and Description |
|---|---|
static int |
getBundleStartLevel(org.osgi.framework.Bundle bundle)
Returns the start level of the provided bundle.
|
static int |
getFrameworkStartLevel()
Returns the start level of the OSGi framework.
|
static org.osgi.framework.wiring.FrameworkWiring |
getFrameworkWiring()
Obtains the
FrameworkWiring. |
static Set<org.osgi.framework.Bundle> |
getHostsFragment(org.osgi.framework.Bundle fragment)
Collect a set of hosts bundles for a fragment
|
static void |
refreshBundle(org.osgi.framework.Bundle bundle)
Refreshes the specified bundle and its "dependencies".
|
static void |
refreshBundles(Collection<org.osgi.framework.Bundle> bundlesToRefresh,
boolean considerFragments,
boolean considerBundlesWithOptionalPackages)
Refreshes the specified bundles and optionally their "dependencies".
|
static boolean |
resolveBundle(org.osgi.framework.Bundle bundle)
Resolves the specified bundle.
|
static boolean |
resolveBundles(Collection<org.osgi.framework.Bundle> bundlesToResolve)
Resolves the specified bundles.
|
static void |
startBundlesPendingDependencies()
Tries to start all the bundles which somehow got stopped mainly due to a missing dependencies.
|
static void |
startModules(List<org.osgi.framework.Bundle> moduleBundles,
boolean useModuleManagerApi)
Start the specified module bundles in the order which tries to consider the dependencies between them.
|
static void |
updateBundle(org.osgi.framework.Bundle bundle)
Will update the bundle, calling stop/start on it.
|
public static Set<org.osgi.framework.Bundle> getHostsFragment(org.osgi.framework.Bundle fragment)
fragment - is the fragment to collect hosts bundles forpublic static int getBundleStartLevel(org.osgi.framework.Bundle bundle)
bundle - the bundle to get start level forpublic static int getFrameworkStartLevel()
public static org.osgi.framework.wiring.FrameworkWiring getFrameworkWiring()
FrameworkWiring.FrameworkWiringpublic static void refreshBundle(org.osgi.framework.Bundle bundle)
bundle - the bundle to refreshpublic static void refreshBundles(Collection<org.osgi.framework.Bundle> bundlesToRefresh, boolean considerFragments, boolean considerBundlesWithOptionalPackages)
bundlesToRefresh - the bundles to refreshconsiderFragments - should we also refresh the related fragment bundles?considerBundlesWithOptionalPackages - should we consider bundles with optional package dependencies?public static boolean resolveBundle(org.osgi.framework.Bundle bundle)
bundle - the bundle to be resolvedtrue if the specified bundle is resolved; false otherwise.public static boolean resolveBundles(Collection<org.osgi.framework.Bundle> bundlesToResolve)
bundlesToResolve - the bundles to resolve or null to resolve all unresolved bundles installed in the Frameworktrue if all specified bundles are resolved; false
otherwise.public static void startBundlesPendingDependencies()
public static void startModules(List<org.osgi.framework.Bundle> moduleBundles, boolean useModuleManagerApi)
moduleBundles - the bundles to be starteduseModuleManagerApi - should we use ModuleManager or call OSGi API directly?public static void updateBundle(org.osgi.framework.Bundle bundle)
throws org.osgi.framework.BundleException
bundle - the bundle to updateorg.osgi.framework.BundleExceptionCopyright © 2004–2020 Jahia Solutions Group SA. All rights reserved.