KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > deployment > runtime > connector > ResourceAdapter


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 ResourceAdapter matches the DTD element resource-adapter
26  *
27  * Generated on Mon May 13 13:36:49 PDT 2002
28  */

29
30 package com.sun.enterprise.deployment.runtime.connector;
31
32 import com.sun.enterprise.deployment.runtime.RuntimeDescriptor;
33 import com.sun.enterprise.deployment.NameValuePairDescriptor;
34
35 /**
36  * This class was based on the schema2beans generated one modified
37  * to remove its dependencies on schema2beans libraries.
38  
39  * @author Jerome Dochez
40  * @version
41  */

42 public class ResourceAdapter extends RuntimeDescriptor
43 {
44     static public final String JavaDoc DESCRIPTION = "Description"; // NOI18N
45
static public final String JavaDoc PROPERTY = "PropertyElement"; // NOI18N
46

47     static public final String JavaDoc JNDI_NAME = "JndiName";
48     static public final String JavaDoc MAX_POOL_SIZE = "MaxPoolSize";
49     static public final String JavaDoc STEADY_POOL_SIZE = "SteadyPoolSize";
50     static public final String JavaDoc MAX_WAIT_TIME_IN_MILLIS = "MaxWaitTimeInMillis";
51     static public final String JavaDoc IDLE_TIMEOUT_IN_SECONDS = "IdleTimeoutInSeconds";
52     
53     // This attribute is an array, possibly empty
54
public void setPropertyElement(int index, NameValuePairDescriptor value)
55     {
56     this.setValue(PROPERTY, index, value);
57     }
58     
59     //
60
public boolean isPropertyElement(int index)
61     {
62     NameValuePairDescriptor ret = (NameValuePairDescriptor)this.getValue(PROPERTY, index);
63     return ret != null;
64     }
65     
66     // This attribute is an array, possibly empty
67
public void setPropertyElement(NameValuePairDescriptor[] values)
68     {
69     this.setValues(PROPERTY, values);
70     }
71     
72     //
73
public NameValuePairDescriptor[] getPropertyElement()
74     {
75     return (NameValuePairDescriptor[])this.getValues(PROPERTY);
76     }
77     
78     // Return the number of properties
79
public int sizePropertyElement()
80     {
81     return this.size(PROPERTY);
82     }
83     
84     // Add a new element returning its index in the list
85
public int addPropertyElement(NameValuePairDescriptor value)
86     {
87     return this.addValue(PROPERTY, value);
88     }
89     
90     //
91
// Remove an element using its reference
92
// Returns the index the element had in the list
93
//
94
public int removePropertyElement(NameValuePairDescriptor value)
95     {
96     return this.removeValue(PROPERTY, value);
97     }
98     
99     //
100
// Remove an element using its index
101
//
102
public void removePropertyElement(int index)
103     {
104     this.removeValue(PROPERTY, index);
105     }
106     
107     // This method verifies that the mandatory properties are set
108
public boolean verify()
109     {
110     return true;
111     }
112 }
113
Popular Tags