Source Code Cross Referenced for WebApp.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) 2004 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: WebApp.java 5201 2004-07-29 12:19:56Z benoitf $
024:         * --------------------------------------------------------------------------
025:         */package org.objectweb.jonas_web.deployment.xml;
026:
027:        import org.objectweb.jonas_lib.deployment.xml.AbsEnvironmentElement;
028:        import org.objectweb.jonas_lib.deployment.xml.JLinkedList;
029:        import org.objectweb.jonas_lib.deployment.xml.JndiEnvRefsGroupXml;
030:        import org.objectweb.jonas_lib.deployment.xml.SecurityRole;
031:        import org.objectweb.jonas_lib.deployment.xml.TopLevelElement;
032:
033:        /**
034:         * This class defines the implementation of the element web-app.
035:         * @author Florent Benoit
036:         */
037:        public class WebApp extends AbsEnvironmentElement implements 
038:                TopLevelElement, JndiEnvRefsGroupXml {
039:
040:            /**
041:             * List of servlet
042:             */
043:            private JLinkedList servletList = null;
044:
045:            /**
046:             * List of servlet-mapping
047:             */
048:            private JLinkedList servletMappingList = null;
049:
050:            /**
051:             * security-constraint
052:             */
053:            private JLinkedList securityConstraintList = null;
054:
055:            /**
056:             * security-role
057:             */
058:            private JLinkedList securityRoleList = null;
059:
060:            /**
061:             * Number of jsp-config
062:             */
063:            private int jspConfigNumber = 0;
064:
065:            /**
066:             * Number of login-config
067:             */
068:            private int loginConfigNumber = 0;
069:
070:            /**
071:             * Number of jsp-config
072:             */
073:            private int sessionConfigNumber = 0;
074:
075:            /**
076:             * Constructor : build a new WebApp object
077:             */
078:            public WebApp() {
079:                super ();
080:                servletList = new JLinkedList("servlet");
081:                servletMappingList = new JLinkedList("servlet-mapping");
082:                securityConstraintList = new JLinkedList("security-constraint");
083:                securityRoleList = new JLinkedList("security-role");
084:            }
085:
086:            /**
087:             * Add a new servlet element to this object
088:             * @param servlet the servlet object
089:             */
090:            public void addServlet(Servlet servlet) {
091:                servletList.add(servlet);
092:            }
093:
094:            /**
095:             * Add a new servlet-mapping element to this object
096:             * @param servletMapping the servlet-mapping object
097:             */
098:            public void addServletMapping(ServletMapping servletMapping) {
099:                servletMappingList.add(servletMapping);
100:            }
101:
102:            /**
103:             * Set the security-role
104:             * @param securityRoleList securityRole
105:             */
106:            public void setSecurityRoleList(JLinkedList securityRoleList) {
107:                this .securityRoleList = securityRoleList;
108:            }
109:
110:            /**
111:             * Add a new security role element to this object
112:             * @param securityRole security role object
113:             */
114:            public void addSecurityRole(SecurityRole securityRole) {
115:                securityRoleList.add(securityRole);
116:            }
117:
118:            /**
119:             * Set the security-constraint
120:             * @param securityConstraintList securityConstraint
121:             */
122:            public void setSecurityConstraintList(
123:                    JLinkedList securityConstraintList) {
124:                this .securityConstraintList = securityConstraintList;
125:            }
126:
127:            /**
128:             * Add a new security constraint element to this object
129:             * @param securityConstraint security constraint object
130:             */
131:            public void addSecurityConstraint(
132:                    SecurityConstraint securityConstraint) {
133:                securityConstraintList.add(securityConstraint);
134:            }
135:
136:            // Getters
137:
138:            /**
139:             * Gets the security-constraint
140:             * @return the security-constraint
141:             */
142:            public JLinkedList getSecurityConstraintList() {
143:                return securityConstraintList;
144:            }
145:
146:            /**
147:             * Gets the security-role
148:             * @return the security-role
149:             */
150:            public JLinkedList getSecurityRoleList() {
151:                return securityRoleList;
152:            }
153:
154:            /**
155:             * @return the list of all servlet elements
156:             */
157:            public JLinkedList getServletList() {
158:                return servletList;
159:            }
160:
161:            /**
162:             * @return the list of all servlet-mapping elements
163:             */
164:            public JLinkedList getServletMappingList() {
165:                return servletMappingList;
166:            }
167:
168:            /**
169:             * Count a new jsp config
170:             */
171:            public void newJspConfig() {
172:                jspConfigNumber++;
173:            }
174:
175:            /**
176:             * Count a new login-config
177:             */
178:            public void newLoginConfig() {
179:                loginConfigNumber++;
180:            }
181:
182:            /**
183:             * Count a new jsp config
184:             */
185:            public void newSessionConfig() {
186:                sessionConfigNumber++;
187:            }
188:
189:            /**
190:             * Represents this element by it's XML description.
191:             * @param indent use this indent for prexifing XML representation.
192:             * @return the XML description of this object.
193:             */
194:            public String toXML(int indent) {
195:                StringBuffer sb = new StringBuffer();
196:                sb.append(indent(indent));
197:                sb.append("<web-app>\n");
198:
199:                indent += 2;
200:
201:                // display-name
202:                sb.append(xmlElement(getDisplayName(), "display-name", indent));
203:
204:                // servlet
205:                sb.append(servletList.toXML(indent));
206:
207:                // servlet-mapping
208:                sb.append(servletMappingList.toXML(indent));
209:
210:                // security-constraint
211:                sb.append(securityConstraintList.toXML(indent));
212:
213:                // security-role
214:                sb.append(securityRoleList.toXML(indent));
215:
216:                // resource-env-ref
217:                sb.append(getResourceEnvRefList().toXML(indent));
218:
219:                // resource-ref
220:                sb.append(getResourceRefList().toXML(indent));
221:
222:                // env-entry
223:                sb.append(getEnvEntryList().toXML(indent));
224:
225:                // ejb-ref
226:                sb.append(getEjbRefList().toXML(indent));
227:
228:                // ejb-local-ref
229:                sb.append(getEjbLocalRefList().toXML(indent));
230:
231:                // service-ref
232:                sb.append(getServiceRefList().toXML(indent));
233:
234:                // message-destination-ref
235:                sb.append(getMessageDestinationRefList().toXML(indent));
236:                indent -= 2;
237:                sb.append(indent(indent));
238:                sb.append("</web-app>");
239:
240:                return sb.toString();
241:            }
242:
243:            /**
244:             * @return the jspConfigNumber.
245:             */
246:            public int getJspConfigNumber() {
247:                return jspConfigNumber;
248:            }
249:
250:            /**
251:             * @return the loginConfigNumber.
252:             */
253:            public int getLoginConfigNumber() {
254:                return loginConfigNumber;
255:            }
256:
257:            /**
258:             * @return the sessionConfigNumber.
259:             */
260:            public int getSessionConfigNumber() {
261:                return sessionConfigNumber;
262:            }
263:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.