KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas_ejb > deployment > xml > ContainerTransaction


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: JOnAS team
23  * --------------------------------------------------------------------------
24  * $Id: ContainerTransaction.java,v 1.8 2004/05/10 11:45:44 sauthieg Exp $
25  * --------------------------------------------------------------------------
26  */

27 package org.objectweb.jonas_ejb.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 container-transaction
33  *
34  * @author JOnAS team
35  */

36
37 public class ContainerTransaction extends AbsElement {
38
39     /**
40      * description
41      */

42     private String JavaDoc description = null;
43
44     /**
45      * method
46      */

47     private JLinkedList methodList = null;
48
49     /**
50      * trans-attribute
51      */

52     private String JavaDoc transAttribute = null;
53
54
55     /**
56      * Constructor
57      */

58     public ContainerTransaction() {
59         super();
60         methodList = new JLinkedList("method");
61     }
62
63     /**
64      * Gets the description
65      * @return the description
66      */

67     public String JavaDoc getDescription() {
68         return description;
69     }
70
71     /**
72      * Set the description
73      * @param description description
74      */

75     public void setDescription(String JavaDoc description) {
76         this.description = description;
77     }
78
79     /**
80      * Gets the method
81      * @return the method
82      */

83     public JLinkedList getMethodList() {
84         return methodList;
85     }
86
87     /**
88      * Set the method
89      * @param methodList method
90      */

91     public void setMethodList(JLinkedList methodList) {
92         this.methodList = methodList;
93     }
94
95     /**
96      * Add a new method element to this object
97      * @param method the methodobject
98      */

99     public void addMethod(Method method) {
100         methodList.add(method);
101     }
102
103     /**
104      * Gets the trans-attribute
105      * @return the trans-attribute
106      */

107     public String JavaDoc getTransAttribute() {
108         return transAttribute;
109     }
110
111     /**
112      * Set the trans-attribute
113      * @param transAttribute transAttribute
114      */

115     public void setTransAttribute(String JavaDoc transAttribute) {
116         this.transAttribute = transAttribute;
117     }
118
119     /**
120      * Represents this element by it's XML description.
121      * @param indent use this indent for prexifing XML representation.
122      * @return the XML description of this object.
123      */

124     public String JavaDoc toXML(int indent) {
125         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
126         sb.append(indent(indent));
127         sb.append("<container-transaction>\n");
128
129         indent += 2;
130
131         // description
132
sb.append(xmlElement(description, "description", indent));
133         // method
134
sb.append(methodList.toXML(indent));
135         // trans-attribute
136
sb.append(xmlElement(transAttribute, "trans-attribute", indent));
137         indent -= 2;
138         sb.append(indent(indent));
139         sb.append("</container-transaction>\n");
140
141         return sb.toString();
142     }
143 }
144
Popular Tags