1 16 17 package org.springframework.ejb.config; 18 19 import org.springframework.beans.factory.support.BeanDefinitionBuilder; 20 import org.springframework.beans.factory.xml.AbstractSimpleBeanDefinitionParser; 21 import org.springframework.util.xml.DomUtils; 22 import org.w3c.dom.Element ; 23 import org.w3c.dom.Node ; 24 import org.w3c.dom.NodeList ; 25 26 30 abstract class AbstractJndiLocatedBeanDefinitionParser extends AbstractSimpleBeanDefinitionParser { 31 32 public static final String ENVIRONMENT = "environment"; 33 34 public static final String JNDI_ENVIRONMENT = "jndiEnvironment"; 35 36 protected void postProcess(BeanDefinitionBuilder definitionBuilder, Element element) { 37 NodeList childNodes = element.getChildNodes(); 38 for (int i = 0; i < childNodes.getLength(); i++) { 39 Node node = childNodes.item(i); 40 if (ENVIRONMENT.equals(node.getLocalName())) { 41 definitionBuilder.addPropertyValue(JNDI_ENVIRONMENT, DomUtils.getTextValue((Element ) node)); 42 } 43 } 44 } 45 } 46 47 | Popular Tags |