Class DelegatingServiceBuilder<T>

    • Constructor Detail

      • DelegatingServiceBuilder

        public DelegatingServiceBuilder​(ServiceBuilder<T> delegate)
        Construct a new instance.
        Parameters:
        delegate - the builder to delegate to
    • Method Detail

      • getDelegate

        protected ServiceBuilder<T> getDelegate()
        Get the ServiceBuilder delegate.
        Returns:
        ServiceBuilder delegate
      • requires

        public <V> Supplier<V> requires​(ServiceName name)
        Specifies value name required by service. There can be multiple values service may depend on.
        Specified by:
        requires in interface ServiceBuilder<T>
        Type Parameters:
        V - required dependency value type
        Parameters:
        name - required dependency name
        Returns:
        readonly dependency reference
      • provides

        public <V> Consumer<V> provides​(ServiceName... names)
        Specifies value provided by service. There can be multiple names for the same value. At least one name parameter must be provided to this method. If there are more names in the vararg array then the first one is called provided value name and other are called provided value aliases.
        Specified by:
        provides in interface ServiceBuilder<T>
        Type Parameters:
        V - provided value type
        Parameters:
        names - provided value name (and its aliases)
        Returns:
        writable dependency reference
      • addDependency

        @Deprecated
        public ServiceBuilder<T> addDependency​(ServiceName dependency)
        Deprecated.
        Add a dependency. Calling this method multiple times for the same service name will only add it as a dependency one time; however this may be useful to specify multiple injections for one dependency.
        Specified by:
        addDependency in interface ServiceBuilder<T>
        Parameters:
        dependency - the name of the dependency
        Returns:
        an injection builder for optionally injecting the dependency
      • addDependency

        @Deprecated
        public ServiceBuilder<T> addDependency​(ServiceBuilder.DependencyType dependencyType,
                                               ServiceName dependency)
        Deprecated.
        Add a dependency. Calling this method multiple times for the same service name will only add it as a dependency one time; however this may be useful to specify multiple injections for one dependency.
        Specified by:
        addDependency in interface ServiceBuilder<T>
        Parameters:
        dependencyType - the dependency type; must not be null
        dependency - the name of the dependency
        Returns:
        an injection builder for optionally injecting the dependency
      • addDependency

        @Deprecated
        public ServiceBuilder<T> addDependency​(ServiceName dependency,
                                               Injector<Object> target)
        Deprecated.
        Add a service dependency. Calling this method multiple times for the same service name will only add it as a dependency one time; however this may be useful to specify multiple injections for one dependency.
        Specified by:
        addDependency in interface ServiceBuilder<T>
        Parameters:
        dependency - the name of the dependency
        target - the injector into which the dependency should be stored
        Returns:
        this builder
      • addDependency

        @Deprecated
        public ServiceBuilder<T> addDependency​(ServiceBuilder.DependencyType dependencyType,
                                               ServiceName dependency,
                                               Injector<Object> target)
        Deprecated.
        Add a service dependency. Calling this method multiple times for the same service name will only add it as a dependency one time; however this may be useful to specify multiple injections for one dependency.
        Specified by:
        addDependency in interface ServiceBuilder<T>
        Parameters:
        dependencyType - the dependency type; must not be null
        dependency - the name of the dependency
        target - the injector into which the dependency should be stored
        Returns:
        this builder
      • addDependency

        @Deprecated
        public <I> ServiceBuilder<T> addDependency​(ServiceName dependency,
                                                   Class<I> type,
                                                   Injector<I> target)
        Deprecated.
        Add a service dependency. The type of the dependency is checked before it is passed into the (type-safe) injector instance. Calling this method multiple times for the same service name will only add it as a dependency one time; however this may be useful to specify multiple injections for one dependency.
        Specified by:
        addDependency in interface ServiceBuilder<T>
        Type Parameters:
        I - the type of the value of the dependency
        Parameters:
        dependency - the name of the dependency
        type - the class of the value of the dependency
        target - the injector into which the dependency should be stored
        Returns:
        this builder
      • addDependency

        @Deprecated
        public <I> ServiceBuilder<T> addDependency​(ServiceBuilder.DependencyType dependencyType,
                                                   ServiceName dependency,
                                                   Class<I> type,
                                                   Injector<I> target)
        Deprecated.
        Add a service dependency. The type of the dependency is checked before it is passed into the (type-safe) injector instance. Calling this method multiple times for the same service name will only add it as a dependency one time; however this may be useful to specify multiple injections for one dependency.
        Specified by:
        addDependency in interface ServiceBuilder<T>
        Type Parameters:
        I - the type of the value of the dependency
        Parameters:
        dependencyType - the dependency type; must not be null
        dependency - the name of the dependency
        type - the class of the value of the dependency
        target - the injector into which the dependency should be stored
        Returns:
        this builder
      • addInjection

        @Deprecated
        public <I> ServiceBuilder<T> addInjection​(Injector<? super I> target,
                                                  I value)
        Deprecated.
        Add an injection. The given value will be injected into the given injector before service start, and uninjected after service stop.
        Specified by:
        addInjection in interface ServiceBuilder<T>
        Type Parameters:
        I - the injection type
        Parameters:
        target - the injection target
        value - the injection value
        Returns:
        this builder
      • addInjectionValue

        @Deprecated
        public <I> ServiceBuilder<T> addInjectionValue​(Injector<? super I> target,
                                                       Value<I> value)
        Deprecated.
        Add an injection value. The given value will be injected into the given injector before service start, and uninjected after service stop.
        Specified by:
        addInjectionValue in interface ServiceBuilder<T>
        Type Parameters:
        I - the injection type
        Parameters:
        target - the injection target
        value - the injection value
        Returns:
        this builder
      • addInjection

        @Deprecated
        public ServiceBuilder<T> addInjection​(Injector<? super T> target)
        Deprecated.
        Add an injection of this service into another target. The given injector will be given this service after start, and uninjected when this service stops.

        Differently from other injection types, failures to perform an outward injection will not result in a failure to start the service.

        Specified by:
        addInjection in interface ServiceBuilder<T>
        Parameters:
        target - the injector target
        Returns:
        this builder