Source Code Cross Referenced for JonasWebApp.java in  » J2EE » JOnAS-4.8.6 » org » objectweb » jonas_web » deployment » xml » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » JOnAS 4.8.6 » org.objectweb.jonas_web.deployment.xml 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


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:         * modify it under the terms of the GNU Lesser General Public
008:         * License as published by the Free Software Foundation; either
009:         * version 2.1 of the License, or 1any later version.
010:         *
011:         * This library is distributed in the hope that it will be useful,
012:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
013:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
014:         * Lesser General Public License for more details.
015:         *
016:         * You should have received a copy of the GNU Lesser General Public
017:         * License along with this library; if not, write to the Free Software
018:         * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
019:         * USA
020:         *
021:         * Initial developer: Florent BENOIT
022:         * --------------------------------------------------------------------------
023:         * $Id: JonasWebApp.java 7467 2005-10-04 12:53:14Z sauthieg $
024:         * --------------------------------------------------------------------------
025:         */package org.objectweb.jonas_web.deployment.xml;
026:
027:        import org.objectweb.jonas_lib.deployment.xml.AbsJonasEnvironmentElement;
028:        import org.objectweb.jonas_lib.deployment.xml.JLinkedList;
029:        import org.objectweb.jonas_lib.deployment.xml.JonasMessageDestination;
030:        import org.objectweb.jonas_lib.deployment.xml.TopLevelElement;
031:
032:        import org.objectweb.jonas_web.deployment.api.JonasWebAppSchemas;
033:
034:        /**
035:         * This class defines the implementation of the element jonas-web-app.
036:         * @author Florent Benoit
037:         */
038:        public class JonasWebApp extends AbsJonasEnvironmentElement implements 
039:                TopLevelElement {
040:
041:            /**
042:             * Header (with right XSD version) for XML
043:             */
044:            private String header = null;
045:
046:            /**
047:             * Host element
048:             */
049:            private String host = null;
050:
051:            /**
052:             * Context-root element
053:             */
054:            private String contextRoot = null;
055:
056:            /**
057:             * Port to use (used by web services)
058:             */
059:            private String port = null;
060:
061:            /**
062:             * Follow the java 2 delegation model or not
063:             */
064:            private String java2DelegationModel = null;
065:
066:            /**
067:             * jonas-message-destination
068:             */
069:            private JLinkedList jonasMessageDestinationList = null;
070:
071:            /**
072:             * jonas-web-app element XML header
073:             */
074:            public static final String JONAS_WEBAPP_ELEMENT = "<?xml version=\"1.0\"?>\n"
075:                    + "<jonas-web-app xmlns=\"http://www.objectweb.org/jonas/ns\"\n"
076:                    + "                 xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
077:                    + "                 xsi:schemaLocation=\"http://www.objectweb.org/jonas/ns\n"
078:                    + "                 http://www.objectweb.org/jonas/ns/"
079:                    + JonasWebAppSchemas.getLastSchema() + "\">\n";
080:
081:            /**
082:             * Constructor : build a new WebApp object
083:             */
084:            public JonasWebApp() {
085:                super ();
086:                jonasMessageDestinationList = new JLinkedList(
087:                        "jonas-message-destination");
088:
089:                header = JONAS_WEBAPP_ELEMENT;
090:            }
091:
092:            // Setters
093:
094:            /**
095:             * Set the host element of this object
096:             * @param host host element of this object
097:             */
098:            public void setHost(String host) {
099:                this .host = host;
100:            }
101:
102:            /**
103:             * Set the context-root element of this object
104:             * @param contextRoot context-root element of this object
105:             */
106:            public void setContextRoot(String contextRoot) {
107:                this .contextRoot = contextRoot;
108:            }
109:
110:            /**
111:             * Set the port element of this object
112:             * @param port port element of this object
113:             */
114:            public void setPort(String port) {
115:                this .port = port;
116:            }
117:
118:            /**
119:             * Set the java 2 delegation model element of this object
120:             * @param java2DelegationModel java2-delegation-model element of this object
121:             */
122:            public void setJava2DelegationModel(String java2DelegationModel) {
123:                this .java2DelegationModel = java2DelegationModel;
124:            }
125:
126:            /**
127:             * Set the jonas-message-destination
128:             * @param jonasMessageDestinationList jonasMessageDestination
129:             */
130:            public void setJonasMessageDestinationList(
131:                    JLinkedList jonasMessageDestinationList) {
132:                this .jonasMessageDestinationList = jonasMessageDestinationList;
133:            }
134:
135:            /**
136:             * Add a new jonas-message-destination element to this object
137:             * @param jonasMessageDestination the jonas-message-destination object
138:             */
139:            public void addJonasMessageDestination(
140:                    JonasMessageDestination jonasMessageDestination) {
141:                jonasMessageDestinationList.add(jonasMessageDestination);
142:            }
143:
144:            // Getters
145:
146:            /**
147:             * @return the host element
148:             */
149:            public String getHost() {
150:                return host;
151:            }
152:
153:            /**
154:             * @return the context-root element
155:             */
156:            public String getContextRoot() {
157:                return contextRoot;
158:            }
159:
160:            /**
161:             * @return the port element
162:             */
163:            public String getPort() {
164:                return port;
165:            }
166:
167:            /**
168:             * @return the java2-delegation-model element
169:             */
170:            public String getJava2DelegationModel() {
171:                return java2DelegationModel;
172:            }
173:
174:            /**
175:             * @return the list of all jonas-message-destination elements
176:             */
177:            public JLinkedList getJonasMessageDestinationList() {
178:                return jonasMessageDestinationList;
179:            }
180:
181:            /**
182:             * Represents this element by it's XML description.
183:             * @param indent use this indent for prexifing XML representation.
184:             * @return the XML description of this object.
185:             */
186:            public String toXML(int indent) {
187:                StringBuffer sb = new StringBuffer();
188:                sb.append(indent(indent));
189:                if (header != null) {
190:                    sb.append(header);
191:                } else {
192:                    sb.append("<jonas-web-app>\n");
193:                }
194:
195:                indent += 2;
196:
197:                // jonas-resource-env
198:                sb.append(getJonasResourceEnvList().toXML(indent));
199:
200:                // jonas-resource
201:                sb.append(getJonasResourceList().toXML(indent));
202:
203:                // jonas-ejb-ref
204:                sb.append(getJonasEjbRefList().toXML(indent));
205:
206:                // jonas-message-destination-ref
207:                sb.append(getJonasMessageDestinationRefList().toXML(indent));
208:
209:                // jonas-message-destination
210:                sb.append(getJonasMessageDestinationList().toXML(indent));
211:
212:                // jonas-service-ref
213:                sb.append(getJonasServiceRefList().toXML(indent));
214:
215:                // host
216:                if (host != null) {
217:                    sb.append(xmlElement(host, "host", indent));
218:                }
219:
220:                // context-root
221:                if (contextRoot != null) {
222:                    sb.append(xmlElement(contextRoot, "context-root", indent));
223:                }
224:
225:                // port
226:                if (port != null) {
227:                    sb.append(xmlElement(port, "port", indent));
228:                }
229:
230:                // java2-delegation-model
231:                if (java2DelegationModel != null) {
232:                    sb.append(xmlElement(java2DelegationModel,
233:                            "java2-delegation-model", indent));
234:                }
235:
236:                indent -= 2;
237:                sb.append(indent(indent));
238:                sb.append("</jonas-web-app>");
239:
240:                return sb.toString();
241:            }
242:
243:            /**
244:             * @return the header.
245:             */
246:            public String getHeader() {
247:                return header;
248:            }
249:
250:            /**
251:             * @param header The header to set.
252:             */
253:            public void setHeader(String header) {
254:                this.header = header;
255:            }
256:
257:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.