KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > config > serverbeans > Resources


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23  
24 /**
25  * This generated bean class Resources matches the DTD element resources
26  *
27  */

28
29 package com.sun.enterprise.config.serverbeans;
30
31 import org.w3c.dom.*;
32 import org.netbeans.modules.schema2beans.*;
33 import java.beans.*;
34 import java.util.*;
35 import java.io.Serializable JavaDoc;
36 import com.sun.enterprise.config.ConfigBean;
37 import com.sun.enterprise.config.ConfigException;
38 import com.sun.enterprise.config.StaleWriteConfigException;
39 import com.sun.enterprise.util.i18n.StringManager;
40
41 // BEGIN_NOI18N
42

43 public class Resources extends ConfigBean implements Serializable JavaDoc
44 {
45
46     static Vector comparators = new Vector();
47     private static final org.netbeans.modules.schema2beans.Version runtimeVersion = new org.netbeans.modules.schema2beans.Version(4, 2, 0);
48
49     static public final String JavaDoc CUSTOM_RESOURCE = "CustomResource";
50     static public final String JavaDoc EXTERNAL_JNDI_RESOURCE = "ExternalJndiResource";
51     static public final String JavaDoc JDBC_RESOURCE = "JdbcResource";
52     static public final String JavaDoc MAIL_RESOURCE = "MailResource";
53     static public final String JavaDoc PERSISTENCE_MANAGER_FACTORY_RESOURCE = "PersistenceManagerFactoryResource";
54     static public final String JavaDoc ADMIN_OBJECT_RESOURCE = "AdminObjectResource";
55     static public final String JavaDoc CONNECTOR_RESOURCE = "ConnectorResource";
56     static public final String JavaDoc RESOURCE_ADAPTER_CONFIG = "ResourceAdapterConfig";
57     static public final String JavaDoc JDBC_CONNECTION_POOL = "JdbcConnectionPool";
58     static public final String JavaDoc CONNECTOR_CONNECTION_POOL = "ConnectorConnectionPool";
59
60     public Resources() {
61         this(Common.USE_DEFAULT_VALUES);
62     }
63
64     public Resources(int options)
65     {
66         super(comparators, runtimeVersion);
67         // Properties (see root bean comments for the bean graph)
68
initPropertyTables(10);
69         this.createProperty("custom-resource", CUSTOM_RESOURCE, Common.SEQUENCE_OR |
70             Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY,
71             CustomResource.class);
72         this.createAttribute(CUSTOM_RESOURCE, "jndi-name", "JndiName",
73                         AttrProp.CDATA | AttrProp.REQUIRED,
74                         null, null);
75         this.createAttribute(CUSTOM_RESOURCE, "res-type", "ResType",
76                         AttrProp.CDATA | AttrProp.REQUIRED,
77                         null, null);
78         this.createAttribute(CUSTOM_RESOURCE, "factory-class", "FactoryClass",
79                         AttrProp.CDATA | AttrProp.REQUIRED,
80                         null, null);
81         this.createAttribute(CUSTOM_RESOURCE, "object-type", "ObjectType",
82                         AttrProp.CDATA,
83                         null, "user");
84         this.createAttribute(CUSTOM_RESOURCE, "enabled", "Enabled",
85                         AttrProp.CDATA,
86                         null, "true");
87         this.createProperty("external-jndi-resource", EXTERNAL_JNDI_RESOURCE, Common.SEQUENCE_OR |
88             Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY,
89             ExternalJndiResource.class);
90         this.createAttribute(EXTERNAL_JNDI_RESOURCE, "jndi-name", "JndiName",
91                         AttrProp.CDATA | AttrProp.REQUIRED,
92                         null, null);
93         this.createAttribute(EXTERNAL_JNDI_RESOURCE, "jndi-lookup-name", "JndiLookupName",
94                         AttrProp.CDATA | AttrProp.REQUIRED,
95                         null, null);
96         this.createAttribute(EXTERNAL_JNDI_RESOURCE, "res-type", "ResType",
97                         AttrProp.CDATA | AttrProp.REQUIRED,
98                         null, null);
99         this.createAttribute(EXTERNAL_JNDI_RESOURCE, "factory-class", "FactoryClass",
100                         AttrProp.CDATA | AttrProp.REQUIRED,
101                         null, null);
102         this.createAttribute(EXTERNAL_JNDI_RESOURCE, "object-type", "ObjectType",
103                         AttrProp.CDATA,
104                         null, "user");
105         this.createAttribute(EXTERNAL_JNDI_RESOURCE, "enabled", "Enabled",
106                         AttrProp.CDATA,
107                         null, "true");
108         this.createProperty("jdbc-resource", JDBC_RESOURCE, Common.SEQUENCE_OR |
109             Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY,
110             JdbcResource.class);
111         this.createAttribute(JDBC_RESOURCE, "jndi-name", "JndiName",
112                         AttrProp.CDATA | AttrProp.REQUIRED,
113                         null, null);
114         this.createAttribute(JDBC_RESOURCE, "pool-name", "PoolName",
115                         AttrProp.CDATA | AttrProp.REQUIRED,
116                         null, null);
117         this.createAttribute(JDBC_RESOURCE, "object-type", "ObjectType",
118                         AttrProp.CDATA,
119                         null, "user");
120         this.createAttribute(JDBC_RESOURCE, "enabled", "Enabled",
121                         AttrProp.CDATA,
122                         null, "true");
123         this.createProperty("mail-resource", MAIL_RESOURCE, Common.SEQUENCE_OR |
124             Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY,
125             MailResource.class);
126         this.createAttribute(MAIL_RESOURCE, "jndi-name", "JndiName",
127                         AttrProp.CDATA | AttrProp.REQUIRED,
128                         null, null);
129         this.createAttribute(MAIL_RESOURCE, "store-protocol", "StoreProtocol",
130                         AttrProp.CDATA,
131                         null, "imap");
132         this.createAttribute(MAIL_RESOURCE, "store-protocol-class", "StoreProtocolClass",
133                         AttrProp.CDATA,
134                         null, "com.sun.mail.imap.IMAPStore");
135         this.createAttribute(MAIL_RESOURCE, "transport-protocol", "TransportProtocol",
136                         AttrProp.CDATA,
137                         null, "smtp");
138         this.createAttribute(MAIL_RESOURCE, "transport-protocol-class", "TransportProtocolClass",
139                         AttrProp.CDATA,
140                         null, "com.sun.mail.smtp.SMTPTransport");
141         this.createAttribute(MAIL_RESOURCE, "host", "Host",
142                         AttrProp.CDATA | AttrProp.REQUIRED,
143                         null, null);
144         this.createAttribute(MAIL_RESOURCE, "user", "User",
145                         AttrProp.CDATA | AttrProp.REQUIRED,
146                         null, null);
147         this.createAttribute(MAIL_RESOURCE, "from", "From",
148                         AttrProp.CDATA | AttrProp.REQUIRED,
149                         null, null);
150         this.createAttribute(MAIL_RESOURCE, "debug", "Debug",
151                         AttrProp.CDATA,
152                         null, "false");
153         this.createAttribute(MAIL_RESOURCE, "object-type", "ObjectType",
154                         AttrProp.CDATA,
155                         null, "user");
156         this.createAttribute(MAIL_RESOURCE, "enabled", "Enabled",
157                         AttrProp.CDATA,
158                         null, "true");
159         this.createProperty("persistence-manager-factory-resource", PERSISTENCE_MANAGER_FACTORY_RESOURCE, Common.SEQUENCE_OR |
160             Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY,
161             PersistenceManagerFactoryResource.class);
162         this.createAttribute(PERSISTENCE_MANAGER_FACTORY_RESOURCE, "jndi-name", "JndiName",
163                         AttrProp.CDATA | AttrProp.REQUIRED,
164                         null, null);
165         this.createAttribute(PERSISTENCE_MANAGER_FACTORY_RESOURCE, "factory-class", "FactoryClass",
166                         AttrProp.CDATA,
167                         null, "com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerFactoryImpl");
168         this.createAttribute(PERSISTENCE_MANAGER_FACTORY_RESOURCE, "jdbc-resource-jndi-name", "JdbcResourceJndiName",
169                         AttrProp.CDATA | AttrProp.IMPLIED,
170                         null, null);
171         this.createAttribute(PERSISTENCE_MANAGER_FACTORY_RESOURCE, "object-type", "ObjectType",
172                         AttrProp.CDATA,
173                         null, "user");
174         this.createAttribute(PERSISTENCE_MANAGER_FACTORY_RESOURCE, "enabled", "Enabled",
175                         AttrProp.CDATA,
176                         null, "true");
177         this.createProperty("admin-object-resource", ADMIN_OBJECT_RESOURCE, Common.SEQUENCE_OR |
178             Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY,
179             AdminObjectResource.class);
180         this.createAttribute(ADMIN_OBJECT_RESOURCE, "jndi-name", "JndiName",
181                         AttrProp.CDATA | AttrProp.REQUIRED,
182                         null, null);
183         this.createAttribute(ADMIN_OBJECT_RESOURCE, "res-type", "ResType",
184                         AttrProp.CDATA | AttrProp.REQUIRED,
185                         null, null);
186         this.createAttribute(ADMIN_OBJECT_RESOURCE, "res-adapter", "ResAdapter",
187                         AttrProp.CDATA | AttrProp.REQUIRED,
188                         null, null);
189         this.createAttribute(ADMIN_OBJECT_RESOURCE, "object-type", "ObjectType",
190                         AttrProp.CDATA,
191                         null, "user");
192         this.createAttribute(ADMIN_OBJECT_RESOURCE, "enabled", "Enabled",
193                         AttrProp.CDATA,
194                         null, "true");
195         this.createProperty("connector-resource", CONNECTOR_RESOURCE, Common.SEQUENCE_OR |
196             Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY,
197             ConnectorResource.class);
198         this.createAttribute(CONNECTOR_RESOURCE, "jndi-name", "JndiName",
199                         AttrProp.CDATA | AttrProp.REQUIRED,
200                         null, null);
201         this.createAttribute(CONNECTOR_RESOURCE, "pool-name", "PoolName",
202                         AttrProp.CDATA | AttrProp.REQUIRED,
203                         null, null);
204         this.createAttribute(CONNECTOR_RESOURCE, "object-type", "ObjectType",
205                         AttrProp.CDATA,
206                         null, "user");
207         this.createAttribute(CONNECTOR_RESOURCE, "enabled", "Enabled",
208                         AttrProp.CDATA,
209                         null, "true");
210         this.createProperty("resource-adapter-config", RESOURCE_ADAPTER_CONFIG, Common.SEQUENCE_OR |
211             Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY,
212             ResourceAdapterConfig.class);
213         this.createAttribute(RESOURCE_ADAPTER_CONFIG, "name", "Name",
214                         AttrProp.CDATA | AttrProp.IMPLIED,
215                         null, null);
216         this.createAttribute(RESOURCE_ADAPTER_CONFIG, "thread-pool-ids", "ThreadPoolIds",
217                         AttrProp.CDATA | AttrProp.IMPLIED,
218                         null, null);
219         this.createAttribute(RESOURCE_ADAPTER_CONFIG, "object-type", "ObjectType",
220                         AttrProp.CDATA,
221                         null, "user");
222         this.createAttribute(RESOURCE_ADAPTER_CONFIG, "resource-adapter-name", "ResourceAdapterName",
223                         AttrProp.CDATA | AttrProp.REQUIRED,
224                         null, null);
225         this.createProperty("jdbc-connection-pool", JDBC_CONNECTION_POOL, Common.SEQUENCE_OR |
226             Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY,
227             JdbcConnectionPool.class);
228         this.createAttribute(JDBC_CONNECTION_POOL, "name", "Name",
229                         AttrProp.CDATA | AttrProp.REQUIRED,
230                         null, null);
231         this.createAttribute(JDBC_CONNECTION_POOL, "datasource-classname", "DatasourceClassname",
232                         AttrProp.CDATA | AttrProp.REQUIRED,
233                         null, null);
234         this.createAttribute(JDBC_CONNECTION_POOL, "res-type", "ResType",
235                         AttrProp.CDATA | AttrProp.IMPLIED,
236                         null, null);
237         this.createAttribute(JDBC_CONNECTION_POOL, "steady-pool-size", "SteadyPoolSize",
238                         AttrProp.CDATA,
239                         null, "8");
240         this.createAttribute(JDBC_CONNECTION_POOL, "max-pool-size", "MaxPoolSize",
241                         AttrProp.CDATA,
242                         null, "32");
243         this.createAttribute(JDBC_CONNECTION_POOL, "max-wait-time-in-millis", "MaxWaitTimeInMillis",
244                         AttrProp.CDATA,
245                         null, "60000");
246         this.createAttribute(JDBC_CONNECTION_POOL, "pool-resize-quantity", "PoolResizeQuantity",
247                         AttrProp.CDATA,
248                         null, "2");
249         this.createAttribute(JDBC_CONNECTION_POOL, "idle-timeout-in-seconds", "IdleTimeoutInSeconds",
250                         AttrProp.CDATA,
251                         null, "300");
252         this.createAttribute(JDBC_CONNECTION_POOL, "transaction-isolation-level", "TransactionIsolationLevel",
253                         AttrProp.CDATA | AttrProp.IMPLIED,
254                         null, null);
255         this.createAttribute(JDBC_CONNECTION_POOL, "is-isolation-level-guaranteed", "IsIsolationLevelGuaranteed",
256                         AttrProp.CDATA,
257                         null, "true");
258         this.createAttribute(JDBC_CONNECTION_POOL, "is-connection-validation-required", "IsConnectionValidationRequired",
259                         AttrProp.CDATA,
260                         null, "false");
261         this.createAttribute(JDBC_CONNECTION_POOL, "connection-validation-method", "ConnectionValidationMethod",
262                         AttrProp.CDATA,
263                         null, "auto-commit");
264         this.createAttribute(JDBC_CONNECTION_POOL, "validation-table-name", "ValidationTableName",
265                         AttrProp.CDATA | AttrProp.IMPLIED,
266                         null, null);
267         this.createAttribute(JDBC_CONNECTION_POOL, "fail-all-connections", "FailAllConnections",
268                         AttrProp.CDATA,
269                         null, "false");
270         this.createAttribute(JDBC_CONNECTION_POOL, "non-transactional-connections", "NonTransactionalConnections",
271                         AttrProp.CDATA,
272                         null, "false");
273         this.createAttribute(JDBC_CONNECTION_POOL, "allow-non-component-callers", "AllowNonComponentCallers",
274                         AttrProp.CDATA,
275                         null, "false");
276         this.createProperty("connector-connection-pool", CONNECTOR_CONNECTION_POOL, Common.SEQUENCE_OR |
277             Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY,
278             ConnectorConnectionPool.class);
279         this.createAttribute(CONNECTOR_CONNECTION_POOL, "name", "Name",
280                         AttrProp.CDATA | AttrProp.REQUIRED,
281                         null, null);
282         this.createAttribute(CONNECTOR_CONNECTION_POOL, "resource-adapter-name", "ResourceAdapterName",
283                         AttrProp.CDATA | AttrProp.REQUIRED,
284                         null, null);
285         this.createAttribute(CONNECTOR_CONNECTION_POOL, "connection-definition-name", "ConnectionDefinitionName",
286                         AttrProp.CDATA | AttrProp.REQUIRED,
287                         null, null);
288         this.createAttribute(CONNECTOR_CONNECTION_POOL, "steady-pool-size", "SteadyPoolSize",
289                         AttrProp.CDATA,
290                         null, "8");
291         this.createAttribute(CONNECTOR_CONNECTION_POOL, "max-pool-size", "MaxPoolSize",
292                         AttrProp.CDATA,
293                         null, "32");
294         this.createAttribute(CONNECTOR_CONNECTION_POOL, "max-wait-time-in-millis", "MaxWaitTimeInMillis",
295                         AttrProp.CDATA,
296                         null, "60000");
297         this.createAttribute(CONNECTOR_CONNECTION_POOL, "pool-resize-quantity", "PoolResizeQuantity",
298                         AttrProp.CDATA,
299                         null, "2");
300         this.createAttribute(CONNECTOR_CONNECTION_POOL, "idle-timeout-in-seconds", "IdleTimeoutInSeconds",
301                         AttrProp.CDATA,
302                         null, "300");
303         this.createAttribute(CONNECTOR_CONNECTION_POOL, "fail-all-connections", "FailAllConnections",
304                         AttrProp.CDATA,
305                         null, "false");
306         this.createAttribute(CONNECTOR_CONNECTION_POOL, "transaction-support", "TransactionSupport",
307                         AttrProp.CDATA | AttrProp.IMPLIED,
308                         null, null);
309         this.createAttribute(CONNECTOR_CONNECTION_POOL, "is-connection-validation-required", "IsConnectionValidationRequired",
310                         AttrProp.CDATA,
311                         null, "false");
312         this.initialize(options);
313     }
314
315     // Setting the default values of the properties
316
void initialize(int options) {
317
318     }
319
320     // This attribute is an array, possibly empty
321
public void setCustomResource(int index, CustomResource value) {
322         this.setValue(CUSTOM_RESOURCE, index, value);
323     }
324
325     // Get Method
326
public CustomResource getCustomResource(int index) {
327         return (CustomResource)this.getValue(CUSTOM_RESOURCE, index);
328     }
329
330     // This attribute is an array, possibly empty
331
public void setCustomResource(CustomResource[] value) {
332         this.setValue(CUSTOM_RESOURCE, value);
333     }
334
335     // Getter Method
336
public CustomResource[] getCustomResource() {
337         return (CustomResource[])this.getValues(CUSTOM_RESOURCE);
338     }
339
340     // Return the number of properties
341
public int sizeCustomResource() {
342         return this.size(CUSTOM_RESOURCE);
343     }
344
345     // Add a new element returning its index in the list
346
public int addCustomResource(CustomResource value)
347             throws ConfigException{
348         return addCustomResource(value, true);
349     }
350
351     // Add a new element returning its index in the list with a boolean flag
352
public int addCustomResource(CustomResource value, boolean overwrite)
353             throws ConfigException{
354         CustomResource old = getCustomResourceByJndiName(value.getJndiName());
355         if(old != null) {
356             throw new ConfigException(StringManager.getManager(Resources.class).getString("cannotAddDuplicate", "CustomResource"));
357         }
358         return this.addValue(CUSTOM_RESOURCE, value, overwrite);
359     }
360
361     //
362
// Remove an element using its reference
363
// Returns the index the element had in the list
364
//
365
public int removeCustomResource(CustomResource value){
366         return this.removeValue(CUSTOM_RESOURCE, value);
367     }
368
369     //
370
// Remove an element using its reference
371
// Returns the index the element had in the list
372
// with boolean overwrite
373
//
374
public int removeCustomResource(CustomResource value, boolean overwrite)
375             throws StaleWriteConfigException{
376         return this.removeValue(CUSTOM_RESOURCE, value, overwrite);
377     }
378
379     public CustomResource getCustomResourceByJndiName(String JavaDoc id) {
380      if (null != id) { id = id.trim(); }
381     CustomResource[] o = getCustomResource();
382      if (o == null) return null;
383
384      for (int i=0; i < o.length; i++) {
385          if(o[i].getAttributeValue(Common.convertName(ServerTags.JNDI_NAME)).equals(id)) {
386              return o[i];
387          }
388      }
389
390         return null;
391         
392     }
393     // This attribute is an array, possibly empty
394
public void setExternalJndiResource(int index, ExternalJndiResource value) {
395         this.setValue(EXTERNAL_JNDI_RESOURCE, index, value);
396     }
397
398     // Get Method
399
public ExternalJndiResource getExternalJndiResource(int index) {
400         return (ExternalJndiResource)this.getValue(EXTERNAL_JNDI_RESOURCE, index);
401     }
402
403     // This attribute is an array, possibly empty
404
public void setExternalJndiResource(ExternalJndiResource[] value) {
405         this.setValue(EXTERNAL_JNDI_RESOURCE, value);
406     }
407
408     // Getter Method
409
public ExternalJndiResource[] getExternalJndiResource() {
410         return (ExternalJndiResource[])this.getValues(EXTERNAL_JNDI_RESOURCE);
411     }
412
413     // Return the number of properties
414
public int sizeExternalJndiResource() {
415         return this.size(EXTERNAL_JNDI_RESOURCE);
416     }
417
418     // Add a new element returning its index in the list
419
public int addExternalJndiResource(ExternalJndiResource value)
420             throws ConfigException{
421         return addExternalJndiResource(value, true);
422     }
423
424     // Add a new element returning its index in the list with a boolean flag
425
public int addExternalJndiResource(ExternalJndiResource value, boolean overwrite)
426             throws ConfigException{
427         ExternalJndiResource old = getExternalJndiResourceByJndiName(value.getJndiName());
428         if(old != null) {
429             throw new ConfigException(StringManager.getManager(Resources.class).getString("cannotAddDuplicate", "ExternalJndiResource"));
430         }
431         return this.addValue(EXTERNAL_JNDI_RESOURCE, value, overwrite);
432     }
433
434     //
435
// Remove an element using its reference
436
// Returns the index the element had in the list
437
//
438
public int removeExternalJndiResource(ExternalJndiResource value){
439         return this.removeValue(EXTERNAL_JNDI_RESOURCE, value);
440     }
441
442     //
443
// Remove an element using its reference
444
// Returns the index the element had in the list
445
// with boolean overwrite
446
//
447
public int removeExternalJndiResource(ExternalJndiResource value, boolean overwrite)
448             throws StaleWriteConfigException{
449         return this.removeValue(EXTERNAL_JNDI_RESOURCE, value, overwrite);
450     }
451
452     public ExternalJndiResource getExternalJndiResourceByJndiName(String JavaDoc id) {
453      if (null != id) { id = id.trim(); }
454     ExternalJndiResource[] o = getExternalJndiResource();
455      if (o == null) return null;
456
457      for (int i=0; i < o.length; i++) {
458          if(o[i].getAttributeValue(Common.convertName(ServerTags.JNDI_NAME)).equals(id)) {
459              return o[i];
460          }
461      }
462
463         return null;
464         
465     }
466     // This attribute is an array, possibly empty
467
public void setJdbcResource(int index, JdbcResource value) {
468         this.setValue(JDBC_RESOURCE, index, value);
469     }
470
471     // Get Method
472
public JdbcResource getJdbcResource(int index) {
473         return (JdbcResource)this.getValue(JDBC_RESOURCE, index);
474     }
475
476     // This attribute is an array, possibly empty
477
public void setJdbcResource(JdbcResource[] value) {
478         this.setValue(JDBC_RESOURCE, value);
479     }
480
481     // Getter Method
482
public JdbcResource[] getJdbcResource() {
483         return (JdbcResource[])this.getValues(JDBC_RESOURCE);
484     }
485
486     // Return the number of properties
487
public int sizeJdbcResource() {
488         return this.size(JDBC_RESOURCE);
489     }
490
491     // Add a new element returning its index in the list
492
public int addJdbcResource(JdbcResource value)
493             throws ConfigException{
494         return addJdbcResource(value, true);
495     }
496
497     // Add a new element returning its index in the list with a boolean flag
498
public int addJdbcResource(JdbcResource value, boolean overwrite)
499             throws ConfigException{
500         JdbcResource old = getJdbcResourceByJndiName(value.getJndiName());
501         if(old != null) {
502             throw new ConfigException(StringManager.getManager(Resources.class).getString("cannotAddDuplicate", "JdbcResource"));
503         }
504         return this.addValue(JDBC_RESOURCE, value, overwrite);
505     }
506
507     //
508
// Remove an element using its reference
509
// Returns the index the element had in the list
510
//
511
public int removeJdbcResource(JdbcResource value){
512         return this.removeValue(JDBC_RESOURCE, value);
513     }
514
515     //
516
// Remove an element using its reference
517
// Returns the index the element had in the list
518
// with boolean overwrite
519
//
520
public int removeJdbcResource(JdbcResource value, boolean overwrite)
521             throws StaleWriteConfigException{
522         return this.removeValue(JDBC_RESOURCE, value, overwrite);
523     }
524
525     public JdbcResource getJdbcResourceByJndiName(String JavaDoc id) {
526      if (null != id) { id = id.trim(); }
527     JdbcResource[] o = getJdbcResource();
528      if (o == null) return null;
529
530      for (int i=0; i < o.length; i++) {
531          if(o[i].getAttributeValue(Common.convertName(ServerTags.JNDI_NAME)).equals(id)) {
532              return o[i];
533          }
534      }
535
536         return null;
537         
538     }
539     // This attribute is an array, possibly empty
540
public void setMailResource(int index, MailResource value) {
541         this.setValue(MAIL_RESOURCE, index, value);
542     }
543
544     // Get Method
545
public MailResource getMailResource(int index) {
546         return (MailResource)this.getValue(MAIL_RESOURCE, index);
547     }
548
549     // This attribute is an array, possibly empty
550
public void setMailResource(MailResource[] value) {
551         this.setValue(MAIL_RESOURCE, value);
552     }
553
554     // Getter Method
555
public MailResource[] getMailResource() {
556         return (MailResource[])this.getValues(MAIL_RESOURCE);
557     }
558
559     // Return the number of properties
560
public int sizeMailResource() {
561         return this.size(MAIL_RESOURCE);
562     }
563
564     // Add a new element returning its index in the list
565
public int addMailResource(MailResource value)
566             throws ConfigException{
567         return addMailResource(value, true);
568     }
569
570     // Add a new element returning its index in the list with a boolean flag
571
public int addMailResource(MailResource value, boolean overwrite)
572             throws ConfigException{
573         MailResource old = getMailResourceByJndiName(value.getJndiName());
574         if(old != null) {
575             throw new ConfigException(StringManager.getManager(Resources.class).getString("cannotAddDuplicate", "MailResource"));
576         }
577         return this.addValue(MAIL_RESOURCE, value, overwrite);
578     }
579
580     //
581
// Remove an element using its reference
582
// Returns the index the element had in the list
583
//
584
public int removeMailResource(MailResource value){
585         return this.removeValue(MAIL_RESOURCE, value);
586     }
587
588     //
589
// Remove an element using its reference
590
// Returns the index the element had in the list
591
// with boolean overwrite
592
//
593
public int removeMailResource(MailResource value, boolean overwrite)
594             throws StaleWriteConfigException{
595         return this.removeValue(MAIL_RESOURCE, value, overwrite);
596     }
597
598     public MailResource getMailResourceByJndiName(String JavaDoc id) {
599      if (null != id) { id = id.trim(); }
600     MailResource[] o = getMailResource();
601      if (o == null) return null;
602
603      for (int i=0; i < o.length; i++) {
604          if(o[i].getAttributeValue(Common.convertName(ServerTags.JNDI_NAME)).equals(id)) {
605              return o[i];
606          }
607      }
608
609         return null;
610         
611     }
612     // This attribute is an array, possibly empty
613
public void setPersistenceManagerFactoryResource(int index, PersistenceManagerFactoryResource value) {
614         this.setValue(PERSISTENCE_MANAGER_FACTORY_RESOURCE, index, value);
615     }
616
617     // Get Method
618
public PersistenceManagerFactoryResource getPersistenceManagerFactoryResource(int index) {
619         return (PersistenceManagerFactoryResource)this.getValue(PERSISTENCE_MANAGER_FACTORY_RESOURCE, index);
620     }
621
622     // This attribute is an array, possibly empty
623
public void setPersistenceManagerFactoryResource(PersistenceManagerFactoryResource[] value) {
624         this.setValue(PERSISTENCE_MANAGER_FACTORY_RESOURCE, value);
625     }
626
627     // Getter Method
628
public PersistenceManagerFactoryResource[] getPersistenceManagerFactoryResource() {
629         return (PersistenceManagerFactoryResource[])this.getValues(PERSISTENCE_MANAGER_FACTORY_RESOURCE);
630     }
631
632     // Return the number of properties
633
public int sizePersistenceManagerFactoryResource() {
634         return this.size(PERSISTENCE_MANAGER_FACTORY_RESOURCE);
635     }
636
637     // Add a new element returning its index in the list
638
public int addPersistenceManagerFactoryResource(PersistenceManagerFactoryResource value)
639             throws ConfigException{
640         return addPersistenceManagerFactoryResource(value, true);
641     }
642
643     // Add a new element returning its index in the list with a boolean flag
644
public int addPersistenceManagerFactoryResource(PersistenceManagerFactoryResource value, boolean overwrite)
645             throws ConfigException{
646         PersistenceManagerFactoryResource old = getPersistenceManagerFactoryResourceByJndiName(value.getJndiName());
647         if(old != null) {
648             throw new ConfigException(StringManager.getManager(Resources.class).getString("cannotAddDuplicate", "PersistenceManagerFactoryResource"));
649         }
650         return this.addValue(PERSISTENCE_MANAGER_FACTORY_RESOURCE, value, overwrite);
651     }
652
653     //
654
// Remove an element using its reference
655
// Returns the index the element had in the list
656
//
657
public int removePersistenceManagerFactoryResource(PersistenceManagerFactoryResource value){
658         return this.removeValue(PERSISTENCE_MANAGER_FACTORY_RESOURCE, value);
659     }
660
661     //
662
// Remove an element using its reference
663
// Returns the index the element had in the list
664
// with boolean overwrite
665
//
666
public int removePersistenceManagerFactoryResource(PersistenceManagerFactoryResource value, boolean overwrite)
667             throws StaleWriteConfigException{
668         return this.removeValue(PERSISTENCE_MANAGER_FACTORY_RESOURCE, value, overwrite);
669     }
670
671     public PersistenceManagerFactoryResource getPersistenceManagerFactoryResourceByJndiName(String JavaDoc id) {
672      if (null != id) { id = id.trim(); }
673     PersistenceManagerFactoryResource[] o = getPersistenceManagerFactoryResource();
674      if (o == null) return null;
675
676      for (int i=0; i < o.length; i++) {
677          if(o[i].getAttributeValue(Common.convertName(ServerTags.JNDI_NAME)).equals(id)) {
678              return o[i];
679          }
680      }
681
682         return null;
683         
684     }
685     // This attribute is an array, possibly empty
686
public void setAdminObjectResource(int index, AdminObjectResource value) {
687         this.setValue(ADMIN_OBJECT_RESOURCE, index, value);
688     }
689
690     // Get Method
691
public AdminObjectResource getAdminObjectResource(int index) {
692         return (AdminObjectResource)this.getValue(ADMIN_OBJECT_RESOURCE, index);
693     }
694
695     // This attribute is an array, possibly empty
696
public void setAdminObjectResource(AdminObjectResource[] value) {
697         this.setValue(ADMIN_OBJECT_RESOURCE, value);
698     }
699
700     // Getter Method
701
public AdminObjectResource[] getAdminObjectResource() {
702         return (AdminObjectResource[])this.getValues(ADMIN_OBJECT_RESOURCE);
703     }
704
705     // Return the number of properties
706
public int sizeAdminObjectResource() {
707         return this.size(ADMIN_OBJECT_RESOURCE);
708     }
709
710     // Add a new element returning its index in the list
711
public int addAdminObjectResource(AdminObjectResource value)
712             throws ConfigException{
713         return addAdminObjectResource(value, true);
714     }
715
716     // Add a new element returning its index in the list with a boolean flag
717
public int addAdminObjectResource(AdminObjectResource value, boolean overwrite)
718             throws ConfigException{
719         AdminObjectResource old = getAdminObjectResourceByJndiName(value.getJndiName());
720         if(old != null) {
721             throw new ConfigException(StringManager.getManager(Resources.class).getString("cannotAddDuplicate", "AdminObjectResource"));
722         }
723         return this.addValue(ADMIN_OBJECT_RESOURCE, value, overwrite);
724     }
725
726     //
727
// Remove an element using its reference
728
// Returns the index the element had in the list
729
//
730
public int removeAdminObjectResource(AdminObjectResource value){
731         return this.removeValue(ADMIN_OBJECT_RESOURCE, value);
732     }
733
734     //
735
// Remove an element using its reference
736
// Returns the index the element had in the list
737
// with boolean overwrite
738
//
739
public int removeAdminObjectResource(AdminObjectResource value, boolean overwrite)
740             throws StaleWriteConfigException{
741         return this.removeValue(ADMIN_OBJECT_RESOURCE, value, overwrite);
742     }
743
744     public AdminObjectResource getAdminObjectResourceByJndiName(String JavaDoc id) {
745      if (null != id) { id = id.trim(); }
746     AdminObjectResource[] o = getAdminObjectResource();
747      if (o == null) return null;
748
749      for (int i=0; i < o.length; i++) {
750          if(o[i].getAttributeValue(Common.convertName(ServerTags.JNDI_NAME)).equals(id)) {
751              return o[i];
752          }
753      }
754
755         return null;
756         
757     }
758     // This attribute is an array, possibly empty
759
public void setConnectorResource(int index, ConnectorResource value) {
760         this.setValue(CONNECTOR_RESOURCE, index, value);
761     }
762
763     // Get Method
764
public ConnectorResource getConnectorResource(int index) {
765         return (ConnectorResource)this.getValue(CONNECTOR_RESOURCE, index);
766     }
767
768     // This attribute is an array, possibly empty
769
public void setConnectorResource(ConnectorResource[] value) {
770         this.setValue(CONNECTOR_RESOURCE, value);
771     }
772
773     // Getter Method
774
public ConnectorResource[] getConnectorResource() {
775         return (ConnectorResource[])this.getValues(CONNECTOR_RESOURCE);
776     }
777
778     // Return the number of properties
779
public int sizeConnectorResource() {
780         return this.size(CONNECTOR_RESOURCE);
781     }
782
783     // Add a new element returning its index in the list
784
public int addConnectorResource(ConnectorResource value)
785             throws ConfigException{
786         return addConnectorResource(value, true);
787     }
788
789     // Add a new element returning its index in the list with a boolean flag
790
public int addConnectorResource(ConnectorResource value, boolean overwrite)
791             throws ConfigException{
792         ConnectorResource old = getConnectorResourceByJndiName(value.getJndiName());
793         if(old != null) {
794             throw new ConfigException(StringManager.getManager(Resources.class).getString("cannotAddDuplicate", "ConnectorResource"));
795         }
796         return this.addValue(CONNECTOR_RESOURCE, value, overwrite);
797     }
798
799     //
800
// Remove an element using its reference
801
// Returns the index the element had in the list
802
//
803
public int removeConnectorResource(ConnectorResource value){
804         return this.removeValue(CONNECTOR_RESOURCE, value);
805     }
806
807     //
808
// Remove an element using its reference
809
// Returns the index the element had in the list
810
// with boolean overwrite
811
//
812
public int removeConnectorResource(ConnectorResource value, boolean overwrite)
813             throws StaleWriteConfigException{
814         return this.removeValue(CONNECTOR_RESOURCE, value, overwrite);
815     }
816
817     public ConnectorResource getConnectorResourceByJndiName(String JavaDoc id) {
818      if (null != id) { id = id.trim(); }
819     ConnectorResource[] o = getConnectorResource();
820      if (o == null) return null;
821
822      for (int i=0; i < o.length; i++) {
823          if(o[i].getAttributeValue(Common.convertName(ServerTags.JNDI_NAME)).equals(id)) {
824              return o[i];
825          }
826      }
827
828         return null;
829         
830     }
831     // This attribute is an array, possibly empty
832
public void setResourceAdapterConfig(int index, ResourceAdapterConfig value) {
833         this.setValue(RESOURCE_ADAPTER_CONFIG, index, value);
834     }
835
836     // Get Method
837
public ResourceAdapterConfig getResourceAdapterConfig(int index) {
838         return (ResourceAdapterConfig)this.getValue(RESOURCE_ADAPTER_CONFIG, index);
839     }
840
841     // This attribute is an array, possibly empty
842
public void setResourceAdapterConfig(ResourceAdapterConfig[] value) {
843         this.setValue(RESOURCE_ADAPTER_CONFIG, value);
844     }
845
846     // Getter Method
847
public ResourceAdapterConfig[] getResourceAdapterConfig() {
848         return (ResourceAdapterConfig[])this.getValues(RESOURCE_ADAPTER_CONFIG);
849     }
850
851     // Return the number of properties
852
public int sizeResourceAdapterConfig() {
853         return this.size(RESOURCE_ADAPTER_CONFIG);
854     }
855
856     // Add a new element returning its index in the list
857
public int addResourceAdapterConfig(ResourceAdapterConfig value)
858             throws ConfigException{
859         return addResourceAdapterConfig(value, true);
860     }
861
862     // Add a new element returning its index in the list with a boolean flag
863
public int addResourceAdapterConfig(ResourceAdapterConfig value, boolean overwrite)
864             throws ConfigException{
865         ResourceAdapterConfig old = getResourceAdapterConfigByResourceAdapterName(value.getResourceAdapterName());
866         if(old != null) {
867             throw new ConfigException(StringManager.getManager(Resources.class).getString("cannotAddDuplicate", "ResourceAdapterConfig"));
868         }
869         return this.addValue(RESOURCE_ADAPTER_CONFIG, value, overwrite);
870     }
871
872     //
873
// Remove an element using its reference
874
// Returns the index the element had in the list
875
//
876
public int removeResourceAdapterConfig(ResourceAdapterConfig value){
877         return this.removeValue(RESOURCE_ADAPTER_CONFIG, value);
878     }
879
880     //
881
// Remove an element using its reference
882
// Returns the index the element had in the list
883
// with boolean overwrite
884
//
885
public int removeResourceAdapterConfig(ResourceAdapterConfig value, boolean overwrite)
886             throws StaleWriteConfigException{
887         return this.removeValue(RESOURCE_ADAPTER_CONFIG, value, overwrite);
888     }
889
890     public ResourceAdapterConfig getResourceAdapterConfigByResourceAdapterName(String JavaDoc id) {
891      if (null != id) { id = id.trim(); }
892     ResourceAdapterConfig[] o = getResourceAdapterConfig();
893      if (o == null) return null;
894
895      for (int i=0; i < o.length; i++) {
896          if(o[i].getAttributeValue(Common.convertName(ServerTags.RESOURCE_ADAPTER_NAME)).equals(id)) {
897              return o[i];
898          }
899      }
900
901         return null;
902         
903     }
904     // This attribute is an array, possibly empty
905
public void setJdbcConnectionPool(int index, JdbcConnectionPool value) {
906         this.setValue(JDBC_CONNECTION_POOL, index, value);
907     }
908
909     // Get Method
910
public JdbcConnectionPool getJdbcConnectionPool(int index) {
911         return (JdbcConnectionPool)this.getValue(JDBC_CONNECTION_POOL, index);
912     }
913
914     // This attribute is an array, possibly empty
915
public void setJdbcConnectionPool(JdbcConnectionPool[] value) {
916         this.setValue(JDBC_CONNECTION_POOL, value);
917     }
918
919     // Getter Method
920
public JdbcConnectionPool[] getJdbcConnectionPool() {
921         return (JdbcConnectionPool[])this.getValues(JDBC_CONNECTION_POOL);
922     }
923
924     // Return the number of properties
925
public int sizeJdbcConnectionPool() {
926         return this.size(JDBC_CONNECTION_POOL);
927     }
928
929     // Add a new element returning its index in the list
930
public int addJdbcConnectionPool(JdbcConnectionPool value)
931             throws ConfigException{
932         return addJdbcConnectionPool(value, true);
933     }
934
935     // Add a new element returning its index in the list with a boolean flag
936
public int addJdbcConnectionPool(JdbcConnectionPool value, boolean overwrite)
937             throws ConfigException{
938         JdbcConnectionPool old = getJdbcConnectionPoolByName(value.getName());
939         if(old != null) {
940             throw new ConfigException(StringManager.getManager(Resources.class).getString("cannotAddDuplicate", "JdbcConnectionPool"));
941         }
942         return this.addValue(JDBC_CONNECTION_POOL, value, overwrite);
943     }
944
945     //
946
// Remove an element using its reference
947
// Returns the index the element had in the list
948
//
949
public int removeJdbcConnectionPool(JdbcConnectionPool value){
950         return this.removeValue(JDBC_CONNECTION_POOL, value);
951     }
952
953     //
954
// Remove an element using its reference
955
// Returns the index the element had in the list
956
// with boolean overwrite
957
//
958
public int removeJdbcConnectionPool(JdbcConnectionPool value, boolean overwrite)
959             throws StaleWriteConfigException{
960         return this.removeValue(JDBC_CONNECTION_POOL, value, overwrite);
961     }
962
963     public JdbcConnectionPool getJdbcConnectionPoolByName(String JavaDoc id) {
964      if (null != id) { id = id.trim(); }
965     JdbcConnectionPool[] o = getJdbcConnectionPool();
966      if (o == null) return null;
967
968      for (int i=0; i < o.length; i++) {
969          if(o[i].getAttributeValue(Common.convertName(ServerTags.NAME)).equals(id)) {
970              return o[i];
971          }
972      }
973
974         return null;
975         
976     }
977     // This attribute is an array, possibly empty
978
public void setConnectorConnectionPool(int index, ConnectorConnectionPool value) {
979         this.setValue(CONNECTOR_CONNECTION_POOL, index, value);
980     }
981
982     // Get Method
983
public ConnectorConnectionPool getConnectorConnectionPool(int index) {
984         return (ConnectorConnectionPool)this.getValue(CONNECTOR_CONNECTION_POOL, index);
985     }
986
987     // This attribute is an array, possibly empty
988
public void setConnectorConnectionPool(ConnectorConnectionPool[] value) {
989         this.setValue(CONNECTOR_CONNECTION_POOL, value);
990     }
991
992     // Getter Method
993
public ConnectorConnectionPool[] getConnectorConnectionPool() {
994         return (ConnectorConnectionPool[])this.getValues(CONNECTOR_CONNECTION_POOL);
995     }
996
997     // Return the number of properties
998
public int sizeConnectorConnectionPool() {
999         return this.size(CONNECTOR_CONNECTION_POOL);
1000    }
1001
1002    // Add a new element returning its index in the list
1003
public int addConnectorConnectionPool(ConnectorConnectionPool value)
1004            throws ConfigException{
1005        return addConnectorConnectionPool(value, true);
1006    }
1007
1008    // Add a new element returning its index in the list with a boolean flag
1009
public int addConnectorConnectionPool(ConnectorConnectionPool value, boolean overwrite)
1010            throws ConfigException{
1011        ConnectorConnectionPool old = getConnectorConnectionPoolByName(value.getName());
1012        if(old != null) {
1013            throw new ConfigException(StringManager.getManager(Resources.class).getString("cannotAddDuplicate", "ConnectorConnectionPool"));
1014        }
1015        return this.addValue(CONNECTOR_CONNECTION_POOL, value, overwrite);
1016    }
1017
1018    //
1019
// Remove an element using its reference
1020
// Returns the index the element had in the list
1021
//
1022
public int removeConnectorConnectionPool(ConnectorConnectionPool value){
1023        return this.removeValue(CONNECTOR_CONNECTION_POOL, value);
1024    }
1025
1026    //
1027
// Remove an element using its reference
1028
// Returns the index the element had in the list
1029
// with boolean overwrite
1030
//
1031
public int removeConnectorConnectionPool(ConnectorConnectionPool value, boolean overwrite)
1032            throws StaleWriteConfigException{
1033        return this.removeValue(CONNECTOR_CONNECTION_POOL, value, overwrite);
1034    }
1035
1036    public ConnectorConnectionPool getConnectorConnectionPoolByName(String JavaDoc id) {
1037     if (null != id) { id = id.trim(); }
1038    ConnectorConnectionPool[] o = getConnectorConnectionPool();
1039     if (o == null) return null;
1040
1041     for (int i=0; i < o.length; i++) {
1042         if(o[i].getAttributeValue(Common.convertName(ServerTags.NAME)).equals(id)) {
1043             return o[i];
1044         }
1045     }
1046
1047        return null;
1048        
1049    }
1050    /**
1051     * Create a new bean using it's default constructor.
1052     * This does not add it to any bean graph.
1053     */

1054    public CustomResource newCustomResource() {
1055        return new CustomResource();
1056    }
1057
1058    /**
1059     * Create a new bean using it's default constructor.
1060     * This does not add it to any bean graph.
1061     */

1062    public ExternalJndiResource newExternalJndiResource() {
1063        return new ExternalJndiResource();
1064    }
1065
1066    /**
1067     * Create a new bean using it's default constructor.
1068     * This does not add it to any bean graph.
1069     */

1070    public JdbcResource newJdbcResource() {
1071        return new JdbcResource();
1072    }
1073
1074    /**
1075     * Create a new bean using it's default constructor.
1076     * This does not add it to any bean graph.
1077     */

1078    public MailResource newMailResource() {
1079        return new MailResource();
1080    }
1081
1082    /**
1083     * Create a new bean using it's default constructor.
1084     * This does not add it to any bean graph.
1085     */

1086    public PersistenceManagerFactoryResource newPersistenceManagerFactoryResource() {
1087        return new PersistenceManagerFactoryResource();
1088    }
1089
1090    /**
1091     * Create a new bean using it's default constructor.
1092     * This does not add it to any bean graph.
1093     */

1094    public AdminObjectResource newAdminObjectResource() {
1095        return new AdminObjectResource();
1096    }
1097
1098    /**
1099     * Create a new bean using it's default constructor.
1100     * This does not add it to any bean graph.
1101     */

1102    public ConnectorResource newConnectorResource() {
1103        return new ConnectorResource();
1104    }
1105
1106    /**
1107     * Create a new bean using it's default constructor.
1108     * This does not add it to any bean graph.
1109     */

1110    public ResourceAdapterConfig newResourceAdapterConfig() {
1111        return new ResourceAdapterConfig();
1112    }
1113
1114    /**
1115     * Create a new bean using it's default constructor.
1116     * This does not add it to any bean graph.
1117     */

1118    public JdbcConnectionPool newJdbcConnectionPool() {
1119        return new JdbcConnectionPool();
1120    }
1121
1122    /**
1123     * Create a new bean using it's default constructor.
1124     * This does not add it to any bean graph.
1125     */

1126    public ConnectorConnectionPool newConnectorConnectionPool() {
1127        return new ConnectorConnectionPool();
1128    }
1129
1130    /**
1131    * get the xpath representation for this element
1132    * returns something like abc[@name='value'] or abc
1133    * depending on the type of the bean
1134    */

1135    protected String JavaDoc getRelativeXPath() {
1136        String JavaDoc ret = null;
1137        ret = "resources";
1138        return (null != ret ? ret.trim() : null);
1139    }
1140
1141    /*
1142    * generic method to get default value from dtd
1143    */

1144    public static String JavaDoc getDefaultAttributeValue(String JavaDoc attr) {
1145        if(attr == null) return null;
1146        attr = attr.trim();
1147    return null;
1148    }
1149    //
1150
public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
1151        comparators.add(c);
1152    }
1153
1154    //
1155
public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
1156        comparators.remove(c);
1157    }
1158    public void validate() throws org.netbeans.modules.schema2beans.ValidateException {
1159    }
1160
1161    // Dump the content of this bean returning it as a String
1162
public void dump(StringBuffer JavaDoc str, String JavaDoc indent){
1163        String JavaDoc s;
1164        Object JavaDoc o;
1165        org.netbeans.modules.schema2beans.BaseBean n;
1166        str.append(indent);
1167        str.append("CustomResource["+this.sizeCustomResource()+"]"); // NOI18N
1168
for(int i=0; i<this.sizeCustomResource(); i++)
1169        {
1170            str.append(indent+"\t");
1171            str.append("#"+i+":");
1172            n = (org.netbeans.modules.schema2beans.BaseBean) this.getCustomResource(i);
1173            if (n != null)
1174                n.dump(str, indent + "\t"); // NOI18N
1175
else
1176                str.append(indent+"\tnull"); // NOI18N
1177
this.dumpAttributes(CUSTOM_RESOURCE, i, str, indent);
1178        }
1179
1180        str.append(indent);
1181        str.append("ExternalJndiResource["+this.sizeExternalJndiResource()+"]"); // NOI18N
1182
for(int i=0; i<this.sizeExternalJndiResource(); i++)
1183        {
1184            str.append(indent+"\t");
1185            str.append("#"+i+":");
1186            n = (org.netbeans.modules.schema2beans.BaseBean) this.getExternalJndiResource(i);
1187            if (n != null)
1188                n.dump(str, indent + "\t"); // NOI18N
1189
else
1190                str.append(indent+"\tnull"); // NOI18N
1191
this.dumpAttributes(EXTERNAL_JNDI_RESOURCE, i, str, indent);
1192        }
1193
1194        str.append(indent);
1195        str.append("JdbcResource["+this.sizeJdbcResource()+"]"); // NOI18N
1196
for(int i=0; i<this.sizeJdbcResource(); i++)
1197        {
1198            str.append(indent+"\t");
1199            str.append("#"+i+":");
1200            n = (org.netbeans.modules.schema2beans.BaseBean) this.getJdbcResource(i);
1201            if (n != null)
1202                n.dump(str, indent + "\t"); // NOI18N
1203
else
1204                str.append(indent+"\tnull"); // NOI18N
1205
this.dumpAttributes(JDBC_RESOURCE, i, str, indent);
1206        }
1207
1208        str.append(indent);
1209        str.append("MailResource["+this.sizeMailResource()+"]"); // NOI18N
1210
for(int i=0; i<this.sizeMailResource(); i++)
1211        {
1212            str.append(indent+"\t");
1213            str.append("#"+i+":");
1214            n = (org.netbeans.modules.schema2beans.BaseBean) this.getMailResource(i);
1215            if (n != null)
1216                n.dump(str, indent + "\t"); // NOI18N
1217
else
1218                str.append(indent+"\tnull"); // NOI18N
1219
this.dumpAttributes(MAIL_RESOURCE, i, str, indent);
1220        }
1221
1222        str.append(indent);
1223        str.append("PersistenceManagerFactoryResource["+this.sizePersistenceManagerFactoryResource()+"]"); // NOI18N
1224
for(int i=0; i<this.sizePersistenceManagerFactoryResource(); i++)
1225        {
1226            str.append(indent+"\t");
1227            str.append("#"+i+":");
1228            n = (org.netbeans.modules.schema2beans.BaseBean) this.getPersistenceManagerFactoryResource(i);
1229            if (n != null)
1230                n.dump(str, indent + "\t"); // NOI18N
1231
else
1232                str.append(indent+"\tnull"); // NOI18N
1233
this.dumpAttributes(PERSISTENCE_MANAGER_FACTORY_RESOURCE, i, str, indent);
1234        }
1235
1236        str.append(indent);
1237        str.append("AdminObjectResource["+this.sizeAdminObjectResource()+"]"); // NOI18N
1238
for(int i=0; i<this.sizeAdminObjectResource(); i++)
1239        {
1240            str.append(indent+"\t");
1241            str.append("#"+i+":");
1242            n = (org.netbeans.modules.schema2beans.BaseBean) this.getAdminObjectResource(i);
1243            if (n != null)
1244                n.dump(str, indent + "\t"); // NOI18N
1245
else
1246                str.append(indent+"\tnull"); // NOI18N
1247
this.dumpAttributes(ADMIN_OBJECT_RESOURCE, i, str, indent);
1248        }
1249
1250        str.append(indent);
1251        str.append("ConnectorResource["+this.sizeConnectorResource()+"]"); // NOI18N
1252
for(int i=0; i<this.sizeConnectorResource(); i++)
1253        {
1254            str.append(indent+"\t");
1255            str.append("#"+i+":");
1256            n = (org.netbeans.modules.schema2beans.BaseBean) this.getConnectorResource(i);
1257            if (n != null)
1258                n.dump(str, indent + "\t"); // NOI18N
1259
else
1260                str.append(indent+"\tnull"); // NOI18N
1261
this.dumpAttributes(CONNECTOR_RESOURCE, i, str, indent);
1262        }
1263
1264        str.append(indent);
1265        str.append("ResourceAdapterConfig["+this.sizeResourceAdapterConfig()+"]"); // NOI18N
1266
for(int i=0; i<this.sizeResourceAdapterConfig(); i++)
1267        {
1268            str.append(indent+"\t");
1269            str.append("#"+i+":");
1270            n = (org.netbeans.modules.schema2beans.BaseBean) this.getResourceAdapterConfig(i);
1271            if (n != null)
1272                n.dump(str, indent + "\t"); // NOI18N
1273
else
1274                str.append(indent+"\tnull"); // NOI18N
1275
this.dumpAttributes(RESOURCE_ADAPTER_CONFIG, i, str, indent);
1276        }
1277
1278        str.append(indent);
1279        str.append("JdbcConnectionPool["+this.sizeJdbcConnectionPool()+"]"); // NOI18N
1280
for(int i=0; i<this.sizeJdbcConnectionPool(); i++)
1281        {
1282            str.append(indent+"\t");
1283            str.append("#"+i+":");
1284            n = (org.netbeans.modules.schema2beans.BaseBean) this.getJdbcConnectionPool(i);
1285            if (n != null)
1286                n.dump(str, indent + "\t"); // NOI18N
1287
else
1288                str.append(indent+"\tnull"); // NOI18N
1289
this.dumpAttributes(JDBC_CONNECTION_POOL, i, str, indent);
1290        }
1291
1292        str.append(indent);
1293        str.append("ConnectorConnectionPool["+this.sizeConnectorConnectionPool()+"]"); // NOI18N
1294
for(int i=0; i<this.sizeConnectorConnectionPool(); i++)
1295        {
1296            str.append(indent+"\t");
1297            str.append("#"+i+":");
1298            n = (org.netbeans.modules.schema2beans.BaseBean) this.getConnectorConnectionPool(i);
1299            if (n != null)
1300                n.dump(str, indent + "\t"); // NOI18N
1301
else
1302                str.append(indent+"\tnull"); // NOI18N
1303
this.dumpAttributes(CONNECTOR_CONNECTION_POOL, i, str, indent);
1304        }
1305
1306    }
1307    public String JavaDoc dumpBeanNode(){
1308        StringBuffer JavaDoc str = new StringBuffer JavaDoc();
1309        str.append("Resources\n"); // NOI18N
1310
this.dump(str, "\n "); // NOI18N
1311
return str.toString();
1312    }}
1313
1314// END_NOI18N
1315

1316
Popular Tags