Class EquinoxLauncher


  • public class EquinoxLauncher
    extends Object
    Given a directory containing osgi jars, this class verifies that the core bundles are available, and provides an API for instantiating the OSGi runtime and accessing its BundleContext. See setProps(Map) for precise details on the default framework properties.
    • Constructor Detail

      • EquinoxLauncher

        public EquinoxLauncher​(File installationRoot)
        Wraps a directory of jars in the launcher API, and ensures the the directory contains the plugins required to run a barebones equinox instance.
    • Method Detail

      • setArgs

        public EquinoxLauncher setArgs​(List<String> args)
        Sets the application arguments which will be passed to the runtime.
      • setProps

        public EquinoxLauncher setProps​(Map<String,​String> props)
        Sets the system properties which will be set on the runtime. Available options [here](https://help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fmisc%2Fruntime-options.html). This should usually not need to be set. Below are the default properties. To unset one of the defaults, set its value to the empty string and it will be cleared. ```java map.put("osgi.framework.useSystemProperties", "false"); map.put("osgi.install.area", ); map.put("osgi.noShutdown", "false"); map.put(EclipseStarter.PROP_FRAMEWORK, <path to plugin "org.eclipse.osgi">); ``` And, if `bundleDiscoveryAuto` is true, then: ```java map.put("equinox.use.ds", "true"); map.put("osgi.bundles", Joiner.on(", ").join( // automatic bundle discovery and installation "org.eclipse.equinox.common@2:start", "org.eclipse.update.configurator@3:start", // support eclipse's -application argument "org.eclipse.core.runtime@4:start", // declarative services "org.eclipse.equinox.ds@5:start")); ```
      • run

        public void run()
                 throws Exception
        Runs the equinox launcher (calls open() and immediately closes it).
        Throws:
        Exception