Skip to content

Commit

Permalink
Tidy Fuseki init and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
afs committed Jul 12, 2024
1 parent 48c6e5b commit 2ec5a0c
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,6 @@ public static boolean getVerbose(ServletContext cxt) {
// HTTP response header inserted to aid tracking.
public static String FusekiRequestIdHeader = "Fuseki-Request-Id";

private static boolean initialized = false;

// Server start time and uptime.
private static final long startMillis = System.currentTimeMillis();
// Hide server locale
Expand All @@ -228,12 +226,14 @@ public static String serverStartedAt() {
return startDateTime;
}

private static boolean initialized = false;
/**
* Initialize an instance of the Fuseki server stack.
* This is not done via Jena's initialization mechanism
* but done explicitly to give more control.
* Touching this class causes this to happen
* (see static block at the end of this class).
* It is done after Jena initializes.
* Fuseki-main adds a Fuseki specific custom initialization
* round after this is run.
*/
public synchronized static void init() {
if ( initialized )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@ public class FusekiConfig {
Operation.GSP_RW,
Operation.Patch);

static { Fuseki.init(); }

/** Convenience operation to populate a {@link DataService} with the conventional default services. */
public static DataService.Builder populateStdServices(DataService.Builder dataServiceBuilder, boolean allowUpdate) {
Set<Endpoint> endpoints = new HashSet<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,13 @@ public static Collection<String> names(FusekiServer server) {
/**
* Process a configuration mode to find the DataServices and reset the server
* {@link DataAccessPointRegistry}. The only server-level setting processed is
* the {@code fuseki:services} list. Other settings are ignored.
* the {@code fuseki:services} list; other settings are ignored.
*/
public static void reload(FusekiServer server, Model configuration) {
// See also FusekiServer.applyDatabaseSetup
// prepareDataServices(dapRegistry, operationReg);
// OperationRegistry.set(servletContext, operationReg);
// DataAccessPointRegistry.set(servletContext, dapRegistry);
DataAccessPointRegistry newRegistry = new DataAccessPointRegistry();
OperationRegistry operationRegistry = server.getOperationRegistry();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,10 @@
*/

public class FusekiServer {
static { JenaSystem.init(); }
static {
JenaSystem.init();
Fuseki.init();
}

/**
* Construct a Fuseki server from command line arguments.
Expand Down Expand Up @@ -1370,7 +1373,6 @@ public FusekiServer build() {
boolean hasFusekiSecurityHandler = applySecurityHandler(handler);
// Prepare the DataAccessPointRegistry.
// Put it in the servlet context.
// This would be the reload operation.
applyDatabaseSetup(handler.getServletContext(), dapRegistry, operationReg);

// Must be after the DataAccessPointRegistry is in the servlet context.
Expand Down Expand Up @@ -1464,8 +1466,8 @@ private static void applyDatabaseSetup(ServletContext servletContext,
DataAccessPointRegistry dapRegistry,
OperationRegistry operationReg) {
// Final wiring up of DataAccessPointRegistry
// See also FusekiLib.reload()
prepareDataServices(dapRegistry, operationReg);

OperationRegistry.set(servletContext, operationReg);
DataAccessPointRegistry.set(servletContext, dapRegistry);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ public static FusekiServer.Builder builder(String... args) {

static void run(String... argv) {
JenaSystem.init();
Fuseki.init();
new FusekiMain(argv).mainRun();
}

Expand Down

0 comments on commit 2ec5a0c

Please sign in to comment.