plugins/org.apache.geronimo.st.v20.core/src/main/java/org/apache/geronimo/st/v20/core/GeronimoV20ServerInfo.java [318:385]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    private ArrayList<Pattern> getByTypeAttributeValues(String type,
            String attribute, String[] acceptedValues) {
        ArrayList<Pattern> result = new ArrayList<Pattern>();
        Map map = Collections.singletonMap("j2eeType", type);
        AbstractNameQuery query = new AbstractNameQuery(null, map,
                Collections.EMPTY_SET);
        for (int i = 0; i < kernels.size(); i++) {
            Set beans = kernels.get(i).listGBeans(query);
            for (Iterator it = beans.iterator(); it.hasNext();) {
                AbstractName abstractName = (AbstractName) it.next();
                try {
                    Object value = kernels.get(i).getAttribute(abstractName,
                            attribute);
                    if (value != null) {
                        if (value instanceof String[]) {
                            List<String> interfaces = Arrays
                                    .asList((String[]) value);
                            for (int j = 0; j < acceptedValues.length; j++) {
                                if (interfaces.contains(acceptedValues[j])) {
                                    Pattern pattern = new Pattern();
                                    Artifact artifact = abstractName
                                            .getArtifact();
                                    pattern.setArtifactId(artifact
                                            .getArtifactId());
                                    pattern.setGroupId(artifact.getGroupId());
                                    pattern.setVersion(artifact.getVersion()
                                            .toString());
                                    pattern.setName((String) abstractName
                                            .getName().get("name"));
                                    if (!result.contains(pattern)) {
                                        result.add(pattern);
                                    }
                                    break;
                                }
                            }
                        }
                        if (value instanceof String) {
                            String interfaces = (String) value;
                            for (int j = 0; j < acceptedValues.length; j++) {
                                if (interfaces.contains(acceptedValues[j])) {
                                    Pattern pattern = new Pattern();
                                    Artifact artifact = abstractName
                                            .getArtifact();
                                    pattern.setArtifactId(artifact
                                            .getArtifactId());
                                    pattern.setGroupId(artifact.getGroupId());
                                    pattern.setVersion(artifact.getVersion()
                                            .toString());
                                    pattern.setName((String) abstractName
                                            .getName().get("name"));
                                    if (!result.contains(pattern)) {
                                        result.add(pattern);
                                    }
                                    break;
                                }
                            }
                        }
                    }
                } catch (GBeanNotFoundException e) {
                } catch (NoSuchAttributeException e) {
                } catch (Exception e) {
                    Trace.trace(Trace.WARNING, "Kernel connection failed. "
                            + e.getMessage(), Activator.logCore);
                }
            }
        }
        return result;
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerInfo.java [318:385]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    private ArrayList<Pattern> getByTypeAttributeValues(String type,
            String attribute, String[] acceptedValues) {
        ArrayList<Pattern> result = new ArrayList<Pattern>();
        Map map = Collections.singletonMap("j2eeType", type);
        AbstractNameQuery query = new AbstractNameQuery(null, map,
                Collections.EMPTY_SET);
        for (int i = 0; i < kernels.size(); i++) {
            Set beans = kernels.get(i).listGBeans(query);
            for (Iterator it = beans.iterator(); it.hasNext();) {
                AbstractName abstractName = (AbstractName) it.next();
                try {
                    Object value = kernels.get(i).getAttribute(abstractName,
                            attribute);
                    if (value != null) {
                        if (value instanceof String[]) {
                            List<String> interfaces = Arrays
                                    .asList((String[]) value);
                            for (int j = 0; j < acceptedValues.length; j++) {
                                if (interfaces.contains(acceptedValues[j])) {
                                    Pattern pattern = new Pattern();
                                    Artifact artifact = abstractName
                                            .getArtifact();
                                    pattern.setArtifactId(artifact
                                            .getArtifactId());
                                    pattern.setGroupId(artifact.getGroupId());
                                    pattern.setVersion(artifact.getVersion()
                                            .toString());
                                    pattern.setName((String) abstractName
                                            .getName().get("name"));
                                    if (!result.contains(pattern)) {
                                        result.add(pattern);
                                    }
                                    break;
                                }
                            }
                        }
                        if (value instanceof String) {
                            String interfaces = (String) value;
                            for (int j = 0; j < acceptedValues.length; j++) {
                                if (interfaces.contains(acceptedValues[j])) {
                                    Pattern pattern = new Pattern();
                                    Artifact artifact = abstractName
                                            .getArtifact();
                                    pattern.setArtifactId(artifact
                                            .getArtifactId());
                                    pattern.setGroupId(artifact.getGroupId());
                                    pattern.setVersion(artifact.getVersion()
                                            .toString());
                                    pattern.setName((String) abstractName
                                            .getName().get("name"));
                                    if (!result.contains(pattern)) {
                                        result.add(pattern);
                                    }
                                    break;
                                }
                            }
                        }
                    }
                } catch (GBeanNotFoundException e) {
                } catch (NoSuchAttributeException e) {
                } catch (Exception e) {
                    Trace.trace(Trace.WARNING, "Kernel connection failed. "
                            + e.getMessage(), Activator.logCore);
                }
            }
        }
        return result;
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



