Skip to content

Commit

Permalink
Merge pull request #156 from ehsavoie/JBMETA-437
Browse files Browse the repository at this point in the history
[JBMETA-437]: Upgrade jboss-web and jboss-ejb3 schemas to JakartaEE 10.
  • Loading branch information
ehsavoie authored Sep 8, 2022
2 parents c912769 + 31c1d1f commit eb99386
Show file tree
Hide file tree
Showing 20 changed files with 1,233 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
* @version $Revision: 8.0 $
*/
public interface JavaEEMetaDataConstants {
/**
* The jakartaee namespace
*/
String JAKARTAEE_NS = "https://jakarta.ee/xml/ns/jakartaee";
/**
* The javaee namespace
*/
Expand All @@ -52,6 +56,10 @@ public interface JavaEEMetaDataConstants {
* The jboss javaee namespaces
*/
String JBOSS_NS = "http://www.jboss.com/xml/ns/javaee";
/**
* The jboss jakartaee namespaces
*/
String JBOSS_JAKARTAEE_NS = "http://www.jboss.com/xml/ns/jakartaee";

/**
* The jbosscmp-jdbc namespace
Expand Down
564 changes: 564 additions & 0 deletions common/src/main/resources/schema/jboss-common_9_0.xsd

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ public abstract class AbstractJavaEEEverythingTest extends AbstractJavaEEMetaDat
public enum Mode {
JBOSS,
JBOSS_DTD,
SPEC
SPEC,
JAKARTAEE
}

public enum Descriptor {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public JBossAppMetaData parse(final XMLStreamReader reader, final PropertyReplac
while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
final Element element = Element.forName(reader.getLocalName());
Namespace namespace = Namespace.forUri(reader.getNamespaceURI());
if (namespace == Namespace.SPEC || namespace == Namespace.SPEC_7_0) {
if (namespace == Namespace.SPEC || namespace == Namespace.SPEC_7_0 || namespace == Namespace.JAKARTAEE) {
super.handleElement(reader, appMetaData, propertyReplacer);
} else {
switch (element) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ public enum Namespace {
// must be first
UNKNOWN(null),
JBOSS("http://www.jboss.com/xml/ns/javaee"),
JBOSS_JAKARTA("http://www.jboss.com/xml/ns/jakartaee"),
SPEC("http://java.sun.com/xml/ns/javaee"),
SPEC_7_0("http://xmlns.jcp.org/xml/ns/javaee");
SPEC_7_0("http://xmlns.jcp.org/xml/ns/javaee"),
JAKARTAEE("https://jakarta.ee/xml/ns/jakartaee");

private final String uri;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ protected void processElement(MD metaData, XMLStreamReader reader, final Propert
switch (namespace) {
case SPEC:
case SPEC_7_0:
case JAKARTAEE:
final EjbJarElement ejbJarElement = EjbJarElement.forName(reader.getLocalName());
switch (ejbJarElement) {
case DESCRIPTION:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ protected void processElement(MD metaData, XMLStreamReader reader, PropertyRepla
switch (namespace) {
case SPEC:
case SPEC_7_0:
case JAKARTAEE:
final EjbJarElement ejbJarElement = EjbJarElement.forName(reader.getLocalName());
switch (ejbJarElement) {
case METHOD:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ protected void processElement(AssemblyDescriptorMetaData assemblyDescriptor, XML
switch (namespace) {
case SPEC:
case SPEC_7_0:
case JAKARTAEE:
processSpecElement(assemblyDescriptor, reader, propertyReplacer);
break;
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ protected void processElement(EjbJarMetaData metaData, XMLStreamReader reader, f
final Element element = Element.forName(reader.getLocalName());
switch (namespace) {
case JBOSS:
case JBOSS_JAKARTA:
switch (element) {
case ENTERPRISE_BEANS:
metaData.setEnterpriseBeans(parseEnterpriseBeans(reader, metaData.getEjbJarVersion(), propertyReplacer));
Expand All @@ -143,6 +144,7 @@ protected void processElement(EjbJarMetaData metaData, XMLStreamReader reader, f
break;
case SPEC:
case SPEC_7_0:
case JAKARTAEE:
switch (element) {
case ASSEMBLY_DESCRIPTOR:
metaData.setAssemblyDescriptor(parseAssemblyDescriptor(reader, propertyReplacer));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,12 @@ protected void processElement(JBossEnterpriseBeansMetaData metaData, XMLStreamRe
final Namespace namespace = Namespace.forUri(reader.getNamespaceURI());
switch (namespace) {
case JBOSS:
case JBOSS_JAKARTA:
processJBossElement(metaData, reader, propertyReplacer);
break;
case SPEC:
case SPEC_7_0:
case JAKARTAEE:
super.processElement(metaData, reader, propertyReplacer);
break;
case UNKNOWN:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,12 @@ protected void processElement(JBossGenericBeanMetaData metaData, XMLStreamReader
final Namespace namespace = Namespace.forUri(reader.getNamespaceURI());
switch (namespace) {
case JBOSS:
case JBOSS_JAKARTA:
processJBossElement(metaData, reader);
break;
case SPEC:
case SPEC_7_0:
case JAKARTAEE:
processSpecElement(metaData, reader, propertyReplacer);
break;
case UNKNOWN:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ public enum Namespace {
// must be first
UNKNOWN(null),
JBOSS("http://www.jboss.com/xml/ns/javaee"),
JBOSS_JAKARTA("http://www.jboss.com/xml/ns/jakartaee"),
SPEC("http://java.sun.com/xml/ns/javaee"),
SPEC_7_0("http://xmlns.jcp.org/xml/ns/javaee");
SPEC_7_0("http://xmlns.jcp.org/xml/ns/javaee"),
JAKARTAEE("https://jakarta.ee/xml/ns/jakartaee");

private final String uri;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,11 @@ protected void processElement(MD metaData, XMLStreamReader reader, PropertyRepla
switch (namespace) {
case SPEC:
case SPEC_7_0:
case JAKARTAEE:
delegate.processElement(metaData, reader, propertyReplacer);
break;
case JBOSS:
case JBOSS_JAKARTA:
case UNKNOWN:
AbstractMetaDataParser<?> parser = getParser(reader.getNamespaceURI());
metaData.addAny(parser.parse(reader, propertyReplacer));
Expand Down
43 changes: 43 additions & 0 deletions ejb/src/main/resources/schema/jboss-ejb3-4_0.xsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ JBoss, Home of Professional Open Source
~ Copyright 2022, Red Hat, Inc., and individual contributors as indicated
~ by the @authors tag.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.jboss.com/xml/ns/jakartaee"
xmlns="http://www.jboss.com/xml/ns/jakartaee"
xmlns:jakartaee="https://jakarta.ee/xml/ns/jakartaee"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
version="4.0">
<xs:import namespace="https://jakarta.ee/xml/ns/jakartaee"/>

<xs:element name="ejb" type="jboss-ejb-beanType"/>

<xs:element name="ejb-jar" type="jboss-ejb-jarType"/>

<xs:element name="enterprise-beans" type="jboss-enterprise-beansType"/>

<xs:element name="destination-jndi-name" type="xs:string" />

<xs:element name="distinct-name" type="xs:string">
<xs:annotation>
<xs:documentation>
The distinct-name for this EJB module.
</xs:documentation>
</xs:annotation>
</xs:element>
</xs:schema>
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public enum Version {
JBOSS_WEB_13_0(13, 0),
JBOSS_WEB_14_0(14, 0),
JBOSS_WEB_14_1(14, 1),
JBOSS_WEB_15_0(15, 0),
;
private final String location;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public void setCacheName(String cacheName) {
this.cacheName = cacheName;
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder(100);
sb.append("cacheName=").append(cacheName).append(";granularity=").append(granularity);
Expand Down
Loading

0 comments on commit eb99386

Please sign in to comment.