- All Superinterfaces:
FusekiActionCycle,FusekiBuildCycle,FusekiServerArgsHandler,FusekiStartStop
- All Known Subinterfaces:
FusekiAutoModule
- All Known Implementing Classes:
FMod_Admin,FMod_BLANK,FMod_Compact,FMod_GraphAccessCtl,FMod_Ping,FMod_Prometheus,FMod_Shiro,FMod_Stats,FMod_Tasks,FMod_UI
A module is additional code and it can be part of the application code. Calls are made to each module at certain points in the lifecycle of a Fuseki server.
A module must provide a no-argument constructor if it is to be loaded automatically.
See FusekiAutoModule.
When a server is being built FusekiBuildCycle:
- prepare(org.apache.jena.fuseki.main.FusekiServer.Builder, java.util.Set<java.lang.String>, org.apache.jena.rdf.model.Model)
-- called at the beginning of the
FusekiServer.Builder build()step. This call can manipulate the server configuration. This is the usual operation for customizing a server. - configured(org.apache.jena.fuseki.main.FusekiServer.Builder, org.apache.jena.fuseki.server.DataAccessPointRegistry, org.apache.jena.rdf.model.Model) – called after the DataAccessPoint registry has been built.
- server(FusekiServer) – called at the end of the "build" step before
FusekiServer.Builder build()returns.
FusekiStartStop:
- serverBeforeStarting(FusekiServer) – called before
server.starthappens. - serverAfterStarting(FusekiServer) – called after
server.starthappens. - serverStopped(FusekiServer) – call after
server.stop, but only if a clean shutdown happens. N.B. Servers may simply exit without a shutdown phase. The JVM may exit or be killed without clean shutdown. Modules must not rely on a call toserverStoppedhappening.
FusekiServerArgsHandler:
-
serverArgsModify(org.apache.jena.cmd.CmdGeneral, org.apache.jena.fuseki.main.runner.ServerArgs)– called before command line processing. This call can register or modify the argument setup to be used to parse the command line. -
serverArgsPrepare(org.apache.jena.cmd.CmdGeneral, org.apache.jena.fuseki.main.runner.ServerArgs)– called after parsing the command line and recording the command line settings inServerArgs. Argument handlers can record their own argument values and flags. -
serverArgsBuilder(org.apache.jena.fuseki.main.FusekiServer.Builder, org.apache.jena.rdf.model.Model)– called after theServerArgshave been used to construct a server builder.
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidconfigDataAccessPoint(org.apache.jena.fuseki.server.DataAccessPoint dap, org.apache.jena.rdf.model.Model configModel) This method is called for eachDataAccessPointby the default implementation ofFusekiBuildCycle.configured(org.apache.jena.fuseki.main.FusekiServer.Builder, org.apache.jena.fuseki.server.DataAccessPointRegistry, org.apache.jena.rdf.model.Model)after the new server'sDataAccessPointRegistryhas been built.default voidconfigured(FusekiServer.Builder serverBuilder, org.apache.jena.fuseki.server.DataAccessPointRegistry dapRegistry, org.apache.jena.rdf.model.Model configModel) Called after theDataAccessPointRegistryhas been built.default Stringname()A display name to identify this module.default voidprepare(FusekiServer.Builder serverBuilder, Set<String> datasetNames, org.apache.jena.rdf.model.Model configModel) Called at the start of "build" step.default voidserver(FusekiServer server) Called when the server is built at the point where it is returned from theFuseki server builder.default voidserverAfterStarting(FusekiServer server) Server started - called just after server.start happens, and before server .start() returns to the application.default voidserverArgsBuilder(FusekiServer.Builder serverBuilder, org.apache.jena.rdf.model.Model configModel) Called at the end of applying theServerArgsto the builder.default voidserverArgsModify(org.apache.jena.cmd.CmdGeneral fusekiCmd, ServerArgs serverArgs) Called after the standard Fuseki main arguments have been added and before argument processing of the command line.default voidserverArgsPrepare(org.apache.jena.cmd.CmdGeneral fusekiCmd, ServerArgs serverArgs) Called at the end command line argument processing.default voidserverBeforeStarting(FusekiServer server) Server starting - called just before server.start happens.default booleanserverConfirmReload(FusekiServer server) Confirm or reject a request to reload.default voidserverReload(FusekiServer server) A running server has been asked to reload its configuration.default voidserverStopped(FusekiServer server) Server stopping.
-
Method Details
-
name
A display name to identify this module. The name defaults to the class simple name. -
serverArgsModify
Called after the standard Fuseki main arguments have been added and before argument processing of the command line. This allows a Fuseki module to add custom arguments viaCmdLineArgs.addArg(String, String)andCmdGeneral.addModule(org.apache.jena.cmd.ArgModuleGeneral).This method can throw
CmdExceptionto indicate errors. This will cause a error message to be printed, without the stack trace. The server construction is aborted.- Specified by:
serverArgsModifyin interfaceFusekiServerArgsHandler- Parameters:
fusekiCmd- Fuseki Main command line argumentsserverArgs- Initial setting before command line processing.
-
serverArgsPrepare
Called at the end command line argument processing.This allows a Fuseki module to pull out custom arguments it has added and process them appropriately, including validating or modifying the
ServerArgsthat will be used to build the server. This method can set the set the dataset, in which case a command line dataset setup or configuration file server set up is not performed.This method can throw
CmdExceptionto indicate errors. This will cause a error message to be printed, without the stack trace. The server construction is aborted.- Specified by:
serverArgsPreparein interfaceFusekiServerArgsHandler- Parameters:
fusekiCmd- Fuseki MainserverArgs- Standard server argument settings, before building the server.
-
serverArgsBuilder
default void serverArgsBuilder(FusekiServer.Builder serverBuilder, org.apache.jena.rdf.model.Model configModel) Called at the end of applying theServerArgsto the builder.This step can do validation and argument processing dependent on the configuration model.
If there is a configuration model, this has been processed by the builder
If a command line dataset setup is being used, this is the dataset has been created.
This method can throw
CmdExceptionto indicate errors. This will cause a error message to be printed, without the stack trace. The server construction is aborted.- Specified by:
serverArgsBuilderin interfaceFusekiServerArgsHandler- Parameters:
serverBuilder- The server builder.configModel- The configuration model; this may be null.
-
prepare
default void prepare(FusekiServer.Builder serverBuilder, Set<String> datasetNames, org.apache.jena.rdf.model.Model configModel) Called at the start of "build" step. The builder has been set according to the configuration of API calls and parsing configuration files. No build actions have been carried out yet. The module can make further FusekiServer.FusekiServer.Buildercalls. The "configModel" parameter is set if a configuration file was used otherwise it is null.This is the main point for customization of server.
It can add and modify the data services being built, and also add servlets and servlet filters.
- Specified by:
preparein interfaceFusekiBuildCycle- Parameters:
serverBuilder- The FusekiServer.BuilderdatasetNames- The names of DataServices configured by API calls and configuration file.configModel-
-
configured
default void configured(FusekiServer.Builder serverBuilder, org.apache.jena.fuseki.server.DataAccessPointRegistry dapRegistry, org.apache.jena.rdf.model.Model configModel) Called after theDataAccessPointRegistryhas been built.The default implementation is to call
FusekiBuildCycle.configDataAccessPoint(DataAccessPoint, Model)for eachDataAccessPoint.dapRegistry.accessPoints().forEach(accessPoint->configDataAccessPoint(accessPoint, configModel));- Specified by:
configuredin interfaceFusekiBuildCycle
-
configDataAccessPoint
default void configDataAccessPoint(org.apache.jena.fuseki.server.DataAccessPoint dap, org.apache.jena.rdf.model.Model configModel) This method is called for eachDataAccessPointby the default implementation ofFusekiBuildCycle.configured(org.apache.jena.fuseki.main.FusekiServer.Builder, org.apache.jena.fuseki.server.DataAccessPointRegistry, org.apache.jena.rdf.model.Model)after the new server'sDataAccessPointRegistryhas been built.- Specified by:
configDataAccessPointin interfaceFusekiBuildCycle
-
server
Called when the server is built at the point where it is returned from theFuseki server builder. The server has not yet been started.- Specified by:
serverin interfaceFusekiBuildCycle
-
serverConfirmReload
Confirm or reject a request to reload.Not all servers or server modules may be able to reload. This is reload of a live server that continued to execute while reload happens and which completes all outstanding requests at the time of the reload request.
Return true if reload is possible. If all modules return true the reload continues and
FusekiBuildCycle.serverReload(org.apache.jena.fuseki.main.FusekiServer)will be called. If any module returns false, the reload is not performed.- Specified by:
serverConfirmReloadin interfaceFusekiBuildCycle
-
serverReload
A running server has been asked to reload its configuration.Certain server feature will not change.
- http and https connectiosn are preserved.
- Port number
- JVM process
- Specified by:
serverReloadin interfaceFusekiBuildCycle
-
serverBeforeStarting
Server starting - called just before server.start happens.- Specified by:
serverBeforeStartingin interfaceFusekiStartStop
-
serverAfterStarting
Server started - called just after server.start happens, and before server .start() returns to the application.- Specified by:
serverAfterStartingin interfaceFusekiStartStop
-
serverStopped
Server stopping. Do not rely on this called; do not rely on this to clear up external resources. Usually there is no stop phase and the JVM just exits or is killed externally.- Specified by:
serverStoppedin interfaceFusekiStartStop
-