KickJava   Java API By Example, From Geeks To Geeks.

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


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: JonasSession.java,v 1.16 2004/12/07 09:00:18 camillej Exp $
25  * --------------------------------------------------------------------------
26  */

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

35
36 public class JonasSession extends JonasCommonEjb {
37
38
39     /**
40      * session-timeout
41      */

42     private String JavaDoc sessionTimeout = null;
43
44     /**
45      * jndi-endpoint-name
46      */

47     private String JavaDoc jndiEndpointName = null;
48
49     /**
50      * Constructor
51      */

52     public JonasSession() {
53         super();
54     }
55
56     /**
57      * Gets the session-timeout
58      * @return the session-timeout
59      */

60     public String JavaDoc getSessionTimeout() {
61         return sessionTimeout;
62     }
63
64     /**
65      * Set the session-timeout
66      * @param sessionTimeout sessionTimeout
67      */

68     public void setSessionTimeout(String JavaDoc sessionTimeout) {
69         this.sessionTimeout = sessionTimeout;
70     }
71
72     /**
73      * Gets the jndi-endpoint-name
74      * @return the jndi-endpoint-name
75      */

76     public String JavaDoc getJndiEndpointName() {
77         return jndiEndpointName;
78     }
79
80     /**
81      * Set the jndi-endpoint-name
82      * @param jndiEndpointName jndi-endpoint-name
83      */

84     public void setJndiEndpointName(String JavaDoc jndiEndpointName) {
85         this.jndiEndpointName = jndiEndpointName;
86     }
87
88     /**
89      * Represents this element by it's XML description.
90      * @param indent use this indent for prexifing XML representation.
91      * @return the XML description of this object.
92      */

93     public String JavaDoc toXML(int indent) {
94         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
95         sb.append(indent(indent));
96         sb.append("<jonas-session>\n");
97
98         indent += 2;
99
100         // ejb-name
101
sb.append(xmlElement(getEjbName(), "ejb-name", indent));
102         // jndi-name
103
sb.append(xmlElement(getJndiName(), "jndi-name", indent));
104         // jndi-local-name
105
sb.append(xmlElement(getJndiLocalName(), "jndi-local-name", indent));
106         // jndi-endpoint-name
107
sb.append(xmlElement(getJndiEndpointName(), "jndi-endpoint-name", indent));
108          // jonas-ejb-ref
109
sb.append(getJonasEjbRefList().toXML(indent));
110         // jonas-resource
111
sb.append(getJonasResourceList().toXML(indent));
112         // jonas-resource-env
113
sb.append(getJonasResourceEnvList().toXML(indent));
114         // jonas-service-ref
115
sb.append(getJonasServiceRefList().toXML(indent));
116         // jonas-message-destination-ref
117
sb.append(getJonasMessageDestinationRefList().toXML(indent));
118         // session-timeout
119
sb.append(xmlElement(sessionTimeout, "session-timeout", indent));
120         // max-cache-size
121
sb.append(xmlElement(getMaxCacheSize(), "max-cache-size", indent));
122         // min-pool-size
123
sb.append(xmlElement(getMinPoolSize(), "min-pool-size", indent));
124
125         // run-as
126
if (getRunAsPrincipalName() != null) {
127             sb.append(indent(indent));
128             sb.append("<run-as>\n");
129             indent += 2;
130             sb.append(xmlElement(getRunAsPrincipalName(), "principal-name", indent));
131             indent -= 2;
132             sb.append(indent(indent));
133             sb.append("</run-as>\n");
134         }
135         // ior-security-config
136
if (getIorSecurityConfig() != null) {
137             sb.append(getIorSecurityConfig().toXML(indent));
138         }
139
140         indent -= 2;
141         sb.append(indent(indent));
142         sb.append("</jonas-session>\n");
143
144         return sb.toString();
145     }
146 }
147
Popular Tags