1 22 package org.jboss.aop.microcontainer.beans; 23 24 import java.util.List ; 25 26 import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; 27 import org.jboss.beans.metadata.plugins.AbstractListMetaData; 28 import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData; 29 import org.jboss.beans.metadata.plugins.StringValueMetaData; 30 import org.jboss.beans.metadata.spi.BeanMetaData; 31 import org.jboss.beans.metadata.spi.BeanMetaDataFactory; 32 import org.jboss.beans.metadata.spi.ValueMetaData; 33 34 39 public class LifecycleBeanMetaDataFactory extends AspectBeanMetaDataFactory implements BeanMetaDataFactory 40 { 41 String classes; 42 43 public String getClasses() 44 { 45 return classes; 46 } 47 48 public void setClasses(String classes) 49 { 50 this.classes = classes; 51 } 52 53 public List <BeanMetaData> getBeans() 54 { 55 List <BeanMetaData> beans = super.getBeans(); 56 57 String aspectBindingName = name + "$IntroductionBinding"; 58 AbstractBeanMetaData introductionBinding = new AbstractBeanMetaData(); 59 introductionBinding.setName(aspectBindingName); 60 introductionBinding.setBean("org.jboss.aop.microcontainer.beans.IntroductionBinding"); 61 introductionBinding.addProperty(getAspectManagerPropertyMetaData("manager")); 62 introductionBinding.addProperty(new AbstractPropertyMetaData("interfaces", getInterfaces())); 63 introductionBinding.addProperty(new AbstractPropertyMetaData("classes", getClasses())); 64 beans.add(introductionBinding); 65 66 return beans; 67 } 68 69 private ValueMetaData getInterfaces() 70 { 71 AbstractListMetaData interfaces = new AbstractListMetaData(); 72 interfaces.setElementType("java.lang.String"); 73 interfaces.add(new StringValueMetaData("org.jboss.kernel.spi.dependency.KernelControllerContextAware")); 74 return interfaces; 75 } 76 } 77 | Popular Tags |