public void addComponent(ChainedComponent component) {
        ComponentNode<ChainedComponent> componentNode = new ComponentNode<>(component, priority++);

        ensureProvidesNotEmpty(component);
        for (String name : component.getDependencies().provides()) {
            NameProvider nameProvider = getNameProvider(name);

            nameProvider.addNode(componentNode);
        }

        for (String before : component.getDependencies().before()) {
            componentNode.before(getNameProvider(before));
        }

        for (String after : component.getDependencies().after()) {
            getNameProvider(after).before(componentNode);
        }

        ++numComponents;
    }
Given a set of phases and a set of components,
a ordered list of components satisfying the dependencies is given if possible.
<p>
The phase list implicitly defines the ordering:
    {@literal if i  < j : p_i before p_j  where i,j are valid indexes of the phrase list p.}
<p>
If multiple components provide the same name, ALL the components providing
the same name must be placed earlier/later than an entity depending on
that name.
<p>
A warning will be logged if multiple components of different types provides the
same name. A component can not provide the same name as a phase.

@author Tony Vaagenes
container-core/src/main/java/com/yahoo/component/chain/dependencies/ordering/ChainBuilder.java