Interface ServiceInstaller

All Superinterfaces:
Installer<ServiceTarget>
All Known Implementing Classes:
ServiceInstaller.DefaultServiceInstaller

public interface ServiceInstaller extends Installer<ServiceTarget>
Encapsulates service installation into a ServiceTarget.
Author:
Paul Ferraro
  • Method Details

    • builder

      static <V> ServiceInstaller.UnaryBuilder<V,V> builder(V value)
      Returns a ServiceInstaller builder whose installed service provides the specified value.
      Type Parameters:
      V - the service value type
      Parameters:
      value - the service value
      Returns:
      a service installer builder
    • builder

      static <V> ServiceInstaller.UnaryBuilder<V,V> builder(ServiceDependency<V> dependency)
      Returns a ServiceInstaller builder whose installed service provides the value supplied by the specified dependency.
      Type Parameters:
      V - the service value type
      Parameters:
      dependency - a service dependency
      Returns:
      a service installer builder
    • builder

      static <V> ServiceInstaller.UnaryBuilder<V,V> builder(Supplier<V> factory)
      Returns a ServiceInstaller builder whose installed service provides the value supplied by the specified factory.
      Type Parameters:
      V - the service value type
      Parameters:
      factory - provides the service value
      Returns:
      a service installer builder
    • builder

      static <T, V> ServiceInstaller.UnaryBuilder<T,V> builder(Function<T,V> mapper, Supplier<T> factory)
      Returns a ServiceInstaller builder whose installed service provides the value supplied by the specified factory and mapping function.
      Type Parameters:
      T - the source value type
      V - the service value type
      Parameters:
      mapper - a function that returns the service value given the value supplied by the factory
      factory - provides the input to the specified mapper
      Returns:
      a service installer builder
    • builder

      static ServiceInstaller.Builder builder(ServiceInstaller installer)
      Returns a ServiceInstaller builder that installs the specified installer into a child target.
      Parameters:
      installer - a service installer
      Returns:
      a service installer builder
    • builder

      static ServiceInstaller.Builder builder(Runnable startTask, Runnable stopTask)
      Returns a ServiceInstaller builder that executes the specified tasks on Service.start(StartContext) and Service.stop(StopContext), respectively.
      Parameters:
      startTask - a start task
      stopTask - a stop task
      Returns:
      a service installer builder