Interface ComponentRegistry

    • Method Detail

      • registerComponent

        default <T> void registerComponent​(Class<T> componentClass,
                                           Supplier<T> supplier,
                                           ComponentDescriptorModifier... modifiers)
        Registers the component supplier for the specified type.
        Type Parameters:
        T - the component-type.
        Parameters:
        componentClass - the class-type of the component.
        supplier - the supplier of the component.
        modifiers - the component descriptor modifiers.
        Throws:
        ConflictingComponentDefinitionException - if a component is already register for that descriptor.
      • registerComponent

        <T> void registerComponent​(String componentName,
                                   Class<T> componentClass,
                                   Supplier<T> supplier,
                                   ComponentDescriptorModifier... modifiers)
        Registers the component supplier for the specified type and name.
        Type Parameters:
        T - the component-type.
        Parameters:
        componentName - the name of the component.
        componentClass - the class-type of the component.
        supplier - the supplier of the component.
        modifiers - the component descriptor modifiers.
        Throws:
        ConflictingComponentDefinitionException - if a component is already register for that descriptor.
      • registerComponent

        default <T> void registerComponent​(Class<T> componentClass,
                                           ComponentDescriptorModifier... modifiers)
        Registers the component supplier for the specified type.
        Type Parameters:
        T - the component-type.
        Parameters:
        componentClass - the class-type of the component.
        Throws:
        ConflictingComponentDefinitionException - if a component is already register for that descriptor.
      • registerComponent

        <T> void registerComponent​(String componentName,
                                   Class<T> componentClass,
                                   ComponentDescriptorModifier... modifiers)
        Registers the component supplier for the specified type and name.
        Type Parameters:
        T - the component-type.
        Parameters:
        componentName - the name of the component.
        componentClass - the class-type of the component.
        Throws:
        ConflictingComponentDefinitionException - if a component is already register for that descriptor.
      • registerSingleton

        default <T> void registerSingleton​(Class<T> componentClass,
                                           Supplier<T> singleton,
                                           ComponentDescriptorModifier... modifiers)
        Registers the component supplier for the specified type and name. The given supplier will be used for creating a shared instance of type ComponentRegistry.
        Type Parameters:
        T - the component-type.
        Parameters:
        componentClass - the class-type of the component.
        singleton - the supplier of the component.
        Throws:
        ConflictingComponentDefinitionException - if a component is already register for that descriptor.
      • registerSingleton

        <T> void registerSingleton​(String componentName,
                                   Class<T> componentClass,
                                   Supplier<T> singleton,
                                   ComponentDescriptorModifier... modifiers)
        Registers the component supplier for the specified type and name. The given supplier will be used for creating a shared instance of type ComponentRegistry.
        Type Parameters:
        T - the component-type.
        Parameters:
        componentName - the name of the component.
        componentClass - the class-type of the component.
        singleton - the supplier of the component.
        Throws:
        ConflictingComponentDefinitionException - if a component is already register for that descriptor.
      • registerSingleton

        default <T> void registerSingleton​(Class<T> componentClass,
                                           ComponentDescriptorModifier... modifiers)
        Registers a singleton no-arg constructor component supplier for the specified type.
        Type Parameters:
        T - the component-type.
        Parameters:
        componentClass - the class-type of the component.
        Throws:
        ConflictingComponentDefinitionException - if a component is already register for that descriptor.
      • registerSingleton

        <T> void registerSingleton​(String componentName,
                                   Class<T> componentClass,
                                   ComponentDescriptorModifier... modifiers)
        Registers a singleton no-arg constructor component supplier for the specified type.
        Type Parameters:
        T - the component-type.
        Parameters:
        componentName - the name of the component.
        componentClass - the class-type of the component.
        Throws:
        ConflictingComponentDefinitionException - if a component is already register for that descriptor.
      • registerSingleton

        <T> void registerSingleton​(T singleton)
        Register the specified shared instance.
        Type Parameters:
        T - the component-type.
        Parameters:
        singleton - the singleton component instance.
        Throws:
        ConflictingComponentDefinitionException - if a component is already register for that descriptor.