Class EquinoxLauncher
- java.lang.Object
-
- com.diffplug.gradle.eclipserunner.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 itsBundleContext
. SeesetProps(Map)
for precise details on the default framework properties.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
EquinoxLauncher.Running
Represents a running instance of the equinox OSGi container.
-
Constructor Summary
Constructors Constructor Description 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 Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EquinoxLauncher.Running
open()
Opens the eclipse runtime, and returns an instance ofEquinoxLauncher.Running
which allows access to the underlyingBundleContext
.void
run()
Runs the equinox launcher (callsopen()
and immediately closes it).EquinoxLauncher
setArgs(List<String> args)
Sets the application arguments which will be passed to the runtime.EquinoxLauncher
setProps(Map<String,String> props)
Sets the system properties which will be set on the runtime.
-
-
-
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")); ```
-
open
public EquinoxLauncher.Running open() throws Exception
Opens the eclipse runtime, and returns an instance ofEquinoxLauncher.Running
which allows access to the underlyingBundleContext
.- Throws:
Exception
-
-