1 17 package org.apache.servicemix.jbi.config; 18 19 import org.apache.commons.logging.Log; 20 import org.apache.commons.logging.LogFactory; 21 import org.apache.servicemix.jbi.config.spring.ElementProcessor; 22 import org.apache.servicemix.jbi.config.spring.ElementProcessorSupport; 23 import org.apache.servicemix.jbi.util.DOMUtil; 24 import org.springframework.beans.factory.support.BeanDefinitionReader; 25 import org.w3c.dom.Element ; 26 27 32 public class ComponentsElementProcessor extends ElementProcessorSupport implements ElementProcessor { 33 private static final transient Log log = LogFactory.getLog(ComponentsElementProcessor.class); 34 35 36 public void processElement(Element element, BeanDefinitionReader beanDefinitionReader) { 37 Element root = (Element ) element.getParentNode(); 38 Element property = addPropertyElement(root, "activationSpecs"); 39 Element list = root.getOwnerDocument().createElement("list"); 40 property.appendChild(list); 41 DOMUtil.copyAttributes(element, list); 42 DOMUtil.moveContent(element, list); 43 root.removeChild(element); 44 45 processChildren(ContainerElementProcessor.getCompositeprocessor(), list, beanDefinitionReader); 46 47 logXmlGenerated(log, "Adding new components", property); 48 } 49 } 50 | Popular Tags |