001: /**
002: * JOnAS: Java(TM) Open Application Server
003: * Copyright (C) 1999 Bull S.A.
004: * Contact: jonas-team@objectweb.org
005: *
006: * This library is free software; you can redistribute it and/or
007: *
008: * modify it under the terms of the GNU Lesser General Public
009: * License as published by the Free Software Foundation; either
010: * version 2.1 of the License, or 1any later version.
011: *
012: * This library is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: *
017: * You should have received a copy of the GNU Lesser General Public
018: * License along with this library; if not, write to the Free Software
019: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
020: * USA
021: *
022: * Initial developer: JOnAS team
023: * --------------------------------------------------------------------------
024: * $Id: JonasEntity.java 8050 2006-02-23 16:07:37Z durieuxp $
025: * --------------------------------------------------------------------------
026: */package org.objectweb.jonas_ejb.deployment.xml;
027:
028: /**
029: * This class defines the implementation of the element jonas-entity
030: *
031: * @author JOnAS team
032: */
033:
034: public class JonasEntity extends JonasCommonEjb {
035:
036: /**
037: * is-modified-method-name
038: */
039: private String isModifiedMethodName = null;
040:
041: /**
042: * passivation-timeout
043: */
044: private String passivationTimeout = null;
045:
046: /**
047: * inactivity-timeout
048: */
049: private String inactivityTimeout = null;
050:
051: /**
052: * deadlock-timeout
053: */
054: private String deadlockTimeout = null;
055:
056: /**
057: * read-timeout
058: */
059: private String readTimeout = null;
060:
061: /**
062: * max-wait-time
063: */
064: private String maxWaitTime = null;
065:
066: /**
067: * shared
068: */
069: private String shared = null;
070:
071: /**
072: * prefetch
073: */
074: private String prefetch = null;
075:
076: /**
077: * hard-limit
078: */
079: private String hardLimit = null;
080:
081: /**
082: * cleanup
083: */
084: private String cleanup = null;
085:
086: /**
087: * lock policy
088: */
089: private String lockPolicy = null;
090:
091: /**
092: * jdbc-mapping
093: */
094: private JdbcMapping jdbcMapping = null;
095:
096: /**
097: * Constructor
098: */
099: public JonasEntity() {
100: super ();
101: }
102:
103: /**
104: * Gets the is-modified-method-name
105: * @return the is-modified-method-name
106: */
107: public String getIsModifiedMethodName() {
108: return isModifiedMethodName;
109: }
110:
111: /**
112: * Set the is-modified-method-name
113: * @param isModifiedMethodName isModifiedMethodName
114: */
115: public void setIsModifiedMethodName(String isModifiedMethodName) {
116: this .isModifiedMethodName = isModifiedMethodName;
117: }
118:
119: /**
120: * Gets the passivation-timeout
121: * @return the passivation-timeout
122: */
123: public String getPassivationTimeout() {
124: return passivationTimeout;
125: }
126:
127: /**
128: * Set the passivation-timeout
129: * @param passivationTimeout passivationTimeout
130: */
131: public void setPassivationTimeout(String passivationTimeout) {
132: this .passivationTimeout = passivationTimeout;
133: }
134:
135: /**
136: * Gets the inactivity-timeout
137: * @return the inactivity-timeout
138: */
139: public String getInactivityTimeout() {
140: return inactivityTimeout;
141: }
142:
143: /**
144: * Set the inactivity-timeout
145: * @param inactivityTimeout inactivityTimeout
146: */
147: public void setInactivityTimeout(String inactivityTimeout) {
148: this .inactivityTimeout = inactivityTimeout;
149: }
150:
151: /**
152: * Set the deadlock-timeout
153: * @param deadlockTimeout deadlockTimeout
154: */
155: public void setDeadlockTimeout(String deadlockTimeout) {
156: this .deadlockTimeout = deadlockTimeout;
157: }
158:
159: /**
160: * Gets the deadlock-timeout
161: * @return the deadlock-timeout
162: */
163: public String getDeadlockTimeout() {
164: return deadlockTimeout;
165: }
166:
167: /**
168: * Gets the read-timeout
169: * @return the read-timeout
170: */
171: public String getReadTimeout() {
172: return readTimeout;
173: }
174:
175: /**
176: * Set the read-timeout
177: * @param readTimeout readTimeout
178: */
179: public void setReadTimeout(String readTimeout) {
180: this .readTimeout = readTimeout;
181: }
182:
183: /**
184: * Gets the max-wait-time
185: * @return the max-wait-time
186: */
187: public String getMaxWaitTime() {
188: return maxWaitTime;
189: }
190:
191: /**
192: * Set the max-wait-time
193: * @param maxWaitTime max wait time in seconds
194: */
195: public void setMaxWaitTime(String maxWaitTime) {
196: this .maxWaitTime = maxWaitTime;
197: }
198:
199: /**
200: * Gets the shared
201: * @return the shared
202: */
203: public String getShared() {
204: return shared;
205: }
206:
207: /**
208: * Set the shared
209: * @param shared shared
210: */
211: public void setShared(String shared) {
212: this .shared = shared;
213: }
214:
215: /**
216: * Gets the prefetch
217: * @return the prefetch
218: */
219: public String getPrefetch() {
220: return prefetch;
221: }
222:
223: /**
224: * Set the prefetch
225: * @param prefetch prefetch
226: */
227: public void setPrefetch(String prefetch) {
228: this .prefetch = prefetch;
229: }
230:
231: /**
232: * Gets the hard-limit
233: * @return the hard limit flag
234: */
235: public String getHardLimit() {
236: return hardLimit;
237: }
238:
239: /**
240: * Set the hard-limit flag
241: * @param hardLimit The hard limit flag
242: */
243: public void setHardLimit(String hardLimit) {
244: this .hardLimit = hardLimit;
245: }
246:
247: /**
248: * Gets the cleanup
249: * @return the cleanup
250: */
251: public String getCleanup() {
252: return cleanup;
253: }
254:
255: /**
256: * Set the cleanup
257: * @param cleanup cleanup
258: */
259: public void setCleanup(String cleanup) {
260: this .cleanup = cleanup;
261: }
262:
263: /**
264: * Gets the lock Policy
265: * @return the lockPolicy
266: */
267: public String getLockPolicy() {
268: return lockPolicy;
269: }
270:
271: /**
272: * Set the lock Policy
273: * @param lockPolicy lock Policy
274: */
275: public void setLockPolicy(String lockPolicy) {
276: this .lockPolicy = lockPolicy;
277: }
278:
279: /**
280: * Gets the jdbc-mapping
281: * @return the jdbc-mapping
282: */
283: public JdbcMapping getJdbcMapping() {
284: return jdbcMapping;
285: }
286:
287: /**
288: * Set the jdbc-mapping
289: * @param jdbcMapping jdbcMapping
290: */
291: public void setJdbcMapping(JdbcMapping jdbcMapping) {
292: this .jdbcMapping = jdbcMapping;
293: }
294:
295: /**
296: * Represents this element by it's XML description.
297: * @param indent use this indent for prexifing XML representation.
298: * @return the XML description of this object.
299: */
300: public String toXML(int indent) {
301: StringBuffer sb = new StringBuffer();
302: sb.append(indent(indent));
303: sb.append("<jonas-entity>\n");
304:
305: indent += 2;
306:
307: // ejb-name
308: sb.append(xmlElement(getEjbName(), "ejb-name", indent));
309: // jndi-name
310: sb.append(xmlElement(getJndiName(), "jndi-name", indent));
311: // jonas-ejb-ref
312: sb.append(getJonasEjbRefList().toXML(indent));
313: // jonas-resource
314: sb.append(getJonasResourceList().toXML(indent));
315: // jonas-resource-env
316: sb.append(getJonasResourceEnvList().toXML(indent));
317: // jonas-service-ref
318: sb.append(getJonasServiceRefList().toXML(indent));
319: // jonas-message-destination-ref
320: sb.append(getJonasMessageDestinationRefList().toXML(indent));
321: // is-modified-method-name
322: if (isModifiedMethodName != null
323: && !isModifiedMethodName.equals("")) {
324: sb.append(xmlElement(isModifiedMethodName,
325: "is-modified-method-name", indent));
326: }
327: // passivation-timeout
328: if (passivationTimeout != null
329: && !passivationTimeout.equals("")) {
330: sb.append(xmlElement(passivationTimeout,
331: "passivation-timeout", indent));
332: }
333: // inactivity-timeout
334: if (inactivityTimeout != null && !inactivityTimeout.equals("")) {
335: sb.append(xmlElement(inactivityTimeout,
336: "inactivity-timeout", indent));
337: }
338: // deadlock-timeout
339: if (deadlockTimeout != null && !deadlockTimeout.equals("")) {
340: sb.append(xmlElement(deadlockTimeout, "deadlock-timeout",
341: indent));
342: }
343: // read-timeout
344: if (readTimeout != null && !readTimeout.equals("")) {
345: sb.append(xmlElement(readTimeout, "read-timeout", indent));
346: }
347: // max-wait-time
348: if (maxWaitTime != null && !maxWaitTime.equals("")) {
349: sb.append(xmlElement(maxWaitTime, "max-wait-time", indent));
350: }
351: // shared
352: if (shared != null && !shared.equals("")) {
353: sb.append(xmlElement(shared, "shared", indent));
354: }
355: // prefetch
356: if (prefetch != null && !prefetch.equals("")) {
357: sb.append(xmlElement(prefetch, "prefetch", indent));
358: }
359: // hard-limit
360: if (hardLimit != null && !hardLimit.equals("")) {
361: sb.append(xmlElement(hardLimit, "hard-limit", indent));
362: }
363: // max-cache-size
364: if (getMaxCacheSize() != null && !getMaxCacheSize().equals("")) {
365: sb.append(xmlElement(getMaxCacheSize(), "max-cache-size",
366: indent));
367: }
368: // min-pool-size
369: if (getMinPoolSize() != null && !getMinPoolSize().equals("")) {
370: sb.append(xmlElement(getMinPoolSize(), "min-pool-size",
371: indent));
372: }
373: // cleanup
374: if (cleanup != null && !cleanup.equals("")) {
375: sb.append(xmlElement(cleanup, "cleanup", indent));
376: }
377: // lock policy
378: if (lockPolicy != null && !lockPolicy.equals("")) {
379: sb.append(xmlElement(lockPolicy, "lock-policy", indent));
380: }
381: // jdbc-mapping
382: if (jdbcMapping != null && !jdbcMapping.equals("")) {
383: sb.append(jdbcMapping.toXML(indent));
384: }
385: // run-as
386: if (getRunAsPrincipalName() != null) {
387: sb.append(indent(indent));
388: sb.append("<run-as>\n");
389: indent += 2;
390: sb.append(xmlElement(getRunAsPrincipalName(),
391: "principal-name", indent));
392: indent -= 2;
393: sb.append(indent(indent));
394: sb.append("</run-as>\n");
395: }
396:
397: // ior-security-config
398: if (getIorSecurityConfig() != null) {
399: sb.append(getIorSecurityConfig().toXML(indent));
400: }
401:
402: indent -= 2;
403: sb.append(indent(indent));
404: sb.append("</jonas-entity>\n");
405:
406: return sb.toString();
407: }
408:
409: }
|