if (element.hasAttribute(INTERFACE_ATTRIBUTE)) {
interfaces = Collections.singletonList(element.getAttribute(INTERFACE_ATTRIBUTE));
factoryMetadata.addProperty("interfaces", createList(context, interfaces));
}
Parser parser = getParser(context);
// Parse elements
List<RegistrationListener> listeners = new ArrayList<RegistrationListener>();
NodeList nl = element.getChildNodes();
for (int i = 0; i < nl.getLength(); i++) {
Node node = nl.item(i);
if (node instanceof Element) {
Element e = (Element) node;
if (isBlueprintNamespace(e.getNamespaceURI())) {
if (nodeNameEquals(e, INTERFACES_ELEMENT)) {
if (interfaces != null) {
throw new ComponentDefinitionException("Only one of " + Parser.INTERFACE_ATTRIBUTE + " attribute or " + INTERFACES_ELEMENT + " element must be used");
}
interfaces = parseInterfaceNames(e);
factoryMetadata.addProperty("interfaces", createList(context, interfaces));
} else if (nodeNameEquals(e, Parser.SERVICE_PROPERTIES_ELEMENT)) {
MapMetadata map = parser.parseServiceProperties(e, factoryMetadata);
factoryMetadata.addProperty("serviceProperties", map);
} else if (nodeNameEquals(e, Parser.REGISTRATION_LISTENER_ELEMENT)) {
listeners.add(parser.parseRegistrationListener(e, factoryMetadata));
}
} else if (BLUEPRINT_CM_NAMESPACE.equals(e.getNamespaceURI())) {
if (nodeNameEquals(e, MANAGED_COMPONENT_ELEMENT)) {
MutableBeanMetadata managedComponent = context.parseElement(MutableBeanMetadata.class, null, e);
generateIdIfNeeded(context, managedComponent);