Class VirtuosoSystemService

java.lang.Object
com.google.common.util.concurrent.AbstractIdleService
org.aksw.jena_sparql_api.io.utils.AbstractSystemService
org.aksw.jena_sparql_api.ext.virtuoso.VirtuosoSystemService
All Implemented Interfaces:
com.google.common.util.concurrent.Service, SystemService, SparqlBasedService, SparqlBasedSystemService

public class VirtuosoSystemService extends org.aksw.jena_sparql_api.io.utils.AbstractSystemService implements SparqlBasedSystemService
A service wrapper instance manages a single underlying service process.
Author:
raven
  • Nested Class Summary

    Nested classes/interfaces inherited from interface com.google.common.util.concurrent.Service

    com.google.common.util.concurrent.Service.Listener, com.google.common.util.concurrent.Service.State
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected Path
     
    protected org.ini4j.Ini
     
    protected Path
     
    protected Preferences
     
    protected Path
     

    Fields inherited from class org.aksw.jena_sparql_api.io.utils.AbstractSystemService

    healthCheckInterval, outputSink, process, shutdownHookThread
  • Constructor Summary

    Constructors
    Constructor
    Description
    VirtuosoSystemService(Path virtExecPath, Path virtIniPath)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.apache.jena.rdfconnection.RDFConnection
    connectVirtuoso(String host, int httpPort, int odbcPort)
     
    org.apache.jena.rdfconnection.RDFConnection
    The default connection is some application specific connection.
    static void
    main(String[] args)
     
    boolean
    Perform a health check on the service
    protected ProcessBuilder
     
    setHealthCheckInterval(Duration healthCheckInterval)
     
    Sets the target for both stderr and stdout
    protected void
    Starts the service and yields a future indicating whether it became healthy within a certain time limit.

    Methods inherited from class org.aksw.jena_sparql_api.io.utils.AbstractSystemService

    getHealthCheckInterval, getOutputSink, shutDown

    Methods inherited from class com.google.common.util.concurrent.AbstractIdleService

    addListener, awaitRunning, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, awaitTerminated, executor, failureCause, isRunning, serviceName, startAsync, state, stopAsync, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface com.google.common.util.concurrent.Service

    addListener, awaitRunning, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, awaitTerminated, failureCause, isRunning, startAsync, state, stopAsync
  • Field Details

    • virtExecPath

      protected Path virtExecPath
    • virtIniPath

      protected Path virtIniPath
    • workingPath

      protected Path workingPath
    • virtIni

      protected transient org.ini4j.Ini virtIni
    • virtIniPrefs

      protected transient Preferences virtIniPrefs
  • Constructor Details

    • VirtuosoSystemService

      public VirtuosoSystemService(Path virtExecPath, Path virtIniPath)
  • Method Details

    • setOutputSink

      public VirtuosoSystemService setOutputSink(Consumer<String> outputSink)
      Description copied from interface: SystemService
      Sets the target for both stderr and stdout
      Specified by:
      setOutputSink in interface SystemService
      Overrides:
      setOutputSink in class org.aksw.jena_sparql_api.io.utils.AbstractSystemService
      Parameters:
      outputSink -
      Returns:
    • setHealthCheckInterval

      public VirtuosoSystemService setHealthCheckInterval(Duration healthCheckInterval)
      Overrides:
      setHealthCheckInterval in class org.aksw.jena_sparql_api.io.utils.AbstractSystemService
    • prepareProcessBuilder

      protected ProcessBuilder prepareProcessBuilder()
      Specified by:
      prepareProcessBuilder in class org.aksw.jena_sparql_api.io.utils.AbstractSystemService
    • startUp

      protected void startUp() throws IOException, InterruptedException
      Starts the service and yields a future indicating whether it became healthy within a certain time limit. The service may still become healthy at a later stage, however,
      Overrides:
      startUp in class org.aksw.jena_sparql_api.io.utils.AbstractSystemService
      Throws:
      IOException
      InterruptedException
    • performHealthCheck

      public boolean performHealthCheck()
      Perform a health check on the service
      Specified by:
      performHealthCheck in class org.aksw.jena_sparql_api.io.utils.AbstractSystemService
      Returns:
    • connectVirtuoso

      public static org.apache.jena.rdfconnection.RDFConnection connectVirtuoso(String host, int httpPort, int odbcPort)
    • createDefaultConnection

      public org.apache.jena.rdfconnection.RDFConnection createDefaultConnection()
      The default connection is some application specific connection. At minimum it should enable health check queries. The default connection will typically refer to the service's openly accessible (HTTP) SPARQL endpoint.
      Specified by:
      createDefaultConnection in interface SparqlBasedService
      Returns:
      Throws:
      org.ini4j.InvalidFileFormatException
      IOException
    • main

      public static void main(String[] args) throws Exception
      Throws:
      Exception