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

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

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


##########
source/documentation/fuseki2/fuseki-modules.md:
##########
@@ -4,53 +4,80 @@ 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
+This feature was added in Jena version 4.3.0. It is an expeirmental feature
 that will evolve based on experineace 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,
+FusekiModules 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 use the JDK

Review Comment:
   s/use/using ?



##########
source/documentation/fuseki2/fuseki-modules.md:
##########
@@ -4,53 +4,80 @@ 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
+This feature was added in Jena version 4.3.0. It is an expeirmental feature

Review Comment:
   s/expeirmental/experimental



##########
source/documentation/fuseki2/fuseki-modules.md:
##########
@@ -4,53 +4,80 @@ 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
+This feature was added in Jena version 4.3.0. It is an expeirmental feature
 that will evolve based on experineace 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,
+FusekiModules 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 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
 file.
+
 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.
 
+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).
+
+### Programmaticaly configuring a server
+
 If using Fuseki as an [embedded server](./fuseki-embedded.html), the module is
 added in code as:
 
 ```
-    FusekiModule module = new MyModule();
-    FusekiModules.add(module);
+    FusekiModule myModule = new MyModule();
+    FusekiModules fmods = FusekiModules.create(myModule);
+    FusekiServer server = FusekiServer.create()
+        ...
+        .fusekiModules(fmods)
+        ...
+        .build();  
 ```
 
-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).
+`FusekiModule.start()` is not automatically called.
+
+### Fuseki Module operations
 
 The module lifecycle during creating a Fuseki server is:
 
-* `configuration` - access and modify the setup. 
-  This is called after the server has been configured, just before the server is built.
-* `server` - access the built server
-* `serverBeforeStarting` - about to call "server.start()"
-* `serverAfterStarting` - just after calling "server.start()"
-* `serverStopped` - called as the server stop 
+* `prepare` - called at the start of the server
+   build steps before setting up the datasets.
+* `configured` - access and modify the setup. 
+   This is called after the server has been configured, before the server is built.
+   It defaults to calls to `configDataAccessPoint` for dataset being hosted by the server.
+* `server` - called after the built, beforee the return of `FusekiServerBuilder.build()`

Review Comment:
   s/beforee/before



-- 
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