You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by "rvesse (via GitHub)" <gi...@apache.org> on 2023/06/12 08:18:29 UTC

[GitHub] [jena-site] rvesse commented on a diff in pull request #159: Update Fuseki Module documentation

rvesse commented on code in PR #159:
URL: https://github.com/apache/jena-site/pull/159#discussion_r1226261227


##########
source/documentation/fuseki2/fuseki-modules.md:
##########
@@ -4,64 +4,107 @@ title: Fuseki Modules
 
 <em>Fuseki modules</em> are a mechanism to include extension code into a Fuseki
 server. Modules are invoked during the process of building a [Fuseki
-Main](./fuseki-main.html) server. The module can modify the server
+Main](./fuseki-main.html) server. A module can modify the server
 configuration, add new functionality, or react to a server being built and
 started.
 
-This feature was added in Jena version 4.3.0. They are an expeirmental feature
-that will evolve based on experineace and use cases.
+This feature was added in Jena version 4.3.0. It is an experimental feature
+that will evolve based on feedback and use cases.
 
-Fuseki Modules are loaded use the JDK
-[ServiceLoader](https://www.baeldung.com/java-spi) by being placing a jar file on the classpath,
-together with any additional dependencies. The service loader looks for files
-`META-INF/services/org.apache.jena.fuseki.main.sys.FusekiModule` in the jar
+The interface for modules is `FusekiModule`; if automatcally loaded, the
+interface is `FusekiModule` which extends `FusekiModule`.

Review Comment:
   ```suggestion
   interface is `FusekiAutoModule` which extends `FusekiModule`.
   ```



##########
source/documentation/fuseki2/fuseki-modules.md:
##########
@@ -4,64 +4,107 @@ title: Fuseki Modules
 
 <em>Fuseki modules</em> are a mechanism to include extension code into a Fuseki
 server. Modules are invoked during the process of building a [Fuseki
-Main](./fuseki-main.html) server. The module can modify the server
+Main](./fuseki-main.html) server. A module can modify the server
 configuration, add new functionality, or react to a server being built and
 started.
 
-This feature was added in Jena version 4.3.0. They are an expeirmental feature
-that will evolve based on experineace and use cases.
+This feature was added in Jena version 4.3.0. It is an experimental feature
+that will evolve based on feedback and use cases.
 
-Fuseki Modules are loaded use the JDK
-[ServiceLoader](https://www.baeldung.com/java-spi) by being placing a jar file on the classpath,
-together with any additional dependencies. The service loader looks for files
-`META-INF/services/org.apache.jena.fuseki.main.sys.FusekiModule` in the jar
+The interface for modules is `FusekiModule`; if automatcally loaded, the
+interface is `FusekiModule` which extends `FusekiModule`.
+
+Fuseki modules can be provided in two ways:
+
+* Loaded from additional jars on the classpath
+* Programmatically controlling the setup of the `FusekiServer` server.
+
+### Automatically loaded
+
+Fuseki Modules can be loaded using the JDK
+[ServiceLoader](https://www.baeldung.com/java-spi) by being placing
+a jar file on the classpath,
+together with any additional dependencies. These provide interface 
+`FusekiAutoModule`.
+The service loader is contreolled by file resources

Review Comment:
   ```suggestion
   The service loader is controlled by file resources
   ```



##########
source/documentation/fuseki2/fuseki-modules.md:
##########
@@ -4,64 +4,107 @@ title: Fuseki Modules
 
 <em>Fuseki modules</em> are a mechanism to include extension code into a Fuseki
 server. Modules are invoked during the process of building a [Fuseki
-Main](./fuseki-main.html) server. The module can modify the server
+Main](./fuseki-main.html) server. A module can modify the server
 configuration, add new functionality, or react to a server being built and
 started.
 
-This feature was added in Jena version 4.3.0. They are an expeirmental feature
-that will evolve based on experineace and use cases.
+This feature was added in Jena version 4.3.0. It is an experimental feature
+that will evolve based on feedback and use cases.
 
-Fuseki Modules are loaded use the JDK
-[ServiceLoader](https://www.baeldung.com/java-spi) by being placing a jar file on the classpath,
-together with any additional dependencies. The service loader looks for files
-`META-INF/services/org.apache.jena.fuseki.main.sys.FusekiModule` in the jar
+The interface for modules is `FusekiModule`; if automatcally loaded, the
+interface is `FusekiModule` which extends `FusekiModule`.
+
+Fuseki modules can be provided in two ways:
+
+* Loaded from additional jars on the classpath
+* Programmatically controlling the setup of the `FusekiServer` server.
+
+### Automatically loaded
+
+Fuseki Modules can be loaded using the JDK
+[ServiceLoader](https://www.baeldung.com/java-spi) by being placing
+a jar file on the classpath,
+together with any additional dependencies. These provide interface 
+`FusekiAutoModule`.
+The service loader is contreolled by file resources
+`META-INF/services/org.apache.jena.fuseki.main.sys.FusekiAutoModule` in the jar
 file.
+The module class must have a no-argument constructor.
+
 This is often done by placing the file in the development code in
 `src/main/resources/META-INF/services/`).
 The file containing a line with the implementation full class name. If
 [repacking](../notes/jena-repack.html) Fuseki with the maven-shade-plugin, make
-sure the `ServicesResourceTransformer` is used. The module must have a no
-argument constructor.
+sure the `ServicesResourceTransformer` is used. 
 
-If using Fuseki as an [embedded server](./fuseki-embedded.html), the module is
-added in code as:
+The method `start` is called when the module is loaded. Custom operations can
+be globally registered at this point (see the [Fuseki
+examples](https://github.com/apache/jena/tree/main/jena-fuseki2/jena-fuseki-main/src/test/java/org/apache/jena/fuseki/main/examples) directory).
+
+A `FusekiAutoModule` can provide a level, an integer, to control the order in which
+modules are invoked during server building. Lower numbers are invoked before larger
+numbers at each step.
+
+### Programmaticaly configuring a server
+
+If creating a Fuseki server from Java, the modules can be autoloaded as descriobed above,

Review Comment:
   ```suggestion
   If creating a Fuseki server from Java, the modules can be autoloaded as described above,
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@jena.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org