Interface ServiceBuilder<T>

  • Type Parameters:
    T - service value type if service provides single value
    All Known Implementing Classes:
    DelegatingServiceBuilder

    public interface ServiceBuilder<T>
    Builder to configure service before installing it into the container.

    Service may require multiple dependencies (named values) to be satisfied before starting. Every dependency requirement must be specified via requires(ServiceName) method.

    Single service can provide multiple values which can be requested by dependent services. Every named value service provides must be specified via provides(ServiceName...) method.

    Once all required and provided dependencies are defined, references to all Consumers and Suppliers should be passed to service instance so they can be accessed by service at runtime.

    Implementations of this interface are thread safe because they rely on thread confinement. The builder instance can be used only by thread that created it.

    Author:
    David M. Lloyd, Richard Opalka