KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openejb > alt > config > ejb11 > EjbDeployment


1 /*
2  * This class was automatically generated with
3  * <a HREF="http://www.castor.org">Castor 0.9.5.3</a>, using an XML
4  * Schema.
5  * $Id: EjbDeployment.java 1104 2004-03-31 00:44:02Z dblevins $
6  */

7
8 package org.openejb.alt.config.ejb11;
9
10   //---------------------------------/
11
//- Imported classes and packages -/
12
//---------------------------------/
13

14 import java.io.IOException JavaDoc;
15 import java.io.Reader JavaDoc;
16 import java.io.Serializable JavaDoc;
17 import java.io.Writer JavaDoc;
18 import java.util.Enumeration JavaDoc;
19 import java.util.Vector JavaDoc;
20 import org.exolab.castor.xml.MarshalException;
21 import org.exolab.castor.xml.Marshaller;
22 import org.exolab.castor.xml.Unmarshaller;
23 import org.exolab.castor.xml.ValidationException;
24 import org.xml.sax.ContentHandler JavaDoc;
25
26 /**
27  * Class EjbDeployment.
28  *
29  * @version $Revision: 1104 $ $Date: 2004-03-30 16:44:02 -0800 (Tue, 30 Mar 2004) $
30  */

31 public class EjbDeployment implements java.io.Serializable JavaDoc {
32
33
34       //--------------------------/
35
//- Class/Member Variables -/
36
//--------------------------/
37

38     /**
39      * Field _ejbName
40      */

41     private java.lang.String JavaDoc _ejbName;
42
43     /**
44      * Field _deploymentId
45      */

46     private java.lang.String JavaDoc _deploymentId;
47
48     /**
49      * Field _containerId
50      */

51     private java.lang.String JavaDoc _containerId;
52
53     /**
54      * Field _resourceLinkList
55      */

56     private java.util.Vector JavaDoc _resourceLinkList;
57
58     /**
59      * Field _queryList
60      */

61     private java.util.Vector JavaDoc _queryList;
62
63
64       //----------------/
65
//- Constructors -/
66
//----------------/
67

68     public EjbDeployment() {
69         super();
70         _resourceLinkList = new Vector JavaDoc();
71         _queryList = new Vector JavaDoc();
72     } //-- org.openejb.alt.config.ejb11.EjbDeployment()
73

74
75       //-----------/
76
//- Methods -/
77
//-----------/
78

79     /**
80      * Method addQuery
81      *
82      * @param vQuery
83      */

84     public void addQuery(org.openejb.alt.config.ejb11.Query vQuery)
85         throws java.lang.IndexOutOfBoundsException JavaDoc
86     {
87         _queryList.addElement(vQuery);
88     } //-- void addQuery(org.openejb.alt.config.ejb11.Query)
89

90     /**
91      * Method addQuery
92      *
93      * @param index
94      * @param vQuery
95      */

96     public void addQuery(int index, org.openejb.alt.config.ejb11.Query vQuery)
97         throws java.lang.IndexOutOfBoundsException JavaDoc
98     {
99         _queryList.insertElementAt(vQuery, index);
100     } //-- void addQuery(int, org.openejb.alt.config.ejb11.Query)
101

102     /**
103      * Method addResourceLink
104      *
105      * @param vResourceLink
106      */

107     public void addResourceLink(org.openejb.alt.config.ejb11.ResourceLink vResourceLink)
108         throws java.lang.IndexOutOfBoundsException JavaDoc
109     {
110         _resourceLinkList.addElement(vResourceLink);
111     } //-- void addResourceLink(org.openejb.alt.config.ejb11.ResourceLink)
112

113     /**
114      * Method addResourceLink
115      *
116      * @param index
117      * @param vResourceLink
118      */

119     public void addResourceLink(int index, org.openejb.alt.config.ejb11.ResourceLink vResourceLink)
120         throws java.lang.IndexOutOfBoundsException JavaDoc
121     {
122         _resourceLinkList.insertElementAt(vResourceLink, index);
123     } //-- void addResourceLink(int, org.openejb.alt.config.ejb11.ResourceLink)
124

125     /**
126      * Method enumerateQuery
127      */

128     public java.util.Enumeration JavaDoc enumerateQuery()
129     {
130         return _queryList.elements();
131     } //-- java.util.Enumeration enumerateQuery()
132

133     /**
134      * Method enumerateResourceLink
135      */

136     public java.util.Enumeration JavaDoc enumerateResourceLink()
137     {
138         return _resourceLinkList.elements();
139     } //-- java.util.Enumeration enumerateResourceLink()
140

141     /**
142      * Returns the value of field 'containerId'.
143      *
144      * @return the value of field 'containerId'.
145      */

146     public java.lang.String JavaDoc getContainerId()
147     {
148         return this._containerId;
149     } //-- java.lang.String getContainerId()
150

151     /**
152      * Returns the value of field 'deploymentId'.
153      *
154      * @return the value of field 'deploymentId'.
155      */

156     public java.lang.String JavaDoc getDeploymentId()
157     {
158         return this._deploymentId;
159     } //-- java.lang.String getDeploymentId()
160

161     /**
162      * Returns the value of field 'ejbName'.
163      *
164      * @return the value of field 'ejbName'.
165      */

166     public java.lang.String JavaDoc getEjbName()
167     {
168         return this._ejbName;
169     } //-- java.lang.String getEjbName()
170

171     /**
172      * Method getQuery
173      *
174      * @param index
175      */

176     public org.openejb.alt.config.ejb11.Query getQuery(int index)
177         throws java.lang.IndexOutOfBoundsException JavaDoc
178     {
179         //-- check bounds for index
180
if ((index < 0) || (index > _queryList.size())) {
181             throw new IndexOutOfBoundsException JavaDoc();
182         }
183         
184         return (org.openejb.alt.config.ejb11.Query) _queryList.elementAt(index);
185     } //-- org.openejb.alt.config.ejb11.Query getQuery(int)
186

187     /**
188      * Method getQuery
189      */

190     public org.openejb.alt.config.ejb11.Query[] getQuery()
191     {
192         int size = _queryList.size();
193         org.openejb.alt.config.ejb11.Query[] mArray = new org.openejb.alt.config.ejb11.Query[size];
194         for (int index = 0; index < size; index++) {
195             mArray[index] = (org.openejb.alt.config.ejb11.Query) _queryList.elementAt(index);
196         }
197         return mArray;
198     } //-- org.openejb.alt.config.ejb11.Query[] getQuery()
199

200     /**
201      * Method getQueryCount
202      */

203     public int getQueryCount()
204     {
205         return _queryList.size();
206     } //-- int getQueryCount()
207

208     /**
209      * Method getResourceLink
210      *
211      * @param index
212      */

213     public org.openejb.alt.config.ejb11.ResourceLink getResourceLink(int index)
214         throws java.lang.IndexOutOfBoundsException JavaDoc
215     {
216         //-- check bounds for index
217
if ((index < 0) || (index > _resourceLinkList.size())) {
218             throw new IndexOutOfBoundsException JavaDoc();
219         }
220         
221         return (org.openejb.alt.config.ejb11.ResourceLink) _resourceLinkList.elementAt(index);
222     } //-- org.openejb.alt.config.ejb11.ResourceLink getResourceLink(int)
223

224     /**
225      * Method getResourceLink
226      */

227     public org.openejb.alt.config.ejb11.ResourceLink[] getResourceLink()
228     {
229         int size = _resourceLinkList.size();
230         org.openejb.alt.config.ejb11.ResourceLink[] mArray = new org.openejb.alt.config.ejb11.ResourceLink[size];
231         for (int index = 0; index < size; index++) {
232             mArray[index] = (org.openejb.alt.config.ejb11.ResourceLink) _resourceLinkList.elementAt(index);
233         }
234         return mArray;
235     } //-- org.openejb.alt.config.ejb11.ResourceLink[] getResourceLink()
236

237     /**
238      * Method getResourceLinkCount
239      */

240     public int getResourceLinkCount()
241     {
242         return _resourceLinkList.size();
243     } //-- int getResourceLinkCount()
244

245     /**
246      * Method isValid
247      */

248     public boolean isValid()
249     {
250         try {
251             validate();
252         }
253         catch (org.exolab.castor.xml.ValidationException vex) {
254             return false;
255         }
256         return true;
257     } //-- boolean isValid()
258

259     /**
260      * Method marshal
261      *
262      * @param out
263      */

264     public void marshal(java.io.Writer JavaDoc out)
265         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
266     {
267         
268         Marshaller.marshal(this, out);
269     } //-- void marshal(java.io.Writer)
270

271     /**
272      * Method marshal
273      *
274      * @param handler
275      */

276     public void marshal(org.xml.sax.ContentHandler JavaDoc handler)
277         throws java.io.IOException JavaDoc, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
278     {
279         
280         Marshaller.marshal(this, handler);
281     } //-- void marshal(org.xml.sax.ContentHandler)
282

283     /**
284      * Method removeAllQuery
285      */

286     public void removeAllQuery()
287     {
288         _queryList.removeAllElements();
289     } //-- void removeAllQuery()
290

291     /**
292      * Method removeAllResourceLink
293      */

294     public void removeAllResourceLink()
295     {
296         _resourceLinkList.removeAllElements();
297     } //-- void removeAllResourceLink()
298

299     /**
300      * Method removeQuery
301      *
302      * @param index
303      */

304     public org.openejb.alt.config.ejb11.Query removeQuery(int index)
305     {
306         java.lang.Object JavaDoc obj = _queryList.elementAt(index);
307         _queryList.removeElementAt(index);
308         return (org.openejb.alt.config.ejb11.Query) obj;
309     } //-- org.openejb.alt.config.ejb11.Query removeQuery(int)
310

311     /**
312      * Method removeResourceLink
313      *
314      * @param index
315      */

316     public org.openejb.alt.config.ejb11.ResourceLink removeResourceLink(int index)
317     {
318         java.lang.Object JavaDoc obj = _resourceLinkList.elementAt(index);
319         _resourceLinkList.removeElementAt(index);
320         return (org.openejb.alt.config.ejb11.ResourceLink) obj;
321     } //-- org.openejb.alt.config.ejb11.ResourceLink removeResourceLink(int)
322

323     /**
324      * Sets the value of field 'containerId'.
325      *
326      * @param containerId the value of field 'containerId'.
327      */

328     public void setContainerId(java.lang.String JavaDoc containerId)
329     {
330         this._containerId = containerId;
331     } //-- void setContainerId(java.lang.String)
332

333     /**
334      * Sets the value of field 'deploymentId'.
335      *
336      * @param deploymentId the value of field 'deploymentId'.
337      */

338     public void setDeploymentId(java.lang.String JavaDoc deploymentId)
339     {
340         this._deploymentId = deploymentId;
341     } //-- void setDeploymentId(java.lang.String)
342

343     /**
344      * Sets the value of field 'ejbName'.
345      *
346      * @param ejbName the value of field 'ejbName'.
347      */

348     public void setEjbName(java.lang.String JavaDoc ejbName)
349     {
350         this._ejbName = ejbName;
351     } //-- void setEjbName(java.lang.String)
352

353     /**
354      * Method setQuery
355      *
356      * @param index
357      * @param vQuery
358      */

359     public void setQuery(int index, org.openejb.alt.config.ejb11.Query vQuery)
360         throws java.lang.IndexOutOfBoundsException JavaDoc
361     {
362         //-- check bounds for index
363
if ((index < 0) || (index > _queryList.size())) {
364             throw new IndexOutOfBoundsException JavaDoc();
365         }
366         _queryList.setElementAt(vQuery, index);
367     } //-- void setQuery(int, org.openejb.alt.config.ejb11.Query)
368

369     /**
370      * Method setQuery
371      *
372      * @param queryArray
373      */

374     public void setQuery(org.openejb.alt.config.ejb11.Query[] queryArray)
375     {
376         //-- copy array
377
_queryList.removeAllElements();
378         for (int i = 0; i < queryArray.length; i++) {
379             _queryList.addElement(queryArray[i]);
380         }
381     } //-- void setQuery(org.openejb.alt.config.ejb11.Query)
382

383     /**
384      * Method setResourceLink
385      *
386      * @param index
387      * @param vResourceLink
388      */

389     public void setResourceLink(int index, org.openejb.alt.config.ejb11.ResourceLink vResourceLink)
390         throws java.lang.IndexOutOfBoundsException JavaDoc
391     {
392         //-- check bounds for index
393
if ((index < 0) || (index > _resourceLinkList.size())) {
394             throw new IndexOutOfBoundsException JavaDoc();
395         }
396         _resourceLinkList.setElementAt(vResourceLink, index);
397     } //-- void setResourceLink(int, org.openejb.alt.config.ejb11.ResourceLink)
398

399     /**
400      * Method setResourceLink
401      *
402      * @param resourceLinkArray
403      */

404     public void setResourceLink(org.openejb.alt.config.ejb11.ResourceLink[] resourceLinkArray)
405     {
406         //-- copy array
407
_resourceLinkList.removeAllElements();
408         for (int i = 0; i < resourceLinkArray.length; i++) {
409             _resourceLinkList.addElement(resourceLinkArray[i]);
410         }
411     } //-- void setResourceLink(org.openejb.alt.config.ejb11.ResourceLink)
412

413     /**
414      * Method unmarshal
415      *
416      * @param reader
417      */

418     public static java.lang.Object JavaDoc unmarshal(java.io.Reader JavaDoc reader)
419         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
420     {
421         return (org.openejb.alt.config.ejb11.EjbDeployment) Unmarshaller.unmarshal(org.openejb.alt.config.ejb11.EjbDeployment.class, reader);
422     } //-- java.lang.Object unmarshal(java.io.Reader)
423

424     /**
425      * Method validate
426      */

427     public void validate()
428         throws org.exolab.castor.xml.ValidationException
429     {
430         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
431         validator.validate(this);
432     } //-- void validate()
433

434 }
435
Popular Tags