Source Code Cross Referenced for War.java in  » J2EE » JOnAS-4.8.6 » org » objectweb » jonas » web » 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 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * JOnAS: Java(TM) Open Application Server
003:         * Copyright (C) 1999-2005 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 any 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:         * --------------------------------------------------------------------------
022:         * $Id: War.java 6702 2005-05-05 16:09:14Z benoitf $
023:         * --------------------------------------------------------------------------
024:         */package org.objectweb.jonas.web;
025:
026:        import java.net.URL;
027:
028:        import org.objectweb.jonas.web.lib.PermissionManager;
029:
030:        /**
031:         * This class is representing a War (a web application) structure which is
032:         * composed of :
033:         *    - the URL of the war file.
034:         *    - the URL of the ear containing this war.
035:         *    - the name of the host on which this war is deployed.
036:         *    - the context root of this war.
037:         *    - compliance to the java 2 delegation model.
038:         *    - Content of the web.xml file
039:         *    - Content of the jonas-web.xml file
040:         *    - List of the servlets name
041:         *    - A permission manager
042:         * @author Florent Benoit
043:         */
044:        public class War implements  WarMBean {
045:
046:            /**
047:             * The URL of the war file.
048:             */
049:            private URL warURL = null;
050:
051:            /**
052:             * The URL of the ear containing this war.
053:             */
054:            private URL earURL = null;
055:
056:            /**
057:             * The name of the host on which this war is deployed.
058:             */
059:            private String hostName = null;
060:
061:            /**
062:             * The context root where this war is deployed.
063:             */
064:            private String contextRoot = null;
065:
066:            /**
067:             * Compliance to the java 2 delegation model.
068:             */
069:            private boolean java2DelegationModel = true;
070:
071:            /**
072:             * Content of the web.xml file
073:             */
074:            private String xmlContent = null;
075:
076:            /**
077:             * Content of the jonas-web.xml file
078:             */
079:            private String jonasXmlContent = null;
080:
081:            /**
082:             * Names of the servlet
083:             */
084:            private String[] servletsName = null;
085:
086:            /**
087:             * Permission Manager used
088:             */
089:            private PermissionManager permissionManager = null;
090:
091:            /**
092:             * Construct a War with the specified name, of the specified
093:             * ear. (Used in the case of an ear application).
094:             * @param warURL the URL of the war.
095:             * @param earURL the URL of the ear containing this war.
096:             * @param hostName the name of the host on which this war is deployed.
097:             * @param contextRoot the context root of this war.
098:             * @param java2DelegationModel the java2 delegation model compliance
099:             * @param xmlContent content of the web.xml file
100:             * @param jonasXmlContent content of the jonas-web.xml file
101:             * @param servletsName name of the servlets
102:             */
103:            public War(final URL warURL, final URL earURL,
104:                    final String hostName, final String contextRoot,
105:                    final boolean java2DelegationModel,
106:                    final String xmlContent, final String jonasXmlContent,
107:                    final String[] servletsName) {
108:                this .warURL = warURL;
109:                this .earURL = earURL;
110:                this .hostName = hostName;
111:                this .contextRoot = contextRoot;
112:                this .java2DelegationModel = java2DelegationModel;
113:                this .xmlContent = xmlContent;
114:                this .jonasXmlContent = jonasXmlContent;
115:                this .servletsName = servletsName;
116:            }
117:
118:            /**
119:             * Return true if only if this war is in an ear file.
120:             * @return true if only if this war is in an ear file.
121:             */
122:            public boolean isInEarCase() {
123:                return earURL != null;
124:            }
125:
126:            /**
127:             * Get the URL of the war file.
128:             * @return the URL of the war file.
129:             */
130:            public URL getWarURL() {
131:                return warURL;
132:            }
133:
134:            /**
135:             * Get the URL of the ear containing this war.
136:             * @return the URL of the war file.
137:             */
138:            public URL getEarURL() {
139:                return earURL;
140:            }
141:
142:            /**
143:             * Get the name of the host on which this war is deployed.
144:             * @return the name of the host on which this war is deployed.
145:             */
146:            public String getHostName() {
147:                return hostName;
148:            }
149:
150:            /**
151:             * Get the context root of this war.
152:             * @return the context root of this war.
153:             */
154:            public String getContextRoot() {
155:                return contextRoot;
156:            }
157:
158:            /**
159:             * Context classloader must follow the java2 delegation model ?
160:             * @return true if the context's classloader must follow the java 2 delegation model.
161:             */
162:            public boolean getJava2DelegationModel() {
163:                return java2DelegationModel;
164:            }
165:
166:            /**
167:             * Return the standard xml file
168:             * @return the standard xml file
169:             */
170:            public String getXmlContent() {
171:                return xmlContent;
172:            }
173:
174:            /**
175:             * Return the jonas-specific xml file
176:             * @return the jonas-specific xml file
177:             */
178:            public String getJOnASXmlContent() {
179:                return jonasXmlContent;
180:            }
181:
182:            /**
183:             * Return a list of all servlets available
184:             * @return a list of all servlets available
185:             */
186:            public String[] getServletsName() {
187:                return servletsName;
188:            }
189:
190:            /**
191:             * Set the permission manager
192:             * @param permissionManager permission manager to set
193:             */
194:            public void setPermissionManager(PermissionManager permissionManager) {
195:                this .permissionManager = permissionManager;
196:            }
197:
198:            /**
199:             * Gets the permission manager
200:             * @return permission manager
201:             */
202:            public PermissionManager getPermissionManager() {
203:                return permissionManager;
204:            }
205:
206:            /**
207:             * Gets a contextId for this module
208:             * @return contextId
209:             */
210:            public String getContextId() {
211:                return getWarURL().getFile() + contextRoot;
212:            }
213:
214:            /**
215:             * Return true if only if the specified war is equal to this war.
216:             * @param war the war to compare for the equality.
217:             * @return true if only if the specified war is equal to this war.
218:             */
219:            public boolean equals(War war) {
220:                return war.getWarURL().equals(warURL)
221:                        && war.getEarURL().equals(earURL)
222:                        && war.getHostName().equals(hostName)
223:                        && war.getContextRoot().equals(contextRoot)
224:                        && (war.getJava2DelegationModel() == java2DelegationModel);
225:            }
226:
227:            /**
228:             * @return an hashcode for this object
229:             * @see java.lang.Object#hashCode()
230:             */
231:            public int hashCode() {
232:                return warURL.hashCode();
233:            }
234:
235:            /**
236:             * Return a string representation of the war. Used for debug.
237:             * @return a string representation of the war.
238:             */
239:            public String toString() {
240:                StringBuffer ret = new StringBuffer();
241:                ret.append("WAR=\n");
242:                ret.append("\twarURL=" + getWarURL() + "\n");
243:                ret.append("\tearURL=" + getEarURL() + "\n");
244:                ret.append("\thostName=" + getHostName() + "\n");
245:                ret.append("\tcontextRoot=" + getContextRoot());
246:                ret.append("\tjava2DelegationModel="
247:                        + getJava2DelegationModel());
248:                return ret.toString();
249:            }
250:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.