KickJava   Java API By Example, From Geeks To Geeks.

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


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: JonasMessageDriven.java,v 1.13 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-message-driven
32  *
33  * @author JOnAS team
34  */

35
36 public class JonasMessageDriven extends JonasCommonEjb {
37
38
39     /**
40      * jonas-message-driven-destination
41      */

42     private JonasMessageDrivenDestination jonasMessageDrivenDestination = null;
43
44     /**
45      * activation-config (EJB2.1 only)
46      */

47     private ActivationConfig activationConfig = null;
48
49     /**
50      * Constructor
51      */

52     public JonasMessageDriven() {
53         super();
54     }
55
56
57
58     /**
59      * Gets the jonas-message-driven-destination
60      * @return the jonas-message-driven-destination
61      */

62     public JonasMessageDrivenDestination getJonasMessageDrivenDestination() {
63         return jonasMessageDrivenDestination;
64     }
65
66     /**
67      * Set the jonas-message-driven-destination
68      * @param jonasMessageDrivenDestination jonasMessageDrivenDestination
69      */

70     public void setJonasMessageDrivenDestination(JonasMessageDrivenDestination jonasMessageDrivenDestination) {
71         this.jonasMessageDrivenDestination = jonasMessageDrivenDestination;
72     }
73
74     /**
75      * Gets the activation-config (EJB2.1 only)
76      * @return the activation-config
77      */

78     public ActivationConfig getActivationConfig() {
79         return activationConfig;
80     }
81
82     /**
83      * Set the activation-config (EJB2.1 only)
84      * @param activationConfig activation-config
85      */

86     public void setActivationConfig(ActivationConfig activationConfig) {
87         this.activationConfig = activationConfig;
88     }
89
90     /**
91      * Represents this element by it's XML description.
92      * @param indent use this indent for prexifing XML representation.
93      * @return the XML description of this object.
94      */

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