Source Code Cross Referenced for Ear.java in  » J2EE » JOnAS-4.8.6 » org » objectweb » jonas » ear » 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.ear 
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 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:         * Initial developer(s): Florent BENOIT & Ludovic BERT
022:         * --------------------------------------------------------------------------
023:         * $Id: Ear.java 6618 2005-04-22 11:15:08Z benoitf $
024:         * --------------------------------------------------------------------------
025:         */package org.objectweb.jonas.ear;
026:
027:        import java.net.URL;
028:        import java.util.ArrayList;
029:
030:        import javax.management.MalformedObjectNameException;
031:        import javax.management.ObjectName;
032:
033:        import org.objectweb.jonas.jmx.J2eeObjectName;
034:        import org.objectweb.jonas.management.j2eemanagement.J2EEDeployedObject;
035:
036:        /**
037:         * Class representing an Ear structure which is composed of :
038:         * <ul>
039:         * <li>array of URL of ejb-jar files</li>
040:         * <li>array of URL of war files</li>
041:         * <li>array of URL of rar files</li>
042:         * </ul>
043:         * @author Florent Benoit
044:         * @author Michel-Ange Anton (JSR77: J2EEApplication)
045:         * @author Adriana Danes
046:         */
047:        public class Ear extends J2EEDeployedObject implements  EarMBean {
048:
049:            /**
050:             * URLs of ejb-jars files
051:             */
052:            private URL[] ejbJars = null;
053:
054:            /**
055:             * Urls of wars files
056:             */
057:            private URL[] wars = null;
058:
059:            /**
060:             * Urls of rars files
061:             */
062:            private URL[] rars = null;
063:
064:            /**
065:             * Url of this EAR
066:             */
067:            private URL earUrl = null;
068:
069:            /**
070:             * The name of this EAR (J2EEApplication name).
071:             */
072:            private String name = null;
073:
074:            /**
075:             * The unpack work copy of this EAR.
076:             */
077:            private String unpackName = null;
078:
079:            /**
080:             * The modules OBJECT_NAMEs
081:             */
082:            private String[] modules = null;
083:
084:            /**
085:             * The web modules OBJECT_NAMEs
086:             */
087:            private String[] webModules = null;
088:
089:            /**
090:             * Construct an Ear structure with the specified files
091:             * @param objectName  The object name of the deployed object
092:             * @param pName name of the application
093:             * @param pUnpackName name of the working copy of the ear
094:             * @param earUrl the url of this ear
095:             * @param deploymentDescriptor the deployment descriptor of the file
096:             * @param ejbJars the URLs of ejb-jar files
097:             * @param wars the URLs of the war files
098:             * @param rars the URLs of the rar files
099:             */
100:            public Ear(String objectName, String pName, String pUnpackName,
101:                    URL earUrl, String deploymentDescriptor, URL[] ejbJars,
102:                    URL[] wars, URL[] rars) {
103:                super (objectName);
104:                this .earUrl = earUrl;
105:                //this.deploymentDescriptor = deploymentDescriptor;
106:                setDeploymentDescriptor(deploymentDescriptor);
107:                this .ejbJars = ejbJars;
108:                this .wars = wars;
109:                this .rars = rars;
110:                name = pName;
111:                unpackName = pUnpackName;
112:                setModules();
113:                setWebModules();
114:            }
115:
116:            /**
117:             * Return the url of this Ear
118:             * @return the url of this Ear
119:             */
120:            public URL getEarUrl() {
121:                return earUrl;
122:            }
123:
124:            /**
125:             * Return the ejb-jar files
126:             * @return the ejb-jar files
127:             */
128:            public URL[] getEjbJars() {
129:                return ejbJars;
130:            }
131:
132:            /**
133:             * Return the war files
134:             * @return the war files
135:             */
136:            public URL[] getWars() {
137:                return wars;
138:            }
139:
140:            /**
141:             * Return the rar files
142:             * @return the rar files
143:             */
144:            public URL[] getRars() {
145:                return rars;
146:            }
147:
148:            /**
149:             * The application name.
150:             * @return application name
151:             */
152:            public String getName() {
153:                return name;
154:            }
155:
156:            /**
157:             * The name of the working copy of the ear
158:             * @return work name
159:             */
160:            public String getUnpackName() {
161:                return unpackName;
162:            }
163:
164:            /**
165:             * Determine the J2EEModules used by this J2EEApplication (jar, war, rar).
166:             */
167:            private void setModules() {
168:                ArrayList al = new ArrayList();
169:                try {
170:                    // ear ObjectName
171:                    ObjectName on = ObjectName.getInstance(getObjectName());
172:                    String domain = on.getDomain();
173:                    String serverName = on.getKeyProperty(J2EE_TYPE_SERVER);
174:                    String appName = on.getKeyProperty(NAME);
175:                    // Add EJBModules
176:                    ObjectName modulesOn = J2eeObjectName.getEJBModules(domain,
177:                            serverName, appName);
178:                    al.addAll(J2eeObjectName.queryStrings(modulesOn));
179:                    // Add WebModules
180:                    modulesOn = J2eeObjectName.getWebModules(domain,
181:                            serverName, appName);
182:                    al.addAll(J2eeObjectName.queryStrings(modulesOn));
183:                    // Add ResourceAdapterModules
184:                    modulesOn = J2eeObjectName.getResourceAdapterModules(
185:                            domain, serverName, appName);
186:                    al.addAll(J2eeObjectName.queryStrings(modulesOn));
187:                    // Add AppClientModules
188:                    modulesOn = J2eeObjectName.getAppClientModules(domain,
189:                            serverName, appName);
190:                    al.addAll(J2eeObjectName.queryStrings(modulesOn));
191:                } catch (MalformedObjectNameException e) {
192:                    // none action
193:                    throw new RuntimeException(
194:                            "Error while using an objectname", e);
195:                }
196:                modules = ((String[]) al.toArray(new String[al.size()]));
197:            }
198:
199:            /**
200:             * Return the J2EEModules used by this J2EEApplication (jar, war, rar).
201:             * @return A array of OBJECT_NAMEs corresponding to these modules.
202:             */
203:            public String[] getModules() {
204:                return modules;
205:            }
206:
207:            /**
208:             * @return Returns the webModules.
209:             */
210:            public String[] getWebModules() {
211:                return webModules;
212:            }
213:
214:            /**
215:             * Determine the web modules contained in this J2EEApplication
216:             */
217:            public void setWebModules() {
218:                ArrayList al = new ArrayList();
219:                try {
220:                    // ear ObjectName
221:                    ObjectName on = ObjectName.getInstance(getObjectName());
222:                    String domain = on.getDomain();
223:                    String serverName = on.getKeyProperty(J2EE_TYPE_SERVER);
224:                    String appName = on.getKeyProperty(NAME);
225:                    // Add WebModules
226:                    ObjectName modulesOn = J2eeObjectName.getWebModules(domain,
227:                            serverName, appName);
228:                    al.addAll(J2eeObjectName.queryStrings(modulesOn));
229:                } catch (MalformedObjectNameException e) {
230:                    // none action
231:                    throw new RuntimeException(
232:                            "Error while using an objectname", e);
233:                }
234:                webModules = ((String[]) al.toArray(new String[al.size()]));
235:            }
236:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.