KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > aop > microcontainer > beans > LifecycleBeanMetaDataFactory


1 /*
2 * JBoss, Home of Professional Open Source.
3 * Copyright 2006, Red Hat Middleware LLC, and individual contributors
4 * as indicated by the @author tags. See the copyright.txt file in the
5 * distribution for a full listing of individual contributors.
6 *
7 * This is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version.
11 *
12 * This software is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this software; if not, write to the Free
19 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21 */

22 package org.jboss.aop.microcontainer.beans;
23
24 import java.util.List JavaDoc;
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 /**
35  *
36  * @author <a HREF="kabir.khan@jboss.com">Kabir Khan</a>
37  * @version $Revision: 1.1 $
38  */

39 public class LifecycleBeanMetaDataFactory extends AspectBeanMetaDataFactory implements BeanMetaDataFactory
40 {
41    String JavaDoc classes;
42
43    public String JavaDoc getClasses()
44    {
45       return classes;
46    }
47
48    public void setClasses(String JavaDoc classes)
49    {
50       this.classes = classes;
51    }
52    
53    public List JavaDoc<BeanMetaData> getBeans()
54    {
55       List JavaDoc<BeanMetaData> beans = super.getBeans();
56
57       String JavaDoc 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