buffer.append(" state='" + component.getCurrentState() + "'>");
buffer.append(" state='" + component.getCurrentState() + "'>\n");
    public String listComponents(boolean excludeSEs,                                 boolean excludeBCs,                                 boolean excludePojos,                                 String requiredState,                                 String sharedLibraryName,                                 String serviceAssemblyName) throws Exception {        Collection connectors = container.getRegistry().getComponents();        List components = new ArrayList();        for (Iterator iter = connectors.iterator(); iter.hasNext();) {            ComponentMBeanImpl component = (ComponentMBeanImpl) iter.next();            // Skip SEs if needed            if (excludeSEs && component.isService()) {                continue;            }            // Skip BCs if needed            if (excludeBCs && component.isBinding()) {                continue;            }            // Skip Pojos if needed            if (excludePojos && component.isPojo()) {                continue;            }            // Check status            if (requiredState != null && requiredState.length() > 0 && !requiredState.equals(component.getCurrentState())) {                continue;            }            // Check shared library            // TODO: check component dependency on SL            if (sharedLibraryName != null && sharedLibraryName.length() > 0 && !container.getInstallationService().containsSharedLibrary(sharedLibraryName)) {                continue;            }            // Check deployed service assembly            // TODO: check SA dependency on component             if (serviceAssemblyName != null && serviceAssemblyName.length() > 0 && !container.getDeploymentService().isSaDeployed(serviceAssemblyName)) {                continue;            }            components.add(component);        }        StringBuffer buffer = new StringBuffer();        buffer.append("<?xml version='1.0'?>\n");        buffer.append("<component-info-list xmlns='http://java.sun.com/xml/ns/jbi/component-info-list' version='1.0'>\n");        for (Iterator iter = components.iterator(); iter.hasNext();) {            ComponentMBeanImpl component = (ComponentMBeanImpl) iter.next();            buffer.append("\t<component-info>");            if (!component.isBinding() && component.isService()) {                buffer.append(" type='service-engine'");            } else if (component.isBinding() && !component.isService()) {                buffer.append(" type='binding-component'");            }            buffer.append(" name='" + component.getName() + "'");            buffer.append(" state='" + component.getCurrentState() + "'>");            if (component.getDescription() != null) {                buffer.append("\t\t<description>");                buffer.append(component.getDescription());                buffer.append("<description>\n");            }            buffer.append("\t</component-info>\n");        }        buffer.append("</component-info-list>");        return buffer.toString();    }