public final class BundleInstaller extends Object
This is a utility class to help with installing, starting, stopping and uninstalling OSGi Bundles. You can choose
to inject an instance of this class, or it can be created explicitly by reference to a OsgiFramework
.
Please see commentary on OsgiFramework.installBundle(String)
for a description of exception-safety issues
to consider when installing bundles that use the OsgiHeader.PREINSTALL_BUNDLE
manifest instruction.
Modifier and Type | Field and Description |
---|---|
private OsgiFramework |
osgiFramework |
Constructor and Description |
---|
BundleInstaller(OsgiFramework osgiFramework) |
Modifier and Type | Method and Description |
---|---|
List<org.osgi.framework.Bundle> |
installAndStart(Iterable<String> locations) |
List<org.osgi.framework.Bundle> |
installAndStart(String... locations) |
private void |
start(org.osgi.framework.Bundle bundle) |
private void |
stop(org.osgi.framework.Bundle bundle) |
void |
stopAndUninstall(org.osgi.framework.Bundle... bundles) |
void |
stopAndUninstall(Iterable<org.osgi.framework.Bundle> bundles) |
private final OsgiFramework osgiFramework
@Inject public BundleInstaller(OsgiFramework osgiFramework)
public List<org.osgi.framework.Bundle> installAndStart(String... locations) throws org.osgi.framework.BundleException
org.osgi.framework.BundleException
public List<org.osgi.framework.Bundle> installAndStart(Iterable<String> locations) throws org.osgi.framework.BundleException
org.osgi.framework.BundleException
public void stopAndUninstall(org.osgi.framework.Bundle... bundles) throws org.osgi.framework.BundleException
org.osgi.framework.BundleException
public void stopAndUninstall(Iterable<org.osgi.framework.Bundle> bundles) throws org.osgi.framework.BundleException
org.osgi.framework.BundleException
private void start(org.osgi.framework.Bundle bundle) throws org.osgi.framework.BundleException
org.osgi.framework.BundleException
private void stop(org.osgi.framework.Bundle bundle) throws org.osgi.framework.BundleException
org.osgi.framework.BundleException
Copyright © 2018. All rights reserved.