Class EquinoxLauncher
java.lang.Object
com.diffplug.gradle.eclipserunner.EquinoxLauncher
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.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassRepresents a running instance of the equinox OSGi container. -
Constructor Summary
ConstructorsConstructorDescriptionEquinoxLauncher(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 Summary
Modifier and TypeMethodDescriptionopen()Opens the eclipse runtime, and returns an instance ofEquinoxLauncher.Runningwhich allows access to the underlyingBundleContext.voidrun()Runs the equinox launcher (callsopen()and immediately closes it).Sets the application arguments which will be passed to the runtime.Sets the system properties which will be set on the runtime.
-
Constructor Details
-
EquinoxLauncher
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 Details
-
setArgs
Sets the application arguments which will be passed to the runtime. -
setProps
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")); ``` -
open
Opens the eclipse runtime, and returns an instance ofEquinoxLauncher.Runningwhich allows access to the underlyingBundleContext.- Throws:
Exception
-
run
Runs the equinox launcher (callsopen()and immediately closes it).- Throws:
Exception
-