diff --git a/jena/src/main/resources/META-INF/services/org.apache.jena.sys.JenaSubsystemLifecycle b/jena/src/main/resources/META-INF/services/org.apache.jena.sys.JenaSubsystemLifecycle new file mode 100644 index 00000000..de01b4e3 --- /dev/null +++ b/jena/src/main/resources/META-INF/services/org.apache.jena.sys.JenaSubsystemLifecycle @@ -0,0 +1 @@ +eu.ostrzyciel.jelly.convert.jena.riot.JellySubsystemLifecycle diff --git a/jena/src/main/scala/eu/ostrzyciel/jelly/convert/jena/riot/JellyLanguage.scala b/jena/src/main/scala/eu/ostrzyciel/jelly/convert/jena/riot/JellyLanguage.scala index df6bd32e..60290e51 100644 --- a/jena/src/main/scala/eu/ostrzyciel/jelly/convert/jena/riot/JellyLanguage.scala +++ b/jena/src/main/scala/eu/ostrzyciel/jelly/convert/jena/riot/JellyLanguage.scala @@ -20,7 +20,8 @@ object JellyLanguage: /** * Register the Jelly language and formats in Jena. * - * This method is idempotent and should be called automatically when the class is loaded. + * This method is idempotent and should be called automatically when Jena is initialized. + * See: https://jena.apache.org/documentation/notes/system-initialization.html * However, you may also want to call this manually if Jena doesn't load the language automatically. */ def register(): Unit = this.synchronized { diff --git a/jena/src/main/scala/eu/ostrzyciel/jelly/convert/jena/riot/JellySubsystemLifecycle.scala b/jena/src/main/scala/eu/ostrzyciel/jelly/convert/jena/riot/JellySubsystemLifecycle.scala new file mode 100644 index 00000000..5deecbd1 --- /dev/null +++ b/jena/src/main/scala/eu/ostrzyciel/jelly/convert/jena/riot/JellySubsystemLifecycle.scala @@ -0,0 +1,17 @@ +package eu.ostrzyciel.jelly.convert.jena.riot + +import org.apache.jena.sys.JenaSubsystemLifecycle + +/** + * Subsystem lifecycle for registering the Jelly language in Jena. + * See: https://jena.apache.org/documentation/notes/system-initialization.html + */ +class JellySubsystemLifecycle extends JenaSubsystemLifecycle: + override def start(): Unit = JellyLanguage.register() + + override def stop(): Unit = () + + // "Application code should use level above 500." + // Not clear whether the plugins should use > 500 or < 500... + // Let's use 501, this should make Jelly load before the other application subsystems. + override def level() = 501