KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > system > metadata > ServiceMetaData


1 /*
2 * JBoss, Home of Professional Open Source
3 * Copyright 2006, 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.system.metadata;
23
24 import java.util.Collections JavaDoc;
25 import java.util.List JavaDoc;
26 import java.util.Set JavaDoc;
27
28 import javax.management.ObjectName JavaDoc;
29
30 import org.jboss.dependency.spi.ControllerMode;
31 import org.w3c.dom.Element JavaDoc;
32
33 /**
34  * ServiceMetaData.
35  *
36  * @author <a HREF="adrian@jboss.com">Adrian Brock</a>
37  * @version $Revision: 1.1 $
38  */

39 public class ServiceMetaData extends AbstractMetaDataVisitorNode
40 {
41    /** The default XMBean class, when one is not specified */
42    public static final String JavaDoc XMBEAN_CODE = "org.jboss.mx.modelmbean.XMBean";
43    
44    /** The ObjectName */
45    private ObjectName JavaDoc objectName;
46    
47    /** The code */
48    private String JavaDoc code;
49
50    /** The mode */
51    private ControllerMode mode;
52    
53    /** The interface name */
54    private String JavaDoc interfaceName;
55    
56    /** The constructor */
57    private ServiceConstructorMetaData constructor;
58    
59    /** The XMBean dds */
60    private String JavaDoc xmbeanDD;
61    
62    /** The XMBean code */
63    private String JavaDoc xmbeanCode = XMBEAN_CODE;
64    
65    /** The XMBean descriptor */
66    private Element JavaDoc xmbeanDescriptor;
67    
68    /** The attributes */
69    private List JavaDoc<ServiceAttributeMetaData> attributes = Collections.emptyList();
70    
71    /** The dependencies */
72    private List JavaDoc<ServiceDependencyMetaData> dependencies = Collections.emptyList();
73
74    /** The class loader */
75    private ObjectName JavaDoc classLoaderName;
76    
77    /**
78     * Get the objectName.
79     *
80     * @return the objectName.
81     */

82    public ObjectName JavaDoc getObjectName()
83    {
84       return objectName;
85    }
86
87    /**
88     * Set the objectName.
89     *
90     * @param objectName the objectName.
91     */

92    public void setObjectName(ObjectName JavaDoc objectName)
93    {
94       if (objectName == null)
95          throw new IllegalArgumentException JavaDoc("Null objectName");
96       this.objectName = objectName;
97    }
98
99    /**
100     * Get the code.
101     *
102     * @return the code.
103     */

104    public String JavaDoc getCode()
105    {
106       return code;
107    }
108
109    /**
110     * Set the code.
111     *
112     * @param code the code.
113     */

114    public void setCode(String JavaDoc code)
115    {
116       if (code == null)
117          throw new IllegalArgumentException JavaDoc("Null code");
118       this.code = code;
119    }
120
121    /**
122     * Get the mode.
123     *
124     * @return the mode.
125     */

126    public ControllerMode getMode()
127    {
128       return mode;
129    }
130
131    /**
132     * Set the mode.
133     *
134     * @param mode the mode.
135     */

136    public void setMode(ControllerMode mode)
137    {
138       this.mode = mode;
139    }
140
141    /**
142     * Get the constructor.
143     *
144     * @return the constructor.
145     */

146    public ServiceConstructorMetaData getConstructor()
147    {
148       return constructor;
149    }
150
151    /**
152     * Set the constructor.
153     *
154     * @param constructor the constructor.
155     */

156    public void setConstructor(ServiceConstructorMetaData constructor)
157    {
158       this.constructor = constructor;
159    }
160
161    /**
162     * Get the interfaceName.
163     *
164     * @return the interfaceName.
165     */

166    public String JavaDoc getInterfaceName()
167    {
168       return interfaceName;
169    }
170
171    /**
172     * Set the interfaceName.
173     *
174     * @param interfaceName the interfaceName.
175     */

176    public void setInterfaceName(String JavaDoc interfaceName)
177    {
178       this.interfaceName = interfaceName;
179    }
180
181    /**
182     * Get the xmbeanCode.
183     *
184     * @return the xmbeanCode.
185     */

186    public String JavaDoc getXMBeanCode()
187    {
188       return xmbeanCode;
189    }
190
191    /**
192     * Set the xmbeanCode.
193     *
194     * @param xmbeanCode the xmbeanCode.
195     */

196    public void setXMBeanCode(String JavaDoc xmbeanCode)
197    {
198       if (xmbeanCode == null)
199          throw new IllegalArgumentException JavaDoc("Null xmbeanCode");
200       this.xmbeanCode = xmbeanCode;
201    }
202
203    /**
204     * Get the xmbeanDD.
205     *
206     * @return the xmbeanDD.
207     */

208    public String JavaDoc getXMBeanDD()
209    {
210       return xmbeanDD;
211    }
212
213    /**
214     * Set the xmbeanDD.
215     *
216     * @param xmbeanDD the xmbeanDD.
217     */

218    public void setXMBeanDD(String JavaDoc xmbeanDD)
219    {
220       this.xmbeanDD = xmbeanDD;
221    }
222
223    /**
224     * Get the xmbeanDescriptor.
225     *
226     * @return the xmbeanDescriptor.
227     */

228    public Element JavaDoc getXMBeanDescriptor()
229    {
230       return xmbeanDescriptor;
231    }
232
233    /**
234     * Set the xmbeanDescriptor.
235     *
236     * @param xmbeanDescriptor the xmbeanDescriptor.
237     */

238    public void setXMBeanDescriptor(Element JavaDoc xmbeanDescriptor)
239    {
240       this.xmbeanDescriptor = xmbeanDescriptor;
241    }
242
243    /**
244     * Get the attributes.
245     *
246     * @return the attributes.
247     */

248    public List JavaDoc<ServiceAttributeMetaData> getAttributes()
249    {
250       return attributes;
251    }
252
253    /**
254     * Set the attributes.
255     *
256     * @param attributes the attributes.
257     */

258    public void setAttributes(List JavaDoc<ServiceAttributeMetaData> attributes)
259    {
260       if (attributes == null)
261          throw new IllegalArgumentException JavaDoc("Null attributes");
262       this.attributes = attributes;
263    }
264
265    /**
266     * Get the dependencies.
267     *
268     * @return the dependencies.
269     */

270    public List JavaDoc<ServiceDependencyMetaData> getDependencies()
271    {
272       return dependencies;
273    }
274
275    /**
276     * Set the dependencies.
277     *
278     * @param dependencies the dependencies.
279     */

280    public void setDependencies(List JavaDoc<ServiceDependencyMetaData> dependencies)
281    {
282       if (dependencies == null)
283          throw new IllegalArgumentException JavaDoc("Null dependencies");
284       this.dependencies = dependencies;
285    }
286
287    /**
288     * Get the classLoaderName.
289     *
290     * @return the classLoaderName.
291     */

292    public ObjectName JavaDoc getClassLoaderName()
293    {
294       return classLoaderName;
295    }
296
297    /**
298     * Set the classLoaderName.
299     *
300     * @param classLoaderName the classLoaderName.
301     */

302    public void setClassLoaderName(ObjectName JavaDoc classLoaderName)
303    {
304       this.classLoaderName = classLoaderName;
305    }
306
307    protected void addChildren(Set JavaDoc<ServiceMetaDataVisitorNode> children)
308    {
309       children.addAll(attributes);
310       children.addAll(dependencies);
311    }
312 }
313
Popular Tags