Class BundleInstaller


  • public final class BundleInstaller
    extends java.lang.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.

    Author:
    Simon Thoresen Hult
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<org.osgi.framework.Bundle> installAndStart​(java.lang.Iterable<java.lang.String> locations)  
      java.util.List<org.osgi.framework.Bundle> installAndStart​(java.lang.String... locations)  
      void stopAndUninstall​(java.lang.Iterable<org.osgi.framework.Bundle> bundles)  
      void stopAndUninstall​(org.osgi.framework.Bundle... bundles)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BundleInstaller

        @Inject
        public BundleInstaller​(OsgiFramework osgiFramework)
    • Method Detail

      • installAndStart

        public java.util.List<org.osgi.framework.Bundle> installAndStart​(java.lang.String... locations)
                                                                  throws org.osgi.framework.BundleException
        Throws:
        org.osgi.framework.BundleException
      • installAndStart

        public java.util.List<org.osgi.framework.Bundle> installAndStart​(java.lang.Iterable<java.lang.String> locations)
                                                                  throws org.osgi.framework.BundleException
        Throws:
        org.osgi.framework.BundleException
      • stopAndUninstall

        public void stopAndUninstall​(org.osgi.framework.Bundle... bundles)
                              throws org.osgi.framework.BundleException
        Throws:
        org.osgi.framework.BundleException
      • stopAndUninstall

        public void stopAndUninstall​(java.lang.Iterable<org.osgi.framework.Bundle> bundles)
                              throws org.osgi.framework.BundleException
        Throws:
        org.osgi.framework.BundleException