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 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
FieldsModifier and TypeFieldDescriptionprotected Pathprotected org.ini4j.Iniprotected Pathprotected Preferencesprotected PathFields inherited from class org.aksw.jena_sparql_api.io.utils.AbstractSystemService
healthCheckInterval, outputSink, process, shutdownHookThread -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.jena.rdfconnection.RDFConnectionconnectVirtuoso(String host, int httpPort, int odbcPort) org.apache.jena.rdfconnection.RDFConnectionThe default connection is some application specific connection.static voidbooleanPerform a health check on the serviceprotected ProcessBuildersetHealthCheckInterval(Duration healthCheckInterval) setOutputSink(Consumer<String> outputSink) Sets the target for both stderr and stdoutprotected voidstartUp()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, shutDownMethods inherited from class com.google.common.util.concurrent.AbstractIdleService
addListener, awaitRunning, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, awaitTerminated, executor, failureCause, isRunning, serviceName, startAsync, state, stopAsync, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.common.util.concurrent.Service
addListener, awaitRunning, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, awaitTerminated, failureCause, isRunning, startAsync, state, stopAsync
-
Field Details
-
virtExecPath
-
virtIniPath
-
workingPath
-
virtIni
protected transient org.ini4j.Ini virtIni -
virtIniPrefs
-
-
Constructor Details
-
VirtuosoSystemService
-
-
Method Details
-
setOutputSink
Description copied from interface:SystemServiceSets the target for both stderr and stdout- Specified by:
setOutputSinkin interfaceSystemService- Overrides:
setOutputSinkin classAbstractSystemService- Returns:
-
setHealthCheckInterval
- Overrides:
setHealthCheckIntervalin classAbstractSystemService
-
prepareProcessBuilder
- Specified by:
prepareProcessBuilderin classAbstractSystemService
-
startUp
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:
startUpin classAbstractSystemService- Throws:
IOExceptionInterruptedException
-
performHealthCheck
public boolean performHealthCheck()Perform a health check on the service- Specified by:
performHealthCheckin classAbstractSystemService- 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:
createDefaultConnectionin interfaceSparqlBasedService- Returns:
- Throws:
org.ini4j.InvalidFileFormatExceptionIOException
-
main
- Throws:
Exception
-