-
Notifications
You must be signed in to change notification settings - Fork 12
EclipseCollections
NatTable internally uses Eclipse Collections Primitive Collections to reduce the memory footprint and improve the performance. A more detailed explanation can be found in NatTable + Eclipse Collections = Performance & Memory improvements ?
The minimum required version of Eclipse Collections is 11.1.0.
Eclipse Collections are separated into two jars:
- eclipse-collections-api
- eclipse-collections
Internally Eclipse Collections are using the Java ServiceLoader API. This means the API JAR uses Services that are provided by the implementation JAR. The ServiceLoader API by default only works if consumer and provider are using the same classloader. Therefore it did not work in an OSGi context before Eclipse Collections 12.0.0. Since version 12.0.0 the support for using the OSGi Service Loader Mediator was added via [OSGi] Opting in to Service Loader Mediator.
This change has an impact on creating a runtime that contains NatTable. Since NatTable 2.6.0, the NatTable update site does not contain the dependencies itself anymore. Instead it contains links to the repositories that were used to create the release. By doing this the NatTable update site got much smaller, and consumers do not consume unwanted dependencies by accident anymore.
Although PDE should be able to resolve the Eclipse Collections dependency automatically via references, there might be issues if it is not declared explicitly in the target definition. It is therefore recommended to add the Eclipse Collections dependency explicitly.
You have the following options:
- Eclipse Collections 11.1.0
Requires minimum Java 8 and is compatible with Java 8+- Use the Eclipse Collections Update Site to retrieve the single JAR (API and Implementation combined) https://download.eclipse.org/collections/11.1.0/repository
- Eclipse Collections 12.0.0
Requires minimum Java 11 and is compatible with Java 11+- Use the Eclipse Orbit Update Site to retrieve API and Implementation bundles https://download.eclipse.org/tools/orbit/simrel/orbit-aggregation/nightly/latest/
- Consume the artifacts via Maven Dependency
- Eclipse Collections 13.0.0
Requires minimum Java 17 and is compatible with Java 17+- Use the Eclipse Orbit Update Site to retrieve API and Implementation bundles https://download.eclipse.org/tools/orbit/simrel/orbit-aggregation/nightly/latest/
- Consume the artifacts via Maven Dependency
Since Eclipse Collections 12.0.0 the API and the implementation bundle can be consumed separately in an OSGi environment, as these bundles are prepared for the OSGi Service Loader Mediator. But that means that it needs to be part of the runtime and automatically started in order to make Eclipse Collections work in an OSGi environment. This can be done by adding Apache SPI Fly to the runtime and autostart it.
The NatTable Target Platform Defintion is an example on how a update site that consumes Eclipse Collections and Apache SPI Fly could look like.
The NatTable Example Eclipse 4 Product Definition shows how that configuration needs to look like for an Eclipse application.