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
  • Field Details

    • healthCheckInterval

      protected Duration healthCheckInterval
    • process

      protected transient Process process
    • outputSink

      protected Consumer<String> outputSink
    • shutdownHookThread

      protected Thread shutdownHookThread
  • Constructor Details

    • AbstractSystemService

      public AbstractSystemService()
  • Method Details

    • getOutputSink

      public Consumer<String> getOutputSink()
    • setOutputSink

      public AbstractSystemService setOutputSink(Consumer<String> outputSink)
    • getHealthCheckInterval

      public Duration getHealthCheckInterval()
    • setHealthCheckInterval

      public AbstractSystemService setHealthCheckInterval(Duration healthCheckInterval)
    • 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

      protected abstract ProcessBuilder prepareProcessBuilder()
      Expected to return a properly configured ProcessBuilder instance, such as having the path to the executable and the arguments set.
      Returns:
    • 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,
      Specified by:
      startUp in class com.google.common.util.concurrent.AbstractIdleService
      Throws:
      IOException
      InterruptedException
    • shutDown

      protected void shutDown()
      Specified by:
      shutDown in class com.google.common.util.concurrent.AbstractIdleService