Package org.jboss.errai.ioc.rebind

Examples of org.jboss.errai.ioc.rebind.SortUnit


    return newList;
  }

  private static void _worstSort(final List<SortUnit> newList) {
    for (int i = 0; i < newList.size(); ) {
      SortUnit s = newList.get(i);
      boolean adv = true;
      for (int y = i + 1; y < newList.size(); y++) {
        SortUnit c = newList.get(y);

        if (s != c && s.getDependencies().contains(c)) {
           newList.add(i, newList.remove(y));
          adv = false;
         
View Full Code Here


      @Override
      public Set<SortUnit> checkDependencies(DependencyControl control, InjectableInstance instance, Produces annotation,
                                             IOCProcessingContext context) {

        control.masqueradeAs(instance.getElementTypeOrMethodReturnType());
        return Collections.singleton(new SortUnit(instance.getEnclosingType(), true));
      }


      @Override
      public boolean handle(final InjectableInstance instance, final Produces annotation,
View Full Code Here

      @Override
      public Set<SortUnit> checkDependencies(DependencyControl control, InjectableInstance instance, Produces annotation,
                                             IOCProcessingContext context) {

        control.masqueradeAs(instance.getElementTypeOrMethodReturnType());
        return Collections.singleton(new SortUnit(instance.getEnclosingType(), true));
      }


      @Override
      public boolean handle(final InjectableInstance instance, final Produces annotation,
View Full Code Here

  public static Collection<SortUnit> consolidateSortUnits(final Collection<SortUnit> in) {
    Map<MetaClass, SortUnit> sortUnitMap = new HashMap<MetaClass, SortUnit>(in.size() * 2);
    List<SortUnit> consolidatedList = new ArrayList<SortUnit>(in.size());

    SortUnit masterSU;
    for (SortUnit su : in) {
      masterSU = sortUnitMap.get(su.getType());
      if (masterSU == su) continue;

      if (masterSU != null) {
        for (Object item : su.getItems()) {
          masterSU.addItem(item);
        }
      }
      else {
        sortUnitMap.put(su.getType(), su);
      }
    }

    // second pass to re-reference dependencies
    for (SortUnit su : in) {
      Set<SortUnit> newDependencySet = new HashSet<SortUnit>();
      for (SortUnit dep : su.getDependencies()) {
        masterSU = sortUnitMap.get(dep.getType());
        if (masterSU == null) {
          masterSU = dep;
        }

        newDependencySet.add(masterSU);
      }
      consolidatedList.add(new SortUnit(su.getType(), su.getItems(), newDependencySet, su.isHard()));
    }

    return consolidatedList;
  }
View Full Code Here

  }

  private static void _worstSort(final List<SortUnit> newList) {
    int noSortCount = 0;
    for (int i = 0; i < newList.size(); ) {
      SortUnit s = newList.get(i);
      boolean adv = true;
      for (int y = i + 1; y < newList.size(); y++) {
        SortUnit c = newList.get(y);

        if (s != c && s.getDependencies().contains(c)) {
          newList.add(i, newList.remove(y));
          adv = false;
View Full Code Here

TOP

Related Classes of org.jboss.errai.ioc.rebind.SortUnit

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.