KickJava   Java API By Example, From Geeks To Geeks.

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


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: JonasEntity.java,v 1.20 2004/12/08 14:05:09 benoitf Exp $
25  * --------------------------------------------------------------------------
26  */

27 package org.objectweb.jonas_ejb.deployment.xml;
28
29
30 /**
31  * This class defines the implementation of the element jonas-entity
32  *
33  * @author JOnAS team
34  */

35
36 public class JonasEntity extends JonasCommonEjb {
37
38     /**
39      * is-modified-method-name
40      */

41     private String JavaDoc isModifiedMethodName = null;
42
43     /**
44      * passivation-timeout
45      */

46     private String JavaDoc passivationTimeout = null;
47
48     /**
49      * inactivity-timeout
50      */

51     private String JavaDoc inactivityTimeout = null;
52
53     /**
54      * shared
55      */

56     private String JavaDoc shared = null;
57
58     /**
59      * prefetch
60      */

61     private String JavaDoc prefetch = null;
62
63     /**
64      * cleanup
65      */

66     private String JavaDoc cleanup = null;
67
68     /**
69      * lock policy
70      */

71     private String JavaDoc lockPolicy = null;
72
73     /**
74      * jdbc-mapping
75      */

76     private JdbcMapping jdbcMapping = null;
77
78     /**
79      * Constructor
80      */

81     public JonasEntity() {
82         super();
83     }
84
85
86
87     /**
88      * Gets the is-modified-method-name
89      * @return the is-modified-method-name
90      */

91     public String JavaDoc getIsModifiedMethodName() {
92         return isModifiedMethodName;
93     }
94
95     /**
96      * Set the is-modified-method-name
97      * @param isModifiedMethodName isModifiedMethodName
98      */

99     public void setIsModifiedMethodName(String JavaDoc isModifiedMethodName) {
100         this.isModifiedMethodName = isModifiedMethodName;
101     }
102
103     /**
104      * Gets the passivation-timeout
105      * @return the passivation-timeout
106      */

107     public String JavaDoc getPassivationTimeout() {
108         return passivationTimeout;
109     }
110
111     /**
112      * Set the passivation-timeout
113      * @param passivationTimeout passivationTimeout
114      */

115     public void setPassivationTimeout(String JavaDoc passivationTimeout) {
116         this.passivationTimeout = passivationTimeout;
117     }
118
119     /**
120      * Gets the inactivity-timeout
121      * @return the inactivity-timeout
122      */

123     public String JavaDoc getInactivityTimeout() {
124         return inactivityTimeout;
125     }
126
127     /**
128      * Set the inactivity-timeout
129      * @param inactivityTimeout inactivityTimeout
130      */

131     public void setInactivityTimeout(String JavaDoc inactivityTimeout) {
132         this.inactivityTimeout = inactivityTimeout;
133     }
134
135     /**
136      * Gets the shared
137      * @return the shared
138      */

139     public String JavaDoc getShared() {
140         return shared;
141     }
142
143     /**
144      * Set the shared
145      * @param shared shared
146      */

147     public void setShared(String JavaDoc shared) {
148         this.shared = shared;
149     }
150
151     /**
152      * Gets the prefetch
153      * @return the prefetch
154      */

155     public String JavaDoc getPrefetch() {
156         return prefetch;
157     }
158
159     /**
160      * Set the prefetch
161      * @param prefetch prefetch
162      */

163     public void setPrefetch(String JavaDoc prefetch) {
164         this.prefetch = prefetch;
165     }
166
167     /**
168      * Gets the cleanup
169      * @return the cleanup
170      */

171     public String JavaDoc getCleanup() {
172         return cleanup;
173     }
174
175     /**
176      * Set the cleanup
177      * @param cleanup cleanup
178      */

179     public void setCleanup(String JavaDoc cleanup) {
180         this.cleanup = cleanup;
181     }
182
183     /**
184      * Gets the lock Policy
185      * @return the lockPolicy
186      */

187     public String JavaDoc getLockPolicy() {
188         return lockPolicy;
189     }
190
191     /**
192      * Set the lock Policy
193      * @param lockPolicy lock Policy
194      */

195     public void setLockPolicy(String JavaDoc lockPolicy) {
196         this.lockPolicy = lockPolicy;
197     }
198
199     /**
200      * Gets the jdbc-mapping
201      * @return the jdbc-mapping
202      */

203     public JdbcMapping getJdbcMapping() {
204         return jdbcMapping;
205     }
206
207     /**
208      * Set the jdbc-mapping
209      * @param jdbcMapping jdbcMapping
210      */

211     public void setJdbcMapping(JdbcMapping jdbcMapping) {
212         this.jdbcMapping = jdbcMapping;
213     }
214
215      /**
216      * Represents this element by it's XML description.
217      * @param indent use this indent for prexifing XML representation.
218      * @return the XML description of this object.
219      */

220     public String JavaDoc toXML(int indent) {
221         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
222         sb.append(indent(indent));
223         sb.append("<jonas-entity>\n");
224
225         indent += 2;
226
227         // ejb-name
228
sb.append(xmlElement(getEjbName(), "ejb-name", indent));
229         // jndi-name
230
sb.append(xmlElement(getJndiName(), "jndi-name", indent));
231          // jonas-ejb-ref
232
sb.append(getJonasEjbRefList().toXML(indent));
233         // jonas-resource
234
sb.append(getJonasResourceList().toXML(indent));
235         // jonas-resource-env
236
sb.append(getJonasResourceEnvList().toXML(indent));
237         // jonas-service-ref
238
sb.append(getJonasServiceRefList().toXML(indent));
239         // jonas-message-destination-ref
240
sb.append(getJonasMessageDestinationRefList().toXML(indent));
241         // is-modified-method-name
242
sb.append(xmlElement(isModifiedMethodName, "is-modified-method-name", indent));
243         // passivation-timeout
244
sb.append(xmlElement(passivationTimeout, "passivation-timeout", indent));
245         // inactivity-timeout
246
sb.append(xmlElement(inactivityTimeout, "inactivity-timeout", indent));
247         // shared
248
sb.append(xmlElement(shared, "shared", indent));
249         // prefetch
250
sb.append(xmlElement(prefetch, "prefetch", indent));
251         // max-cache-size
252
sb.append(xmlElement(getMaxCacheSize(), "max-cache-size", indent));
253         // min-pool-size
254
sb.append(xmlElement(getMinPoolSize(), "min-pool-size", indent));
255         // cleanup
256
sb.append(xmlElement(cleanup, "cleanup", indent));
257         // lock policy
258
sb.append(xmlElement(lockPolicy, "lock-policy", indent));
259         // jdbc-mapping
260
if (jdbcMapping != null) {
261             sb.append(jdbcMapping.toXML(indent));
262         }
263         // run-as
264
if (getRunAsPrincipalName() != null) {
265             sb.append(indent(indent));
266             sb.append("<run-as>\n");
267             indent += 2;
268             sb.append(xmlElement(getRunAsPrincipalName(), "principal-name", indent));
269             indent -= 2;
270             sb.append(indent(indent));
271             sb.append("</run-as>\n");
272         }
273
274         // ior-security-config
275
if (getIorSecurityConfig() != null) {
276             sb.append(getIorSecurityConfig().toXML(indent));
277          }
278
279         indent -= 2;
280         sb.append(indent(indent));
281         sb.append("</jonas-entity>\n");
282
283         return sb.toString();
284     }
285
286 }
287
Popular Tags