Class AbstractSystemService
java.lang.Object
com.google.common.util.concurrent.AbstractIdleService
org.aksw.jena_sparql_api.io.utils.AbstractSystemService
- All Implemented Interfaces:
com.google.common.util.concurrent.Service
public abstract class AbstractSystemService
extends com.google.common.util.concurrent.AbstractIdleService
-
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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract booleanPerform a health check on the service.protected abstract ProcessBuilderExpected to return a properly configured ProcessBuilder instance, such as having the path to the executable and the arguments set.setHealthCheckInterval(Duration healthCheckInterval) setOutputSink(Consumer<String> outputSink) protected voidshutDown()protected voidstartUp()Starts the service and yields a future indicating whether it became healthy within a certain time limit.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
-
Field Details
-
healthCheckInterval
-
process
-
outputSink
-
shutdownHookThread
-
-
Constructor Details
-
AbstractSystemService
public AbstractSystemService()
-
-
Method Details
-
getOutputSink
-
setOutputSink
-
getHealthCheckInterval
-
setHealthCheckInterval
-
performHealthCheck
public abstract boolean performHealthCheck()Perform a health check on the service. During a startup, a service enters running state in the moment the health check succeeds.- Returns:
-
prepareProcessBuilder
Expected to return a properly configured ProcessBuilder instance, such as having the path to the executable and the arguments set.- Returns:
-
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,- Specified by:
startUpin classcom.google.common.util.concurrent.AbstractIdleService- Throws:
IOExceptionInterruptedException
-
shutDown
protected void shutDown()- Specified by:
shutDownin classcom.google.common.util.concurrent.AbstractIdleService
-