@Override public int compare(BeanDeploymentArchive bda1, BeanDeploymentArchive bda2) { // Ids containing "WEB-INF/classes" have the highest priority int result = Boolean.compare(bda2.getId().contains(WEB_INF_CLASSES), bda1.getId().contains(WEB_INF_CLASSES)); if (result == 0) { // Additional bean archive should have the lowest priority when sorting // This suffix is supported by WildFly and Weld Servlet result = Boolean.compare(bda1.getId().endsWith(ADDITIONAL_BDA_SUFFIX), bda2.getId().endsWith(ADDITIONAL_BDA_SUFFIX)); if (result == 0) { // Then order by number of enabled beans result = Components.getNumberOfEnabledBeans(bdaToManager.get(bda2)).compareTo( Components.getNumberOfEnabledBeans(bdaToManager.get(bda1))); } } // Unless decided compare the ids lexicographically return result == 0 ? bda1.getId().compareTo(bda2.getId()) : result; } };
@Override public int compare(BeanDeploymentArchive bda1, BeanDeploymentArchive bda2) { // Ids containing "WEB-INF/classes" have the highest priority int result = Boolean.compare(bda2.getId().contains(WEB_INF_CLASSES), bda1.getId().contains(WEB_INF_CLASSES)); if (result == 0) { // Additional bean archive should have the lowest priority when sorting // This suffix is supported by WildFly and Weld Servlet result = Boolean.compare(bda1.getId().endsWith(ADDITIONAL_BDA_SUFFIX), bda2.getId().endsWith(ADDITIONAL_BDA_SUFFIX)); if (result == 0) { // Then order by number of enabled beans result = Components.getNumberOfEnabledBeans(bdaToManager.get(bda2)).compareTo( Components.getNumberOfEnabledBeans(bdaToManager.get(bda1))); } } // Unless decided compare the ids lexicographically return result == 0 ? bda1.getId().compareTo(bda2.getId()) : result; } };
@Override public int compare(BeanDeploymentArchive bda1, BeanDeploymentArchive bda2) { // Ids containing "WEB-INF/classes" have the highest priority int result = Boolean.compare(bda2.getId().contains(WEB_INF_CLASSES), bda1.getId().contains(WEB_INF_CLASSES)); if (result == 0) { // Additional bean archive should have the lowest priority when sorting // This suffix is supported by WildFly and Weld Servlet result = Boolean.compare(bda1.getId().endsWith(ADDITIONAL_BDA_SUFFIX), bda2.getId().endsWith(ADDITIONAL_BDA_SUFFIX)); if (result == 0) { // Then order by number of enabled beans result = Components.getNumberOfEnabledBeans(bdaToManager.get(bda2)).compareTo( Components.getNumberOfEnabledBeans(bdaToManager.get(bda1))); } } // Unless decided compare the ids lexicographically return result == 0 ? bda1.getId().compareTo(bda2.getId()) : result; } };
@Override public int compare(BeanDeploymentArchive bda1, BeanDeploymentArchive bda2) { // Ids containing "WEB-INF/classes" have the highest priority int result = Boolean.compare(bda2.getId().contains(WEB_INF_CLASSES), bda1.getId().contains(WEB_INF_CLASSES)); if (result == 0) { // Additional bean archive should have the lowest priority when sorting // This suffix is supported by WildFly and Weld Servlet result = Boolean.compare(bda1.getId().endsWith(ADDITIONAL_BDA_SUFFIX), bda2.getId().endsWith(ADDITIONAL_BDA_SUFFIX)); if (result == 0) { // Then order by number of enabled beans result = Components.getNumberOfEnabledBeans(bdaToManager.get(bda2)).compareTo( Components.getNumberOfEnabledBeans(bdaToManager.get(bda1))); } } // Unless decided compare the ids lexicographically return result == 0 ? bda1.getId().compareTo(bda2.getId()) : result; } };
@Override public int compare(BeanDeploymentArchive bda1, BeanDeploymentArchive bda2) { // Ids containing "WEB-INF/classes" have the highest priority int result = Boolean.compare(bda2.getId().contains(WEB_INF_CLASSES), bda1.getId().contains(WEB_INF_CLASSES)); if (result == 0) { // Additional bean archive should have the lowest priority when sorting // This suffix is supported by WildFly and Weld Servlet result = Boolean.compare(bda1.getId().endsWith(ADDITIONAL_BDA_SUFFIX), bda2.getId().endsWith(ADDITIONAL_BDA_SUFFIX)); if (result == 0) { // Then order by number of enabled beans result = Components.getNumberOfEnabledBeans(bdaToManager.get(bda2)).compareTo( Components.getNumberOfEnabledBeans(bdaToManager.get(bda1))); } } // Unless decided compare the ids lexicographically return result == 0 ? bda1.getId().compareTo(bda2.getId()) : result; } };
@Override public int compare(BeanDeploymentArchive bda1, BeanDeploymentArchive bda2) { // Ids containing "WEB-INF/classes" have the highest priority int result = Boolean.compare(bda2.getId().contains(WEB_INF_CLASSES), bda1.getId().contains(WEB_INF_CLASSES)); if (result == 0) { // Additional bean archive should have the lowest priority when sorting // This suffix is supported by WildFly and Weld Servlet result = Boolean.compare(bda1.getId().endsWith(ADDITIONAL_BDA_SUFFIX), bda2.getId().endsWith(ADDITIONAL_BDA_SUFFIX)); if (result == 0) { // Then order by number of enabled beans result = Components.getNumberOfEnabledBeans(bdaToManager.get(bda2)).compareTo( Components.getNumberOfEnabledBeans(bdaToManager.get(bda1))); } } // Unless decided compare the ids lexicographically return result == 0 ? bda1.getId().compareTo(bda2.getId()) : result; } };
@Override public int compare(BeanDeploymentArchive bda1, BeanDeploymentArchive bda2) { // Ids containing "WEB-INF/classes" have the highest priority int result = Boolean.compare(bda2.getId().contains(WEB_INF_CLASSES), bda1.getId().contains(WEB_INF_CLASSES)); if (result == 0) { // Additional bean archive should have the lowest priority when sorting // This suffix is supported by WildFly and Weld Servlet result = Boolean.compare(bda1.getId().endsWith(ADDITIONAL_BDA_SUFFIX), bda2.getId().endsWith(ADDITIONAL_BDA_SUFFIX)); if (result == 0) { // Then order by number of enabled beans result = Components.getNumberOfEnabledBeans(bdaToManager.get(bda2)).compareTo( Components.getNumberOfEnabledBeans(bdaToManager.get(bda1))); } } // Unless decided compare the ids lexicographically return result == 0 ? bda1.getId().compareTo(bda2.getId()) : result; } };
bdaBuilder.add(BEANS, Components.getNumberOfEnabledBeans(manager)); bdasBuilder.add(bdaBuilder);
bdaBuilder.add(BEANS, Components.getNumberOfEnabledBeans(manager)); bdasBuilder.add(bdaBuilder);
bdaBuilder.add(BEANS, Components.getNumberOfEnabledBeans(manager)); bdasBuilder.add(bdaBuilder);
bdaBuilder.add(BEANS, Components.getNumberOfEnabledBeans(manager)); bdasBuilder.add(bdaBuilder);
bdaBuilder.add(BEANS, Components.getNumberOfEnabledBeans(manager)); bdasBuilder.add(bdaBuilder);
bdaBuilder.add(BEANS, Components.getNumberOfEnabledBeans(manager)); bdasBuilder.add(bdaBuilder);
bdaBuilder.add(BEANS, Components.getNumberOfEnabledBeans(manager)); bdasBuilder.add(bdaBuilder);