KickJava   Java API By Example, From Geeks To Geeks.

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


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 ConnectionPool matches the DTD element connection-pool
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 ConnectionPool 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
50     public ConnectionPool() {
51         this(Common.USE_DEFAULT_VALUES);
52     }
53
54     public ConnectionPool(int options)
55     {
56         super(comparators, runtimeVersion);
57         // Properties (see root bean comments for the bean graph)
58
initPropertyTables(0);
59         this.initialize(options);
60     }
61
62     // Setting the default values of the properties
63
void initialize(int options) {
64
65     }
66
67     /**
68     * Getter for QueueSizeInBytes of the Element connection-pool
69     * @return the QueueSizeInBytes of the Element connection-pool
70     */

71     public String JavaDoc getQueueSizeInBytes() {
72         return getAttributeValue(ServerTags.QUEUE_SIZE_IN_BYTES);
73     }
74     /**
75     * Modify the QueueSizeInBytes of the Element connection-pool
76     * @param v the new value
77     * @throws StaleWriteConfigException if overwrite is false and file changed on disk
78     */

79     public void setQueueSizeInBytes(String JavaDoc v, boolean overwrite) throws StaleWriteConfigException {
80         setAttributeValue(ServerTags.QUEUE_SIZE_IN_BYTES, v, overwrite);
81     }
82     /**
83     * Modify the QueueSizeInBytes of the Element connection-pool
84     * @param v the new value
85     */

86     public void setQueueSizeInBytes(String JavaDoc v) {
87         setAttributeValue(ServerTags.QUEUE_SIZE_IN_BYTES, v);
88     }
89     /**
90     * Get the default value of QueueSizeInBytes from dtd
91     */

92     public static String JavaDoc getDefaultQueueSizeInBytes() {
93         return "4096".trim();
94     }
95     /**
96     * Getter for MaxPendingCount of the Element connection-pool
97     * @return the MaxPendingCount of the Element connection-pool
98     */

99     public String JavaDoc getMaxPendingCount() {
100         return getAttributeValue(ServerTags.MAX_PENDING_COUNT);
101     }
102     /**
103     * Modify the MaxPendingCount of the Element connection-pool
104     * @param v the new value
105     * @throws StaleWriteConfigException if overwrite is false and file changed on disk
106     */

107     public void setMaxPendingCount(String JavaDoc v, boolean overwrite) throws StaleWriteConfigException {
108         setAttributeValue(ServerTags.MAX_PENDING_COUNT, v, overwrite);
109     }
110     /**
111     * Modify the MaxPendingCount of the Element connection-pool
112     * @param v the new value
113     */

114     public void setMaxPendingCount(String JavaDoc v) {
115         setAttributeValue(ServerTags.MAX_PENDING_COUNT, v);
116     }
117     /**
118     * Get the default value of MaxPendingCount from dtd
119     */

120     public static String JavaDoc getDefaultMaxPendingCount() {
121         return "4096".trim();
122     }
123     /**
124     * Getter for ReceiveBufferSizeInBytes of the Element connection-pool
125     * @return the ReceiveBufferSizeInBytes of the Element connection-pool
126     */

127     public String JavaDoc getReceiveBufferSizeInBytes() {
128         return getAttributeValue(ServerTags.RECEIVE_BUFFER_SIZE_IN_BYTES);
129     }
130     /**
131     * Modify the ReceiveBufferSizeInBytes of the Element connection-pool
132     * @param v the new value
133     * @throws StaleWriteConfigException if overwrite is false and file changed on disk
134     */

135     public void setReceiveBufferSizeInBytes(String JavaDoc v, boolean overwrite) throws StaleWriteConfigException {
136         setAttributeValue(ServerTags.RECEIVE_BUFFER_SIZE_IN_BYTES, v, overwrite);
137     }
138     /**
139     * Modify the ReceiveBufferSizeInBytes of the Element connection-pool
140     * @param v the new value
141     */

142     public void setReceiveBufferSizeInBytes(String JavaDoc v) {
143         setAttributeValue(ServerTags.RECEIVE_BUFFER_SIZE_IN_BYTES, v);
144     }
145     /**
146     * Get the default value of ReceiveBufferSizeInBytes from dtd
147     */

148     public static String JavaDoc getDefaultReceiveBufferSizeInBytes() {
149         return "4096".trim();
150     }
151     /**
152     * Getter for SendBufferSizeInBytes of the Element connection-pool
153     * @return the SendBufferSizeInBytes of the Element connection-pool
154     */

155     public String JavaDoc getSendBufferSizeInBytes() {
156         return getAttributeValue(ServerTags.SEND_BUFFER_SIZE_IN_BYTES);
157     }
158     /**
159     * Modify the SendBufferSizeInBytes of the Element connection-pool
160     * @param v the new value
161     * @throws StaleWriteConfigException if overwrite is false and file changed on disk
162     */

163     public void setSendBufferSizeInBytes(String JavaDoc v, boolean overwrite) throws StaleWriteConfigException {
164         setAttributeValue(ServerTags.SEND_BUFFER_SIZE_IN_BYTES, v, overwrite);
165     }
166     /**
167     * Modify the SendBufferSizeInBytes of the Element connection-pool
168     * @param v the new value
169     */

170     public void setSendBufferSizeInBytes(String JavaDoc v) {
171         setAttributeValue(ServerTags.SEND_BUFFER_SIZE_IN_BYTES, v);
172     }
173     /**
174     * Get the default value of SendBufferSizeInBytes from dtd
175     */

176     public static String JavaDoc getDefaultSendBufferSizeInBytes() {
177         return "8192".trim();
178     }
179     /**
180     * get the xpath representation for this element
181     * returns something like abc[@name='value'] or abc
182     * depending on the type of the bean
183     */

184     protected String JavaDoc getRelativeXPath() {
185         String JavaDoc ret = null;
186         ret = "connection-pool";
187         return (null != ret ? ret.trim() : null);
188     }
189
190     /*
191     * generic method to get default value from dtd
192     */

193     public static String JavaDoc getDefaultAttributeValue(String JavaDoc attr) {
194         if(attr == null) return null;
195         attr = attr.trim();
196         if(attr.equals(ServerTags.QUEUE_SIZE_IN_BYTES)) return "4096".trim();
197         if(attr.equals(ServerTags.MAX_PENDING_COUNT)) return "4096".trim();
198         if(attr.equals(ServerTags.RECEIVE_BUFFER_SIZE_IN_BYTES)) return "4096".trim();
199         if(attr.equals(ServerTags.SEND_BUFFER_SIZE_IN_BYTES)) return "8192".trim();
200     return null;
201     }
202     //
203
public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
204         comparators.add(c);
205     }
206
207     //
208
public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
209         comparators.remove(c);
210     }
211     public void validate() throws org.netbeans.modules.schema2beans.ValidateException {
212     }
213
214     // Dump the content of this bean returning it as a String
215
public void dump(StringBuffer JavaDoc str, String JavaDoc indent){
216         String JavaDoc s;
217         Object JavaDoc o;
218         org.netbeans.modules.schema2beans.BaseBean n;
219     }
220     public String JavaDoc dumpBeanNode(){
221         StringBuffer JavaDoc str = new StringBuffer JavaDoc();
222         str.append("ConnectionPool\n"); // NOI18N
223
this.dump(str, "\n "); // NOI18N
224
return str.toString();
225     }}
226
227 // END_NOI18N
228

229
Popular Tags