From ead84cb636bf30fcb77493c0ad13c936ce8302e3 Mon Sep 17 00:00:00 2001 From: Richard Eckart de Castilho Date: Fri, 29 Nov 2024 18:36:21 +0100 Subject: [PATCH] Issue #177: Consider resource manager when loading type descriptions - Rename SPI class - Add SPI discovery file to META-INF/services (only with the 3.6.0 SPI interface, not with the legacy interfaces) --- ruta-core/pom.xml | 6 ++---- ...DescriptionProvider.java => RutaTypeSystemProvider.java} | 4 ++-- .../services/org.apache.uima.spi.TypeSystemProvider | 1 + 3 files changed, 5 insertions(+), 6 deletions(-) rename ruta-core/src/main/java/org/apache/uima/ruta/type/spi/{RutaTypeSystemDescriptionProvider.java => RutaTypeSystemProvider.java} (91%) create mode 100644 ruta-core/src/main/resources/META-INF/services/org.apache.uima.spi.TypeSystemProvider diff --git a/ruta-core/pom.xml b/ruta-core/pom.xml index 46e9fd02..be3cdc55 100644 --- a/ruta-core/pom.xml +++ b/ruta-core/pom.xml @@ -171,8 +171,7 @@ src/main/resources/META-INF/org.apache.uima.fit/*.txt input/** TypeSystem.xml - src/main/resources/META-INF/services/org.apache.uima.spi.JCasClassProvider - src/main/resources/META-INF/services/org.apache.uima.spi.TypeSystemDescriptionProvider + src/main/resources/META-INF/services/org.apache.uima.spi.TypeSystemProvider @@ -243,8 +242,7 @@ osgi.extender;filter:="(osgi.extender=osgi.serviceloader.registrar)";resolution:=optional - osgi.serviceloader;osgi.serviceloader=org.apache.uima.spi.TypeSystemDescriptionProvider, - osgi.serviceloader;osgi.serviceloader=org.apache.uima.spi.JCasClassProvider + osgi.serviceloader;osgi.serviceloader=org.apache.uima.spi.TypeSystemProvider diff --git a/ruta-core/src/main/java/org/apache/uima/ruta/type/spi/RutaTypeSystemDescriptionProvider.java b/ruta-core/src/main/java/org/apache/uima/ruta/type/spi/RutaTypeSystemProvider.java similarity index 91% rename from ruta-core/src/main/java/org/apache/uima/ruta/type/spi/RutaTypeSystemDescriptionProvider.java rename to ruta-core/src/main/java/org/apache/uima/ruta/type/spi/RutaTypeSystemProvider.java index 377a04a4..68e47cac 100644 --- a/ruta-core/src/main/java/org/apache/uima/ruta/type/spi/RutaTypeSystemDescriptionProvider.java +++ b/ruta-core/src/main/java/org/apache/uima/ruta/type/spi/RutaTypeSystemProvider.java @@ -20,9 +20,9 @@ import org.apache.uima.spi.TypeSystemProvider_ImplBase; -public class RutaTypeSystemDescriptionProvider extends TypeSystemProvider_ImplBase { +public class RutaTypeSystemProvider extends TypeSystemProvider_ImplBase { - public RutaTypeSystemDescriptionProvider() { + public RutaTypeSystemProvider() { setTypeSystemLocations( // "/org/apache/uima/ruta/engine/BasicTypeSystem.xml", // "/org/apache/uima/ruta/engine/DefaultSeederTypeSystem.xml", // diff --git a/ruta-core/src/main/resources/META-INF/services/org.apache.uima.spi.TypeSystemProvider b/ruta-core/src/main/resources/META-INF/services/org.apache.uima.spi.TypeSystemProvider new file mode 100644 index 00000000..9574e352 --- /dev/null +++ b/ruta-core/src/main/resources/META-INF/services/org.apache.uima.spi.TypeSystemProvider @@ -0,0 +1 @@ +org.apache.uima.ruta.type.spi.RutaTypeSystemProvider