1 22 package org.jboss.kernel.plugins.deployment.xml; 23 24 import java.util.List ; 25 import java.util.ArrayList ; 26 import javax.xml.namespace.QName ; 27 28 import org.jboss.beans.metadata.plugins.AbstractClassLoaderMetaData; 29 import org.jboss.beans.metadata.spi.BeanMetaDataFactory; 30 import org.jboss.kernel.plugins.deployment.AbstractKernelDeployment; 31 import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementInterceptor; 32 33 39 public class DeploymentClassLoaderInterceptor extends DefaultElementInterceptor 40 { 41 42 public static final DeploymentClassLoaderInterceptor INTERCEPTOR = new DeploymentClassLoaderInterceptor(); 43 44 public void add(Object parent, Object child, QName name) 45 { 46 AbstractKernelDeployment deployment = (AbstractKernelDeployment) parent; 47 AbstractClassLoaderMetaData classloader = (AbstractClassLoaderMetaData) child; 48 deployment.setClassLoader(classloader); 49 List <BeanMetaDataFactory> beans = deployment.getBeanFactories(); 51 if (beans == null) 52 { 53 beans = new ArrayList <BeanMetaDataFactory>(); 54 deployment.setBeanFactories(beans); 55 } 56 beans.add(classloader); 57 } 58 } 59 | Popular Tags |