KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas_rar > deployment > xml > Resourceadapter


1 /**
2  * JOnAS: Java(TM) Open Application Server
3  * Copyright (C) 1999 Bull S.A.
4  * Contact: jonas-team@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  *
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or 1any later version.
11  *
12  * This library 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 library; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20  * USA
21  *
22  * Initial developer: Florent BENOIT
23  * --------------------------------------------------------------------------
24  * $Id: Resourceadapter.java,v 1.3 2004/10/29 23:33:37 ehardesty Exp $
25  * --------------------------------------------------------------------------
26  */

27 package org.objectweb.jonas_rar.deployment.xml;
28
29 import org.objectweb.jonas_lib.deployment.xml.AbsElement;
30 import org.objectweb.jonas_lib.deployment.xml.JLinkedList;
31 /**
32  * This class defines the implementation of the element resourceadapter
33  *
34  * @author Florent Benoit
35  */

36
37 public class Resourceadapter extends AbsElement {
38
39     /**
40      * resourceadapter-class
41      */

42     private String JavaDoc resourceadapterClass = null;
43
44     /**
45      * managedconnectionfactory-class
46      */

47     private String JavaDoc managedconnectionfactoryClass = null;
48
49     /**
50      * connectionfactory-interface
51      */

52     private String JavaDoc connectionfactoryInterface = null;
53
54     /**
55      * connectionfactory-impl-class
56      */

57     private String JavaDoc connectionfactoryImplClass = null;
58
59     /**
60      * connection-interface
61      */

62     private String JavaDoc connectionInterface = null;
63
64     /**
65      * connection-impl-class
66      */

67     private String JavaDoc connectionImplClass = null;
68
69     /**
70      * transaction-support
71      */

72     private String JavaDoc transactionSupport = null;
73
74     /**
75      * config-property
76      */

77     private JLinkedList configPropertyList = null;
78
79     /**
80      * authentication-mechanism
81      */

82     private JLinkedList authenticationMechanismList = null;
83
84     /**
85      * outbound-resourceadapter
86      */

87     private OutboundResourceadapter outboundResourceadapter = null;
88
89     /**
90      * inbound-resourceadapter
91      */

92     private InboundResourceadapter inboundResourceadapter = null;
93
94     /**
95      * adminobject
96      */

97     private JLinkedList adminobjectList = null;
98
99     /**
100      * reauthentication-support
101      */

102     private String JavaDoc reauthenticationSupport = null;
103
104     /**
105      * security-permission
106      */

107     private JLinkedList securityPermissionList = null;
108
109
110     /**
111      * Constructor
112      */

113     public Resourceadapter() {
114         super();
115         configPropertyList = new JLinkedList("config-property");
116         authenticationMechanismList = new JLinkedList("authentication-mechanism");
117         adminobjectList = new JLinkedList("adminobject");
118         securityPermissionList = new JLinkedList("security-permission");
119     }
120
121     /**
122      * Gets the resourceadapter-class
123      * @return the resourceadapter-class
124      */

125     public String JavaDoc getResourceadapterClass() {
126         return resourceadapterClass;
127     }
128
129     /**
130      * Set the resourceadapter-class
131      * @param resourceadapterClass resourceadapterClass
132      */

133     public void setResourceadapterClass(String JavaDoc resourceadapterClass) {
134         this.resourceadapterClass = resourceadapterClass;
135     }
136
137     /**
138      * Gets the managedconnectionfactory-class
139      * @return the managedconnectionfactory-class
140      */

141     public String JavaDoc getManagedconnectionfactoryClass() {
142         return managedconnectionfactoryClass;
143     }
144
145     /**
146      * Set the managedconnectionfactory-class
147      * @param managedconnectionfactoryClass managedconnectionfactoryClass
148      */

149     public void setManagedconnectionfactoryClass(String JavaDoc managedconnectionfactoryClass) {
150         this.managedconnectionfactoryClass = managedconnectionfactoryClass;
151     }
152
153     /**
154      * Gets the connectionfactory-interface
155      * @return the connectionfactory-interface
156      */

157     public String JavaDoc getConnectionfactoryInterface() {
158         return connectionfactoryInterface;
159     }
160
161     /**
162      * Set the connectionfactory-interface
163      * @param connectionfactoryInterface connectionfactoryInterface
164      */

165     public void setConnectionfactoryInterface(String JavaDoc connectionfactoryInterface) {
166         this.connectionfactoryInterface = connectionfactoryInterface;
167     }
168
169     /**
170      * Gets the connectionfactory-impl-class
171      * @return the connectionfactory-impl-class
172      */

173     public String JavaDoc getConnectionfactoryImplClass() {
174         return connectionfactoryImplClass;
175     }
176
177     /**
178      * Set the connectionfactory-impl-class
179      * @param connectionfactoryImplClass connectionfactoryImplClass
180      */

181     public void setConnectionfactoryImplClass(String JavaDoc connectionfactoryImplClass) {
182         this.connectionfactoryImplClass = connectionfactoryImplClass;
183     }
184
185     /**
186      * Gets the connection-interface
187      * @return the connection-interface
188      */

189     public String JavaDoc getConnectionInterface() {
190         return connectionInterface;
191     }
192
193     /**
194      * Set the connection-interface
195      * @param connectionInterface connectionInterface
196      */

197     public void setConnectionInterface(String JavaDoc connectionInterface) {
198         this.connectionInterface = connectionInterface;
199     }
200
201     /**
202      * Gets the connection-impl-class
203      * @return the connection-impl-class
204      */

205     public String JavaDoc getConnectionImplClass() {
206         return connectionImplClass;
207     }
208
209     /**
210      * Set the connection-impl-class
211      * @param connectionImplClass connectionImplClass
212      */

213     public void setConnectionImplClass(String JavaDoc connectionImplClass) {
214         this.connectionImplClass = connectionImplClass;
215     }
216
217     /**
218      * Gets the transaction-support
219      * @return the transaction-support
220      */

221     public String JavaDoc getTransactionSupport() {
222         return transactionSupport;
223     }
224
225     /**
226      * Set the transaction-support
227      * @param transactionSupport transactionSupport
228      */

229     public void setTransactionSupport(String JavaDoc transactionSupport) {
230         this.transactionSupport = transactionSupport;
231     }
232
233     /**
234      * Gets the config-property
235      * @return the config-property
236      */

237     public JLinkedList getConfigPropertyList() {
238         return configPropertyList;
239     }
240
241     /**
242      * Set the config-property
243      * @param configPropertyList configProperty
244      */

245     public void setConfigPropertyList(JLinkedList configPropertyList) {
246         this.configPropertyList = configPropertyList;
247     }
248
249     /**
250      * Add a new config-property element to this object
251      * @param configProperty the configPropertyobject
252      */

253     public void addConfigProperty(ConfigProperty configProperty) {
254         configPropertyList.add(configProperty);
255     }
256
257     /**
258      * Gets the authentication-mechanism
259      * @return the authentication-mechanism
260      */

261     public JLinkedList getAuthenticationMechanismList() {
262         return authenticationMechanismList;
263     }
264
265     /**
266      * Set the authentication-mechanism
267      * @param authenticationMechanismList authenticationMechanism
268      */

269     public void setAuthenticationMechanismList(JLinkedList authenticationMechanismList) {
270         this.authenticationMechanismList = authenticationMechanismList;
271     }
272
273     /**
274      * Add a new authentication-mechanism element to this object
275      * @param authenticationMechanism the authenticationMechanismobject
276      */

277     public void addAuthenticationMechanism(AuthenticationMechanism authenticationMechanism) {
278         authenticationMechanismList.add(authenticationMechanism);
279     }
280
281     /**
282      * Gets the outbound-resourceadapter
283      * @return the outbound-resourceadapter
284      */

285     public OutboundResourceadapter getOutboundResourceadapter() {
286         return outboundResourceadapter;
287     }
288
289     /**
290      * Set the outbound-resourceadapter
291      * @param outboundResourceadapter outboundResourceadapter
292      */

293     public void setOutboundResourceadapter(OutboundResourceadapter outboundResourceadapter) {
294         this.outboundResourceadapter = outboundResourceadapter;
295     }
296
297     /**
298      * Gets the inbound-resourceadapter
299      * @return the inbound-resourceadapter
300      */

301     public InboundResourceadapter getInboundResourceadapter() {
302         return inboundResourceadapter;
303     }
304
305     /**
306      * Set the inbound-resourceadapter
307      * @param inboundResourceadapter inboundResourceadapter
308      */

309     public void setInboundResourceadapter(InboundResourceadapter inboundResourceadapter) {
310         this.inboundResourceadapter = inboundResourceadapter;
311     }
312
313     /**
314      * Gets the adminobject
315      * @return the adminobject
316      */

317     public JLinkedList getAdminobjectList() {
318         return adminobjectList;
319     }
320
321     /**
322      * Set the adminobject
323      * @param adminobjectList adminobject
324      */

325     public void setAdminobjectList(JLinkedList adminobjectList) {
326         this.adminobjectList = adminobjectList;
327     }
328
329     /**
330      * Add a new adminobject element to this object
331      * @param adminobject the adminobjectobject
332      */

333     public void addAdminobject(Adminobject adminobject) {
334         adminobjectList.add(adminobject);
335     }
336
337     /**
338      * Gets the reauthentication-support
339      * @return the reauthentication-support
340      */

341     public String JavaDoc getReauthenticationSupport() {
342         return reauthenticationSupport;
343     }
344
345     /**
346      * Set the reauthentication-support
347      * @param reauthenticationSupport reauthenticationSupport
348      */

349     public void setReauthenticationSupport(String JavaDoc reauthenticationSupport) {
350         this.reauthenticationSupport = reauthenticationSupport;
351     }
352
353     /**
354      * Gets the security-permission
355      * @return the security-permission
356      */

357     public JLinkedList getSecurityPermissionList() {
358         return securityPermissionList;
359     }
360
361     /**
362      * Set the security-permission
363      * @param securityPermissionList securityPermission
364      */

365     public void setSecurityPermissionList(JLinkedList securityPermissionList) {
366         this.securityPermissionList = securityPermissionList;
367     }
368
369     /**
370      * Add a new security-permission element to this object
371      * @param securityPermission the securityPermissionobject
372      */

373     public void addSecurityPermission(SecurityPermission securityPermission) {
374         securityPermissionList.add(securityPermission);
375     }
376
377     /**
378      * Represents this element by it's XML description.
379      * @param indent use this indent for prefixing XML representation.
380      * @return the XML description of this object.
381      */

382     public String JavaDoc toXML(int indent) {
383         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
384         sb.append(indent(indent));
385         sb.append("<resourceadapter>\n");
386
387         indent += 2;
388
389         // resourceadapter-class
390
sb.append(xmlElement(resourceadapterClass, "resourceadapter-class", indent));
391         // config-property
392
sb.append(configPropertyList.toXML(indent));
393         // outbound-resourceadapter
394
if (outboundResourceadapter != null) {
395             sb.append(outboundResourceadapter.toXML(indent));
396         }
397         // inbound-resourceadapter
398
if (inboundResourceadapter != null) {
399             sb.append(inboundResourceadapter.toXML(indent));
400         }
401         // adminobject
402
sb.append(adminobjectList.toXML(indent));
403         // security-permission
404
sb.append(securityPermissionList.toXML(indent));
405         indent -= 2;
406         sb.append(indent(indent));
407         sb.append("</resourceadapter>\n");
408
409         return sb.toString();
410     }
411 }
412
Popular Tags