Source Code Cross Referenced for EjbJar.java in  » J2EE » JOnAS-4.8.6 » org » objectweb » jonas_ejb » 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_ejb.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:         *
008:         * modify it under the terms of the GNU Lesser General Public
009:         * License as published by the Free Software Foundation; either
010:         * version 2.1 of the License, or 1any later version.
011:         *
012:         * This library is distributed in the hope that it will be useful,
013:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
014:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
015:         * Lesser General Public License for more details.
016:         *
017:         * You should have received a copy of the GNU Lesser General Public
018:         * License along with this library; if not, write to the Free Software
019:         * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
020:         * USA
021:         *
022:         * Initial developer: JOnAS team
023:         * --------------------------------------------------------------------------
024:         * $Id: EjbJar.java 4716 2004-05-10 11:45:44Z sauthieg $
025:         * --------------------------------------------------------------------------
026:         */package org.objectweb.jonas_ejb.deployment.xml;
027:
028:        import java.util.ArrayList;
029:        import java.util.StringTokenizer;
030:
031:        import org.objectweb.jonas_lib.deployment.xml.AbsDescriptionElement;
032:        import org.objectweb.jonas_lib.deployment.xml.DescriptionGroupXml;
033:        import org.objectweb.jonas_lib.deployment.xml.TopLevelElement;
034:
035:        /**
036:         * This class defines the implementation of the element ejb-jar
037:         *
038:         * @author JOnAS team
039:         */
040:
041:        public class EjbJar extends AbsDescriptionElement implements 
042:                TopLevelElement, DescriptionGroupXml {
043:
044:            /**
045:             * Position of Version Number in Public ID Spec
046:             */
047:            private static final int VERSION_INDEX = 3;
048:
049:            /**
050:             * enterprise-beans
051:             */
052:            private EnterpriseBeans enterpriseBeans = null;
053:
054:            /**
055:             * relationships
056:             */
057:            private Relationships relationships = null;
058:
059:            /**
060:             * assembly-descriptor
061:             */
062:            private AssemblyDescriptor assemblyDescriptor = null;
063:
064:            /**
065:             * ejb-client-jar
066:             */
067:            private String ejbClientJar = null;
068:
069:            /**
070:             * PublicId of the DTD we are processing
071:             */
072:            private String publicId = null;
073:
074:            /**
075:             * Version of the EJB specification
076:             * is built from the publicId if DOCTYPE
077:             * or via the attribute version ins case of schema
078:             */
079:            private String version = null;
080:
081:            /**
082:             * Constructor
083:             */
084:            public EjbJar() {
085:                super ();
086:            }
087:
088:            /**
089:             * Get the PublicId of the DTD used
090:             * @return the PublicId
091:             */
092:            public String getPublicId() {
093:                return publicId;
094:            }
095:
096:            /**
097:             * Set the PublicId of the DTD used
098:             * @param pid the publicId
099:             */
100:            public void setPublicId(String pid) {
101:                publicId = pid;
102:            }
103:
104:            /**
105:             * Get the Version of the EJB specification
106:             * @return the Version
107:             */
108:            public String getVersion() {
109:                if (version != null) {
110:                    return version;
111:                }
112:                if (publicId == null) {
113:                    // No DOCTYPE  and No version attribute in ejb-jar element
114:                    version = "2.1";
115:                } else {
116:                    ArrayList al = new ArrayList();
117:                    // Version must be set via the PublicId of the DOCTYPE
118:                    StringTokenizer st = new StringTokenizer(publicId, "//");
119:                    while (st.hasMoreTokens()) {
120:                        al.add(st.nextToken().trim());
121:                    }
122:                    String spec = (String) al.get(2);
123:                    al.clear();
124:                    st = new StringTokenizer(spec, " ");
125:                    while (st.hasMoreTokens()) {
126:                        al.add(st.nextToken().trim());
127:                    }
128:                    version = (String) al.get(VERSION_INDEX);
129:                }
130:                return version;
131:
132:            }
133:
134:            /**
135:             * Set the Version  of the EJB specification
136:             *
137:             * @param ver the version
138:             */
139:            public void setVersion(String ver) {
140:                version = ver;
141:            }
142:
143:            /**
144:             * Gets the enterprise-beans
145:             * @return the enterprise-beans
146:             */
147:            public EnterpriseBeans getEnterpriseBeans() {
148:                return enterpriseBeans;
149:            }
150:
151:            /**
152:             * Set the enterprise-beans
153:             * @param enterpriseBeans enterpriseBeans
154:             */
155:            public void setEnterpriseBeans(EnterpriseBeans enterpriseBeans) {
156:                this .enterpriseBeans = enterpriseBeans;
157:            }
158:
159:            /**
160:             * Gets the relationships
161:             * @return the relationships
162:             */
163:            public Relationships getRelationships() {
164:                return relationships;
165:            }
166:
167:            /**
168:             * Set the relationships
169:             * @param relationships relationships
170:             */
171:            public void setRelationships(Relationships relationships) {
172:                this .relationships = relationships;
173:            }
174:
175:            /**
176:             * Gets the assembly-descriptor
177:             * @return the assembly-descriptor
178:             */
179:            public AssemblyDescriptor getAssemblyDescriptor() {
180:                return assemblyDescriptor;
181:            }
182:
183:            /**
184:             * Set the assembly-descriptor
185:             * @param assemblyDescriptor assemblyDescriptor
186:             */
187:            public void setAssemblyDescriptor(
188:                    AssemblyDescriptor assemblyDescriptor) {
189:                this .assemblyDescriptor = assemblyDescriptor;
190:            }
191:
192:            /**
193:             * Gets the ejb-client-jar
194:             * @return the ejb-client-jar
195:             */
196:            public String getEjbClientJar() {
197:                return ejbClientJar;
198:            }
199:
200:            /**
201:             * Set the ejb-client-jar
202:             * @param ejbClientJar ejbClientJar
203:             */
204:            public void setEjbClientJar(String ejbClientJar) {
205:                this .ejbClientJar = ejbClientJar;
206:            }
207:
208:            /**
209:             * Represents this element by it's XML description.
210:             * @param indent use this indent for prexifing XML representation.
211:             * @return the XML description of this object.
212:             */
213:            public String toXML(int indent) {
214:                StringBuffer sb = new StringBuffer();
215:                sb.append(indent(indent));
216:                sb.append("<ejb-jar>\n");
217:
218:                indent += 2;
219:
220:                // description
221:                sb.append(xmlElement(getDescription(), "description", indent));
222:                // display-name
223:                sb.append(xmlElement(getDisplayName(), "display-name", indent));
224:                // small-icon
225:                sb.append(xmlElement(getIcon().getSmallIcon(), "small-icon",
226:                        indent));
227:                // large-icon
228:                sb.append(xmlElement(getIcon().getLargeIcon(), "large-icon",
229:                        indent));
230:                // enterprise-beans
231:                if (enterpriseBeans != null) {
232:                    sb.append(enterpriseBeans.toXML(indent));
233:                }
234:                // relationships
235:                if (relationships != null) {
236:                    sb.append(relationships.toXML(indent));
237:                }
238:                // assembly-descriptor
239:                if (assemblyDescriptor != null) {
240:                    sb.append(assemblyDescriptor.toXML(indent));
241:                }
242:                // ejb-client-jar
243:                sb.append(xmlElement(ejbClientJar, "ejb-client-jar", indent));
244:                indent -= 2;
245:                sb.append(indent(indent));
246:                sb.append("</ejb-jar>\n");
247:
248:                return sb.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.