KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > deployment > spi > beans > JBossConfigBeanProxy


1 /*
2  * JBoss, Home of Professional Open Source
3  * Copyright 2005, JBoss Inc., and individual contributors as indicated
4  * by the @authors tag. See the copyright.txt in the distribution for a
5  * 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.deployment.spi.beans;
23
24 import java.beans.PropertyChangeListener JavaDoc;
25 import java.util.jar.JarOutputStream JavaDoc;
26
27 import javax.enterprise.deploy.model.DDBean JavaDoc;
28 import javax.enterprise.deploy.model.DDBeanRoot JavaDoc;
29 import javax.enterprise.deploy.model.DeployableObject JavaDoc;
30 import javax.enterprise.deploy.model.XpathEvent JavaDoc;
31 import javax.enterprise.deploy.spi.DConfigBean JavaDoc;
32 import javax.enterprise.deploy.spi.DConfigBeanRoot JavaDoc;
33 import javax.enterprise.deploy.spi.exceptions.BeanNotFoundException JavaDoc;
34 import javax.enterprise.deploy.spi.exceptions.ConfigurationException JavaDoc;
35
36 import org.jboss.deployment.spi.DeploymentMetaData;
37
38 /**
39  * This class serves entirely as a proxy for ConfigBeanRoot types, which create
40  * an actual bean of a specified type.
41  *
42  * It's meant only to keep extending classes cleaner and smaller.
43  * @author Rob Stryker
44  * @version $Revision: 38480 $
45  */

46 public abstract class JBossConfigBeanProxy implements DConfigBeanRoot JavaDoc
47 {
48
49    protected AbstractJBossConfigBean myBean;
50    protected DeployableObject JavaDoc myDeployable;
51
52    protected void setBean(AbstractJBossConfigBean bean, DeployableObject JavaDoc deployable)
53    {
54       myBean = bean;
55       myDeployable = deployable;
56    }
57
58    /**
59     * This is the only abstract method.
60     */

61    public abstract DConfigBean JavaDoc getDConfigBean(DDBeanRoot JavaDoc arg0);
62
63    public DDBean JavaDoc getDDBean()
64    {
65       return myBean.getDDBean();
66    }
67
68    public String JavaDoc[] getXpaths()
69    {
70       return myBean.getXpaths();
71    }
72
73    public DConfigBean JavaDoc getDConfigBean(DDBean JavaDoc bean) throws ConfigurationException JavaDoc
74    {
75       return myBean.getDConfigBean(bean);
76    }
77
78    public void removeDConfigBean(DConfigBean JavaDoc arg0) throws BeanNotFoundException JavaDoc
79    {
80       myBean.removeDConfigBean(arg0);
81    }
82
83    public void notifyDDChange(XpathEvent JavaDoc arg0)
84    {
85       myBean.notifyDDChange(arg0);
86    }
87
88    public void addPropertyChangeListener(PropertyChangeListener JavaDoc arg0)
89    {
90       myBean.addPropertyChangeListener(arg0);
91    }
92
93    public void removePropertyChangeListener(PropertyChangeListener JavaDoc arg0)
94    {
95       myBean.removePropertyChangeListener(arg0);
96    }
97
98    public void save(JarOutputStream JavaDoc jos, DeploymentMetaData metaData)
99    {
100       myBean.save(jos, metaData);
101    }
102
103 }
104
Popular Tags