Class DIReactor


  • public final class DIReactor
    extends Object
    Reactor. - add components in any order with their id, their class - add ids for components that are already existing. - then 'proceed' and you obtain an ORDERED list of components, taking account of their dependencies.
    Author:
    pchretien
    • Constructor Detail

      • DIReactor

        public DIReactor()
    • Method Detail

      • addComponent

        public DIReactor addComponent​(String id,
                                      Class<?> implClass)
        Add a component
        Parameters:
        id - ID f the component
        implClass - Impl class of the component
        Returns:
        this reactor
      • addComponent

        public DIReactor addComponent​(String id,
                                      Class<?> implClass,
                                      Set<String> params)
        Add a component
        Parameters:
        id - ID f the component
        implClass - Impl class of the component
        params - List of ID of all local params - which will be automatically injected-
        Returns:
        this reactor
      • addParent

        public DIReactor addParent​(String id)
        Add a component identified by its ID. This component is ready to be injected in other components (and it does not need to be resolved).
        Parameters:
        id - ID of the component
        Returns:
        this reactor
      • proceed

        public List<String> proceed()
        Process the 'digital' reaction in a way to obtain an ordered list of components, taking account of their dependencies.
        Returns:
        Ordered list of comoponent's Ids.