Interface Installer.Builder<B,I extends Installer<ST>,ST extends ServiceTarget,SB extends ServiceBuilder<?>>

Type Parameters:
B - the builder type
I - the installer type
ST - the service target type
SB - the service builder type
All Known Subinterfaces:
CapabilityServiceInstaller.Builder<T,V>, Installer.UnaryBuilder<B,I,ST,SB,T,V>, ServiceInstaller.Builder, ServiceInstaller.Builder, ServiceInstaller.UnaryBuilder<T,V>, ServiceInstaller.UnaryBuilder<T,V>
All Known Implementing Classes:
CapabilityServiceInstaller.DefaultBuilder, Installer.AbstractBuilder, Installer.AbstractNullaryBuilder, Installer.AbstractUnaryBuilder, ServiceInstaller.DefaultNullaryBuilder, ServiceInstaller.DefaultNullaryBuilder, ServiceInstaller.DefaultUnaryBuilder, ServiceInstaller.DefaultUnaryBuilder
Enclosing interface:
Installer<ST extends ServiceTarget>

public static interface Installer.Builder<B,I extends Installer<ST>,ST extends ServiceTarget,SB extends ServiceBuilder<?>>
Builds an installer of a service.
  • Method Summary

    Modifier and Type
    Method
    Description
    Configures the installed service to start immediately after installation, forcing any dependencies to start.
    Configures the installed service to automatically start when all of its dependencies are available and to automatically stop when any of its dependencies are no longer available.
    Builds a service installer.
    Configures the specified task to be run upon removal of the installed service.
    Configures the specified task to be run after the installed service is started.
    Configures the specified task to be run after the installed service is stopped.
    default B
    requires(Iterable<? extends Consumer<SB>> dependencies)
    Configures dependencies of the installed service.
    requires(Consumer<SB> dependency)
    Configures a dependency of the installed service.
  • Method Details

    • requires

      B requires(Consumer<SB> dependency)
      Configures a dependency of the installed service.
      Parameters:
      dependency - a dependency
      Returns:
      a reference to this builder
    • requires

      default B requires(Iterable<? extends Consumer<SB>> dependencies)
      Configures dependencies of the installed service.
      Parameters:
      dependencies - a variable number of dependencies
      Returns:
      a reference to this builder
    • asPassive

      B asPassive()
      Configures the installed service to automatically start when all of its dependencies are available and to automatically stop when any of its dependencies are no longer available.
      Returns:
      a reference to this builder
    • asActive

      B asActive()
      Configures the installed service to start immediately after installation, forcing any dependencies to start.
      Returns:
      a reference to this builder
    • onStart

      B onStart(Runnable task)
      Configures the specified task to be run after the installed service is started.
      Parameters:
      task - a task to execute upon service start
      Returns:
      a reference to this builder
    • onStop

      B onStop(Runnable task)
      Configures the specified task to be run after the installed service is stopped.
      Parameters:
      task - a task to execute upon service stop
      Returns:
      a reference to this builder
    • onRemove

      B onRemove(Runnable task)
      Configures the specified task to be run upon removal of the installed service.
      Parameters:
      task - a task to execute upon service removal
      Returns:
      a reference to this builder
    • build

      I build()
      Builds a service installer.
      Returns:
      a service installer