You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by ge...@apache.org on 2011/06/05 06:05:24 UTC
svn commit: r1131647 - in /geronimo/server/trunk/plugins:
j2ee/geronimo-j2ee-schema/src/main/java/org/apache/geronimo/schema/
j2ee/geronimo-web-2.5-builder/src/main/xsd/
jetty8/geronimo-jetty8-builder/src/main/xsd/
openejb/geronimo-openejb-builder/src/...
Author: genspring
Date: Sun Jun 5 04:05:23 2011
New Revision: 1131647
URL: http://svn.apache.org/viewvc?rev=1131647&view=rev
Log:
GERONIMO-5995 Provide a way to customize ejb in geornimo-web.xml, keep same the module structure to geronimo-application.xsd so that it's easier to extend in the future.
Modified:
geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-schema/src/main/java/org/apache/geronimo/schema/SchemaConversionUtils.java
geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/xsd/geronimo-web-2.0.1.xsd
geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/main/xsd/geronimo-jetty-2.0.2.xsd
geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java
geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7-builder/src/main/xsd/geronimo-tomcat-2.0.1.xsd
Modified: geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-schema/src/main/java/org/apache/geronimo/schema/SchemaConversionUtils.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-schema/src/main/java/org/apache/geronimo/schema/SchemaConversionUtils.java?rev=1131647&r1=1131646&r2=1131647&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-schema/src/main/java/org/apache/geronimo/schema/SchemaConversionUtils.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-schema/src/main/java/org/apache/geronimo/schema/SchemaConversionUtils.java Sun Jun 5 04:05:23 2011
@@ -36,6 +36,8 @@ public class SchemaConversionUtils {
static final String GERONIMO_NAMING_NAMESPACE = "http://geronimo.apache.org/xml/ns/naming-1.2";
private static final String GERONIMO_SERVICE_NAMESPACE = "http://geronimo.apache.org/xml/ns/deployment-1.2";
public static final String JPA_PERSISTENCE_NAMESPACE = "http://java.sun.com/xml/ns/persistence";
+ private static final String OPENEJB_JAR_NAMESPACE = "http://openejb.apache.org/xml/ns/openejb-jar-2.3";
+
private static final Map<String, ElementConverter> GERONIMO_SCHEMA_CONVERSIONS = new HashMap<String, ElementConverter>();
@@ -59,6 +61,7 @@ public class SchemaConversionUtils {
GERONIMO_SCHEMA_CONVERSIONS.put("client-environment", new NamespaceElementConverter(GERONIMO_SERVICE_NAMESPACE));
GERONIMO_SCHEMA_CONVERSIONS.put("server-environment", new NamespaceElementConverter(GERONIMO_SERVICE_NAMESPACE));
GERONIMO_SCHEMA_CONVERSIONS.put("persistence", new PersistenceElementConverter("2.0"));
+ GERONIMO_SCHEMA_CONVERSIONS.put("openejb-jar", new NamespaceElementConverter(OPENEJB_JAR_NAMESPACE));
}
private SchemaConversionUtils() {
Modified: geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/xsd/geronimo-web-2.0.1.xsd
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/xsd/geronimo-web-2.0.1.xsd?rev=1131647&r1=1131646&r2=1131647&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/xsd/geronimo-web-2.0.1.xsd (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/xsd/geronimo-web-2.0.1.xsd Sun Jun 5 04:05:23 2011
@@ -66,7 +66,17 @@
</xs:documentation>
</xs:annotation>
</xs:element>
-
+ <xs:element name="module" type="web:moduleType" minOccurs="0"
+ maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>
+ An optional module element which defines various
+ modules included in the web application archive and
+ adds an optional alt-dd element defining a Geronimo
+ specific deployment descriptor.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
<xs:element name="context-root" type="xs:string" minOccurs="0"/>
<xs:element name="work-dir" type="xs:string" minOccurs="0">
<xs:annotation>
@@ -118,8 +128,6 @@
</xs:element>
<xs:any namespace="http://java.sun.com/xml/ns/persistence"/>
</xs:choice>
-
-
</xs:sequence>
</xs:complexType>
@@ -137,5 +145,67 @@
<xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
+
+ <xs:complexType name="moduleType">
+ <xs:annotation>
+ <xs:documentation>
+ add an optional alt-dd element defining a Geronimo specific
+ deployment descriptor for war ejb module.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:sequence>
+ <xs:choice>
+ <xs:element name="ejb" type="web:pathType">
+ <xs:annotation>
+ <xs:documentation>
+ The presence of this element is indicative of J2EE
+ module type to be EJB module
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:choice>
+ <xs:choice>
+ <xs:element name="alt-dd" type="web:pathType">
+ <xs:annotation>
+ <xs:documentation>
+ Specifies an optional URI to the post-assembly
+ version of the Geronimo specific deployment
+ descriptor file for a particular J2EE module
+ relative to the enterprise application package main
+ directory.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:any namespace="##other" processContents="lax">
+ <xs:annotation>
+ <xs:documentation>
+ This option element contains the alternate geronimo
+ deployment plan for included modules.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:any>
+ </xs:choice>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="pathType">
+ <xs:annotation>
+ <xs:documentation>Mirrors j2ee:pathType.</xs:documentation>
+ </xs:annotation>
+ <xs:simpleContent>
+ <xs:restriction base="web:string" />
+ </xs:simpleContent>
+ </xs:complexType>
+
+ <xs:complexType name="string">
+ <xs:annotation>
+ <xs:documentation>Mirrors j2ee:string.</xs:documentation>
+ </xs:annotation>
+ <xs:simpleContent>
+ <xs:extension base="xs:token">
+ <xs:attribute name="id" type="xs:ID" />
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
</xs:schema>
Modified: geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/main/xsd/geronimo-jetty-2.0.2.xsd
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/main/xsd/geronimo-jetty-2.0.2.xsd?rev=1131647&r1=1131646&r2=1131647&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/main/xsd/geronimo-jetty-2.0.2.xsd (original)
+++ geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/main/xsd/geronimo-jetty-2.0.2.xsd Sun Jun 5 04:05:23 2011
@@ -104,7 +104,17 @@
</xs:documentation>
</xs:annotation>
</xs:element>
-
+ <xs:element name="module" type="web:moduleType" minOccurs="0"
+ maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>
+ An optional module element which defines various
+ modules included in the web application archive and
+ adds an optional alt-dd element defining a Geronimo
+ specific deployment descriptor.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
<xs:element name="context-root" type="xs:string" minOccurs="0">
<xs:annotation>
<xs:documentation>
@@ -261,4 +271,66 @@
<xs:element ref="jaspi:serverAuthModule"/>
</xs:choice>
</xs:complexType>
+
+ <xs:complexType name="moduleType">
+ <xs:annotation>
+ <xs:documentation>
+ add an optional alt-dd element defining a Geronimo specific
+ deployment descriptor for war ejb module.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:sequence>
+ <xs:choice>
+ <xs:element name="ejb" type="web:pathType">
+ <xs:annotation>
+ <xs:documentation>
+ The presence of this element is indicative of J2EE
+ module type to be EJB module
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:choice>
+ <xs:choice>
+ <xs:element name="alt-dd" type="web:pathType">
+ <xs:annotation>
+ <xs:documentation>
+ Specifies an optional URI to the post-assembly
+ version of the Geronimo specific deployment
+ descriptor file for a particular J2EE module
+ relative to the enterprise application package main
+ directory.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:any namespace="##other" processContents="lax">
+ <xs:annotation>
+ <xs:documentation>
+ This option element contains the alternate geronimo
+ deployment plan for included modules.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:any>
+ </xs:choice>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="pathType">
+ <xs:annotation>
+ <xs:documentation>Mirrors j2ee:pathType.</xs:documentation>
+ </xs:annotation>
+ <xs:simpleContent>
+ <xs:restriction base="web:string" />
+ </xs:simpleContent>
+ </xs:complexType>
+
+ <xs:complexType name="string">
+ <xs:annotation>
+ <xs:documentation>Mirrors j2ee:string.</xs:documentation>
+ </xs:annotation>
+ <xs:simpleContent>
+ <xs:extension base="xs:token">
+ <xs:attribute name="id" type="xs:ID" />
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
</xs:schema>
Modified: geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java?rev=1131647&r1=1131646&r2=1131647&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java (original)
+++ geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java Sun Jun 5 04:05:23 2011
@@ -295,7 +295,7 @@ public class EjbModuleBuilder implements
//check for web module
if (module instanceof WebModule) {
//check for WEB-INF/ejb-jar.xml
- Module ejbModule = createModule(null, moduleFile, targetPath, null, environment, module, naming, idBuilder, "WEB-INF/", true);
+ Module ejbModule = createModule(plan, moduleFile, targetPath, null, environment, module, naming, idBuilder, "WEB-INF/", true);
if (ejbModule != null) {
module.getModules().add(ejbModule);
//???
@@ -434,10 +434,25 @@ public class EjbModuleBuilder implements
xmlCursor.toFirstChild();
qname = xmlCursor.getName();
}
+
+ while (xmlCursor.hasNextToken()){
+
+ qname = xmlCursor.getName();
+ if (qname == null || qname.getLocalPart() == null) {
+ xmlCursor.toNextToken();
+ continue;
+ }
+
if (qname.getLocalPart().equals("openejb-jar")) {
ejbModule.getAltDDs().put("openejb-jar.xml", xmlCursor.xmlText());
+ break;
} else if (qname.getLocalPart().equals("ejb-jar") && qname.getNamespaceURI().equals("http://geronimo.apache.org/xml/ns/j2ee/ejb/openejb-2.0")) {
ejbModule.getAltDDs().put("geronimo-openejb.xml", xmlCursor.xmlText());
+ break;
+ }
+
+ xmlCursor.toNextToken();
+
}
}
Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7-builder/src/main/xsd/geronimo-tomcat-2.0.1.xsd
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7-builder/src/main/xsd/geronimo-tomcat-2.0.1.xsd?rev=1131647&r1=1131646&r2=1131647&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7-builder/src/main/xsd/geronimo-tomcat-2.0.1.xsd (original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7-builder/src/main/xsd/geronimo-tomcat-2.0.1.xsd Sun Jun 5 04:05:23 2011
@@ -99,7 +99,17 @@
</xs:documentation>
</xs:annotation>
</xs:element>
-
+ <xs:element name="module" type="tomcat:moduleType" minOccurs="0"
+ maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>
+ An optional module element which defines various
+ modules included in the web application archive and
+ adds an optional alt-dd element defining a Geronimo
+ specific deployment descriptor.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
<xs:element name="context-root" type="xs:string" minOccurs="0">
<xs:annotation>
<xs:documentation>
@@ -312,4 +322,66 @@
<xs:attribute name="value" type="xs:string" />
<xs:attribute name="override" type="xs:boolean" default="false"/>
</xs:complexType>
+
+ <xs:complexType name="moduleType">
+ <xs:annotation>
+ <xs:documentation>
+ add an optional alt-dd element defining a Geronimo specific
+ deployment descriptor for war ejb module.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:sequence>
+ <xs:choice>
+ <xs:element name="ejb" type="web:pathType">
+ <xs:annotation>
+ <xs:documentation>
+ The presence of this element is indicative of J2EE
+ module type to be EJB module
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:choice>
+ <xs:choice>
+ <xs:element name="alt-dd" type="web:pathType">
+ <xs:annotation>
+ <xs:documentation>
+ Specifies an optional URI to the post-assembly
+ version of the Geronimo specific deployment
+ descriptor file for a particular J2EE module
+ relative to the enterprise application package main
+ directory.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:any namespace="##other" processContents="lax">
+ <xs:annotation>
+ <xs:documentation>
+ This option element contains the alternate geronimo
+ deployment plan for included modules.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:any>
+ </xs:choice>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="pathType">
+ <xs:annotation>
+ <xs:documentation>Mirrors j2ee:pathType.</xs:documentation>
+ </xs:annotation>
+ <xs:simpleContent>
+ <xs:restriction base="tomcat:string" />
+ </xs:simpleContent>
+ </xs:complexType>
+
+ <xs:complexType name="string">
+ <xs:annotation>
+ <xs:documentation>Mirrors j2ee:string.</xs:documentation>
+ </xs:annotation>
+ <xs:simpleContent>
+ <xs:extension base="xs:token">
+ <xs:attribute name="id" type="xs:ID" />
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
</xs:schema>