1 22 package org.jboss.kernel.plugins.deployment.xml; 23 24 import java.util.ArrayList ; 25 import java.util.List ; 26 27 import javax.xml.namespace.QName ; 28 29 import org.jboss.beans.metadata.spi.BeanMetaDataFactory; 30 import org.jboss.kernel.plugins.deployment.AbstractKernelDeployment; 31 import org.jboss.xb.binding.sunday.unmarshalling.DefaultWildcardHandler; 32 import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding; 33 34 40 public class DeploymentWildcardHandler extends DefaultWildcardHandler 41 { 42 43 public static final DeploymentWildcardHandler HANDLER = new DeploymentWildcardHandler(); 44 45 public void setParent(Object parent, Object o, QName elementName, ElementBinding element, ElementBinding parentElement) 46 { 47 AbstractKernelDeployment deployment = (AbstractKernelDeployment) parent; 48 if (o == null || o instanceof BeanMetaDataFactory == false) 49 throw new IllegalArgumentException (o + " is not an instance of BeanMetaDataFactory for element " + element.getQName()); 50 BeanMetaDataFactory bean = (BeanMetaDataFactory) o; 51 List <BeanMetaDataFactory> beans = deployment.getBeanFactories(); 52 if (beans == null) 53 { 54 beans = new ArrayList <BeanMetaDataFactory>(); 55 deployment.setBeanFactories(beans); 56 } 57 beans.add(bean); 58 } 59 } 60 | Popular Tags |