diff --git a/.github/dependabot.yml b/.github/dependabot.yml index e12c71f92640..062b041121e4 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -2,6 +2,16 @@ version: 2 updates: + - package-ecosystem: "maven" + directory: "/" + schedule: + interval: "daily" + ignore: + # Only allow for patch release upgrades + - dependency-name: '*' + update-types: ['version-update:semver-major', 'version-update:semver-minor'] + rebase-strategy: "disabled" + open-pull-requests-limit: 5 - package-ecosystem: "github-actions" # Workflow files stored in the # default location of `.github/workflows` diff --git a/.github/wildfly-bot.yml b/.github/wildfly-bot.yml new file mode 100644 index 000000000000..650e480510c9 --- /dev/null +++ b/.github/wildfly-bot.yml @@ -0,0 +1,285 @@ +wildfly: + rules: + - id: appclient + titleBody: "appclient" + directories: [ appclient ] + notify: [ bstansberry ] + + - id: batch-jberet + titleBody: "batch|batch-jberet" + directories: [ batch-jberet ] + notify: [ chengfang ] + + - id: bean-validation + titleBody: "bean-validation|bean validation" + directories: [ bean-validation ] + notify: [ jasondlee ] + + - id: clustering + titleBody: "clustering" + directories: + - clustering + - testsuite/integration/clustering + notify: [ pferraro ] + + - id: connector + titleBody: "connector" + directories: [ connector ] + notify: [ tadamski ] + + - id: ee + directories: [ ee ] + notify: [ bstansberry ] + + - id: ejb3 + titleBody: "ejb3|ejb" + directories: [ ejb3 ] + notify: [ chengfang ] + + - id: elytron + titleBody: "elytron|oidc" + directories: + - elytron-oidc-client + - testsuite/integration/elytron + - testsuite/integration/elytron-oidc-client + notify: [ fjuma ] + + - id: health + titleBody: "health" + directories: + - health + - microprofile/health-smallrye + - testsuite/integration/microprofile-tck/health + notify: [ xstefank ] + + - id: iiop + titleBody: "iiop" + directories: [ iiop-openjdk ] + notify: [ tadamski ] + + - id: jaxrs + titleBody: "jaxrs" + directories: [ jaxrs ] + notify: [ jamezp ] + + - id: jdr + titleBody: "jdr" + directories: [ jdr ] + notify: [ bmaxwell ] + + - id: jpa + titleBody: "jpa" + directories: [ jpa ] + notify: [ scottmarlow ] + + - id: jsf + titleBody: "jsf" + directories: [ jsf ] + notify: [ jasondlee ] + + - id: mail + titleBody: "mail" + directories: [ mail ] + notify: [ yersan ] + + - id: messaging-activemq + titleBody: "activemq|messaging" + directories: [ messaging-activemq ] + notify: [ ehsavoie ] + + - id: metrics + titleBody: "metrics" + directories: [ metrics ] + notify: [ jasondlee ] + + - id: micrometer + titleBody: "micrometer" + directories: + - observability/micrometer + - observability/micrometer-api + notify: [ jasondlee ] + + - id: opentelemtry + titleBody: "telemetry" + directories: + - observability/opentelemetry + - observability/opentelemetry-api + - microprofile/telemetry-smallrye + - testsuite/integration/microprofile-tck/telemetry + notify: [ jasondlee ] + + - id: mod_cluster + titleBody: "mod_cluster" + directories: [ mod_cluster ] + notify: [ rhusar ] + + - id: naming + titleBody: "naming" + directories: [ naming ] + notify: [ ropalka ] + + - id: picketlink + titleBody: "picketlink" + directories: [ picketlink ] + notify: [ fjuma ] + + - id: pojo + titleBody: "pojo" + directories: [ pojo ] + notify: [ bstansberry ] + + - id: rts + titleBody: "rts" + directories: [ rts ] + notify: [ mmusgrove ] + + - id: sar + titleBody: "sar" + directories: [ sar ] + notify: [ kabir ] + + - id: security + titleBody: "security" + directories: [ security ] + notify: [ fjuma ] + + - id: spec-api + titleBody: "spec-api" + directories: [ spec-api ] + notify: [ bstansberry ] + + - id: system-jmx + titleBody: "system-jmx|jmx" + directories: [ system-jmx ] + notify: [ kabir ] + + - id: microprofile-config + titleBody: "config" + directories: + - microprofile/config-smallrye + - testsuite/integration/microprofile-tck/config + notify: [ kabir ] + + - id: microprofile-fault-tolerance + titleBody: "fault-tolerance|fault tolerance" + directories: + - microprofile/fault-tolerance-smallrye + - testsuite/integration/microprofile-tck/fault-tolerance + notify: [ rhusar ] + + - id: microprofile-jwt + titleBody: "jwt" + directories: + - microprofile/jwt-smallrye + - testsuite/integration/microprofile-tck/jwt + notify: [ fjuma ] + + - id: microprofile-lra + titleBody: "lra" + directories: + - microprofile/lra + - testsuite/integration/microprofile-tck/lra + notify: [ xstefank ] + + - id: microprofile-openapi + titleBody: "openapi|Open API" + directories: + - microprofile/openapi-smallrye + - testsuite/integration/microprofile-tck/openapi + notify: [ pferraro ] + + - id: microprofile-reactive + titleBody: "reactive" + directories: + - microprofile/reactive-messaging-smallrye + - microprofile/reactive-streams-operators-smallrye + - testsuite/integration/microprofile-tck/reactive-messaging + - testsuite/integration/microprofile-tck/reactive-streams-operators + notify: [ kabir ] + + - id: microprofile-rest-client + titleBody: "rest-client|REST client" + directories: + - testsuite/integration/microprofile-tck/rest-client + notify: [ jamezp ] + + - id: testsuite-domain + directories: + - testsuite/domain + notify: [ yersan ] + + - id: testsuite-galleon + directories: + - testsuite/galleon + notify: [ jfdenise ] + + - id: testsuite-multinode + directories: + - testsuite/integration/multinode + notify: [ chengfang ] + + - id: testsuite-rbac + directories: + - testsuite/integration/rbac + notify: [ yersan ] + + - id: testsuite-vdx + directories: + - testsuite/integration/vdx + notify: [ bstansberry ] + + - id: testsuite-ws + directories: + - testsuite/integration/ws + notify: [ jimma ] + + - id: testsuite-mixed-domain + directories: + - testsuite/mixed-domain + notify: [ yersan ] + + - id: transactions + titleBody: "transactions" + directories: + - transactions + - testsuite/integration/rts + - testsuite/integration/xts + notify: [ mmusgrov ] + + - id: undertow + titleBody: "undertow" + directories: [ undertow ] + notify: [ fl4via ] + + - id: web-common + titleBody: "web-common|web common" + directories: [ web-common ] + notify: [ pferraro, fl4via ] + + - id: webservices + titleBody: "webservices" + directories: [ webservices ] + notify: [ jimma ] + + - id: weld + titleBody: "weld" + directories: [ weld ] + notify: [ manovotn ] + + - id: xts + titleBody: "xts" + directories: [ xts ] + notify: [ mmusgrov ] + + emails: + - mstefank@redhat.com + - pberan@redhat.com + - rbudinsk@redhat.com + - brian.stansberry@redhat.com + + format: + description: + regexes: + - pattern: "https://issues.redhat.com/browse/WFLY-\\d+" + message: "The description must contain a link to the JIRA issue \n(https://issues.redhat.com/browse/WFLY-XYZ)" + diff --git a/.github/workflows/build-manual.yml b/.github/workflows/build-manual.yml new file mode 100644 index 000000000000..7a31d427339c --- /dev/null +++ b/.github/workflows/build-manual.yml @@ -0,0 +1,59 @@ +name: Manual Build and Test + +on: + workflow_dispatch: + inputs: + os: + description: 'OS' + required: false + default: 'ubuntu-latest' + type: choice + options: + - ubuntu-latest + - windows-latest + jdk-distribution: + description: 'JDK Distribution' + required: false + default: 'temurin' + type: choice + options: + - temurin + - semeru + - microsoft + - oracle + - zulu + - corretto + - liberica + jdk-version: + description: 'JDK Version' + required: true + type: string + args: + description: 'Arguments like -Dquickly | -DskipTests | -DallTests' + required: false + default: '-Dquickly' + type: string + timeout: + description: 'Job Timeout Minutes' + required: false + default: 120 + type: number + +jobs: + build: + name: Build and Test + runs-on: ${{ inputs.os }} + timeout-minutes: ${{ fromJSON(inputs.timeout) }} + strategy: + fail-fast: false + + steps: + - uses: actions/checkout@v4 + - name: Set up JDK ${{ inputs.jdk-distribution }} ${{ inputs.jdk-version }} + uses: actions/setup-java@v3 + with: + distribution: ${{ inputs.jdk-distribution }} + java-version: ${{ inputs.jdk-version }} + cache: 'maven' + - name: Build and test with Maven + run: mvn -U -B -ntp clean install ${{ inputs.args }} \ No newline at end of file diff --git a/.github/workflows/build-only.yml b/.github/workflows/build-only.yml index 2f89b1503193..9b420925a8b4 100644 --- a/.github/workflows/build-only.yml +++ b/.github/workflows/build-only.yml @@ -2,24 +2,6 @@ name: WildFly Build on: pull_request: - workflow_dispatch: - inputs: - os: - description: "Runner OS" - required: true - default: "ubuntu-latest" - type: choice - options: - - "ubuntu-latest" - - "windows-latest" - javaVersion: - description: "Java Version" - required: true - default: "11" - type: choice - options: - - "11" - - "17" jobs: build: @@ -32,7 +14,7 @@ jobs: os: [ ubuntu-latest, windows-latest ] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up JDK 11 uses: actions/setup-java@v3 with: @@ -57,7 +39,7 @@ jobs: os: [ ubuntu-latest, windows-latest ] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up JDK 11 uses: actions/setup-java@v3 with: diff --git a/.github/workflows/cloud-test-pr-trigger.yml b/.github/workflows/cloud-test-pr-trigger.yml index 4c395013ee5c..e2a3769e08b7 100644 --- a/.github/workflows/cloud-test-pr-trigger.yml +++ b/.github/workflows/cloud-test-pr-trigger.yml @@ -27,7 +27,7 @@ jobs: - name: Checkout run-status branch if: ${{ env.TOKEN }} - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: ${{ env.REPOSITORY }} ref: ${{ env.STATUS_BRANCH }} diff --git a/.github/workflows/dep-diff-pull_request.yml b/.github/workflows/dep-diff-pull_request.yml index 9b2e7d93e8db..0a4f18e43dac 100644 --- a/.github/workflows/dep-diff-pull_request.yml +++ b/.github/workflows/dep-diff-pull_request.yml @@ -30,7 +30,7 @@ jobs: echo "artifacts=${ARTIFACTS}" >> $GITHUB_OUTPUT - name: Clone base version - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ steps.prepare.outputs.base }} path: base @@ -51,7 +51,7 @@ jobs: ${{ runner.os }}-maven- - name: Clone PR version - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: pr diff --git a/.github/workflows/jdk-jre-build.yml b/.github/workflows/jdk-jre-build.yml new file mode 100644 index 000000000000..ea18966960c6 --- /dev/null +++ b/.github/workflows/jdk-jre-build.yml @@ -0,0 +1,61 @@ +name: WildFly JRE build + +on: + push: + branches: + - main + pull_request: + +jobs: + wildfly-jre-build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + java: ['11', '17', '21-ea'] + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup JRE ${{ matrix.java }} for building + id: setup-java + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: ${{ matrix.java }} + cache: 'maven' + java-package: 'jre' + + - name: Set the JRE Home + id: jre-home + run: | + echo "JRE_HOME=$JAVA_HOME" >> "$GITHUB_OUTPUT" + + - name: Setup JDK ${{ matrix.java }} for building + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '11' + cache: 'maven' + + - name: Build and verify WildFly with JRE ${{ matrix.java }} + run: | + mvn -B clean install -DskipTests -Denforcer.skip=true -Dcheckstyle.skip=true + cd testsuite + echo "Running: mvn -B verify -Dcontainer.java.home=${{ steps.jre-home.outputs.JRE_HOME }} -fae" + mvn -B verify -Dcontainer.java.home=${{ steps.jre-home.outputs.JRE_HOME }} -fae + + - name: Upload Surefire Reports on Failure + uses: actions/upload-artifact@v3 + if: failure() + with: + name: surefire-reports-${{ matrix.java }} + path: '**/surefire-reports/' + + - name: Upload Server Logs on Failure + uses: actions/upload-artifact@v3 + if: failure() + with: + name: server-logs-${{ matrix.java }} + path: '**/server.log' \ No newline at end of file diff --git a/.github/workflows/shared-wildfly-build.yml b/.github/workflows/shared-wildfly-build.yml index 813eed99aeb2..54766fd34e6b 100644 --- a/.github/workflows/shared-wildfly-build.yml +++ b/.github/workflows/shared-wildfly-build.yml @@ -21,7 +21,7 @@ # runs-on: ubuntu-latest # needs: wildfly-build # steps: -# - uses: actions/checkout@v3 +# - uses: actions/checkout@v4 # - uses: actions/download-artifact@v3 # with: # name: wildfly-maven-repository @@ -66,7 +66,7 @@ jobs: wildfly-version: ${{ steps.version.outputs.wildfly-version }} steps: - name: Checkout WildFly - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: ${{ inputs.wildfly-repo }} ref: ${{ inputs.wildfly-branch }} diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 000000000000..6c9b59b3e2c2 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,23 @@ +# Reporting of CVEs and Security Issues + +## The WildFly community and our sponsor, Red Hat, take security bugs very seriously + +We aim to take immediate action to address serious security-related problems that involve our projects. + +Note that we will only fix such issues in the most recent minor release of WildFly. + +## Reporting of Security Issues + +When reporting a security vulnerability it is important to not accidentally broadcast to the world that the issue exists, as this makes it easier for people to exploit it. The software industry uses the term embargo to describe the time a security issue is known internally until it is public knowledge. + +Our preferred way of reporting security issues in WildFly and its related projects is listed below. + +### Email the mailing list + +The list at security@wildfly.org is the preferred mechanism for outside users to report security issues. A member of the WildFly team will open the required issues. + +### Other considerations + +If you would like to work with us on a fix for the security vulnerability, please include your GitHub username in the above email, and we will provide you access to a temporary private fork where we can collaborate on a fix without it being disclosed publicly, **including in your own publicly visible git repository**. + +Do not open a public issue, send a pull request, or disclose any information about the suspected vulnerability publicly, **including in your own publicly visible git repository**. If you discover any publicly disclosed security vulnerabilities, please notify us immediately through security@wildfly.org diff --git a/appclient/pom.xml b/appclient/pom.xml index a788e208973f..f6c67e6bc126 100644 --- a/appclient/pom.xml +++ b/appclient/pom.xml @@ -35,7 +35,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-appclient @@ -45,7 +45,7 @@ - ${project.groupId} + ${ee.maven.groupId} wildfly-standard-ee-bom ${ee.maven.version} pom diff --git a/batch-jberet/pom.xml b/batch-jberet/pom.xml index 5b1e376ebe29..a734b97ce59b 100644 --- a/batch-jberet/pom.xml +++ b/batch-jberet/pom.xml @@ -34,7 +34,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-batch-jberet diff --git a/bean-validation/pom.xml b/bean-validation/pom.xml index c9a20a3901c9..a6170e59a5ea 100644 --- a/bean-validation/pom.xml +++ b/bean-validation/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-bean-validation diff --git a/bean-validation/src/main/java/org/wildfly/extension/beanvalidation/BeanValidationSubsystemSchema.java b/bean-validation/src/main/java/org/wildfly/extension/beanvalidation/BeanValidationSubsystemSchema.java index 84b385a6dfd0..2688450c4b58 100644 --- a/bean-validation/src/main/java/org/wildfly/extension/beanvalidation/BeanValidationSubsystemSchema.java +++ b/bean-validation/src/main/java/org/wildfly/extension/beanvalidation/BeanValidationSubsystemSchema.java @@ -25,9 +25,9 @@ import static org.jboss.as.controller.PersistentResourceXMLDescription.builder; -import org.jboss.as.controller.LegacySubsystemURN; import org.jboss.as.controller.PersistentResourceXMLDescription; import org.jboss.as.controller.PersistentSubsystemSchema; +import org.jboss.as.controller.SubsystemSchema; import org.jboss.as.controller.xml.VersionedNamespace; import org.jboss.staxmapper.IntVersion; @@ -45,7 +45,7 @@ enum BeanValidationSubsystemSchema implements PersistentSubsystemSchema namespace; BeanValidationSubsystemSchema(int major) { - this.namespace = new LegacySubsystemURN<>(BeanValidationExtension.SUBSYSTEM_NAME, new IntVersion(major)); + this.namespace = SubsystemSchema.createLegacySubsystemURN(BeanValidationExtension.SUBSYSTEM_NAME, new IntVersion(major)); } @Override diff --git a/boms/common-ee/pom.xml b/boms/common-ee/pom.xml index f7fa9ed321e1..4d15d739809c 100644 --- a/boms/common-ee/pom.xml +++ b/boms/common-ee/pom.xml @@ -34,7 +34,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT ../../pom.xml @@ -79,6 +79,17 @@ + + ${ee.maven.groupId} + jipijapa-hibernatesearch + ${ee.maven.version} + + + * + * + + + ${ee.maven.groupId} jipijapa-spi @@ -1103,54 +1114,6 @@ - - com.amazonaws - aws-java-sdk-core - ${version.com.amazon.aws} - - - * - * - - - - - - com.amazonaws - aws-java-sdk-kms - ${version.com.amazon.aws} - - - * - * - - - - - - com.amazonaws - aws-java-sdk-s3 - ${version.com.amazon.aws} - - - * - * - - - - - - com.amazonaws - jmespath-java - ${version.com.amazon.aws} - - - * - * - - - - com.carrotsearch hppc @@ -1181,18 +1144,6 @@ ${version.com.fasterxml.jackson.databind} - - com.fasterxml.jackson.dataformat - jackson-dataformat-cbor - ${version.com.fasterxml.jackson} - - - * - * - - - - com.fasterxml.jackson.datatype jackson-datatype-jdk8 @@ -2432,18 +2383,6 @@ - - org.apache.avro - avro - ${version.org.apache.avro} - - - org.apache.commons - commons-compress - - - - org.apache.cxf cxf-core @@ -4951,9 +4890,237 @@ - software.amazon.ion - ion-java - ${version.com.amazon.ion} + software.amazon.awssdk + annotations + ${version.software.amazon.awssdk} + + + * + * + + + + + + software.amazon.awssdk + apache-client + ${version.software.amazon.awssdk} + + + * + * + + + + + + software.amazon.awssdk + arns + ${version.software.amazon.awssdk} + + + * + * + + + + + + software.amazon.awssdk + auth + ${version.software.amazon.awssdk} + + + * + * + + + + + + software.amazon.awssdk + aws-core + ${version.software.amazon.awssdk} + + + * + * + + + + + + software.amazon.awssdk + aws-query-protocol + ${version.software.amazon.awssdk} + + + * + * + + + + + + software.amazon.awssdk + aws-xml-protocol + ${version.software.amazon.awssdk} + + + * + * + + + + + + software.amazon.awssdk + crt-core + ${version.software.amazon.awssdk} + + + * + * + + + + + + software.amazon.awssdk + endpoints-spi + ${version.software.amazon.awssdk} + + + * + * + + + + + + software.amazon.awssdk + http-client-spi + ${version.software.amazon.awssdk} + + + * + * + + + + + + software.amazon.awssdk + json-utils + ${version.software.amazon.awssdk} + + + * + * + + + + + + software.amazon.awssdk + metrics-spi + ${version.software.amazon.awssdk} + + + * + * + + + + + + software.amazon.awssdk + profiles + ${version.software.amazon.awssdk} + + + * + * + + + + + + software.amazon.awssdk + protocol-core + ${version.software.amazon.awssdk} + + + * + * + + + + + + software.amazon.awssdk + regions + ${version.software.amazon.awssdk} + + + * + * + + + + + + software.amazon.awssdk + s3 + ${version.software.amazon.awssdk} + + + * + * + + + + + + software.amazon.awssdk + sdk-core + ${version.software.amazon.awssdk} + + + * + * + + + + + + software.amazon.awssdk + third-party-jackson-core + ${version.software.amazon.awssdk} + + + * + * + + + + + + software.amazon.awssdk + utils + ${version.software.amazon.awssdk} + + + * + * + + + + + + software.amazon.eventstream + eventstream + ${version.software.amazon.eventstream} * diff --git a/boms/common-expansion/pom.xml b/boms/common-expansion/pom.xml index f1c69c71c22a..8d943a3a6941 100644 --- a/boms/common-expansion/pom.xml +++ b/boms/common-expansion/pom.xml @@ -34,7 +34,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT ../../pom.xml diff --git a/boms/legacy-ee/pom.xml b/boms/legacy-ee/pom.xml index a8f1055b6bf8..1cad2b3b01ae 100644 --- a/boms/legacy-ee/pom.xml +++ b/boms/legacy-ee/pom.xml @@ -34,7 +34,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT ../../pom.xml diff --git a/boms/legacy-expansion/pom.xml b/boms/legacy-expansion/pom.xml index 59e8b7e79c8e..b253892c478c 100644 --- a/boms/legacy-expansion/pom.xml +++ b/boms/legacy-expansion/pom.xml @@ -34,7 +34,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT ../../pom.xml diff --git a/boms/legacy-test/pom.xml b/boms/legacy-test/pom.xml index 0b16ae14976f..7fcb2b99591a 100644 --- a/boms/legacy-test/pom.xml +++ b/boms/legacy-test/pom.xml @@ -34,7 +34,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT ../../pom.xml diff --git a/boms/preview-ee/pom.xml b/boms/preview-ee/pom.xml index 9addc25df7aa..ad6e61a59e24 100644 --- a/boms/preview-ee/pom.xml +++ b/boms/preview-ee/pom.xml @@ -34,7 +34,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT ../../pom.xml @@ -63,6 +63,18 @@ + + org.apache.avro + avro + ${version.org.apache.avro} + + + * + * + + + + org.hibernate.search hibernate-search-mapper-orm-coordination-outbox-polling-orm6 diff --git a/boms/preview-expansion/pom.xml b/boms/preview-expansion/pom.xml index 82c627134ef1..1f79f4bdc20b 100644 --- a/boms/preview-expansion/pom.xml +++ b/boms/preview-expansion/pom.xml @@ -34,7 +34,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT ../../pom.xml diff --git a/boms/standard-ee/pom.xml b/boms/standard-ee/pom.xml index cc8169975a3b..c559e6244c6b 100644 --- a/boms/standard-ee/pom.xml +++ b/boms/standard-ee/pom.xml @@ -34,7 +34,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT ../../pom.xml diff --git a/boms/standard-expansion/pom.xml b/boms/standard-expansion/pom.xml index 84b6460d938b..7e7c15793bca 100644 --- a/boms/standard-expansion/pom.xml +++ b/boms/standard-expansion/pom.xml @@ -34,7 +34,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT ../../pom.xml @@ -54,7 +54,7 @@ ${ee.maven.groupId} wildfly-standard-ee-bom - ${full.maven.version} + ${ee.maven.version} pom import diff --git a/boms/standard-test-expansion/pom.xml b/boms/standard-test-expansion/pom.xml new file mode 100644 index 000000000000..5df037a5d67b --- /dev/null +++ b/boms/standard-test-expansion/pom.xml @@ -0,0 +1,170 @@ + + + 4.0.0 + + org.wildfly + wildfly-parent + + 30.0.0.Beta1-SNAPSHOT + ../../pom.xml + + + wildfly-standard-test-expansion-bom + pom + + WildFly: Dependency Management (Expansion Test Dependencies) + + + + + ${ee.maven.groupId} + wildfly-standard-test-bom + ${ee.maven.version} + pom + import + + + + com.github.tomakehurst + wiremock + ${version.com.github.tomakehurst.wiremock} + test + + + + + org.eclipse.jetty + jetty-http + ${version.org.eclipse.jetty} + test + + + org.eclipse.jetty + jetty-io + ${version.org.eclipse.jetty} + test + + + org.eclipse.jetty + jetty-server + ${version.org.eclipse.jetty} + test + + + org.eclipse.jetty + jetty-util + ${version.org.eclipse.jetty} + test + + + org.eclipse.jetty + jetty-servlet + ${version.org.eclipse.jetty} + test + + + org.eclipse.jetty + jetty-servlets + ${version.org.eclipse.jetty} + test + + + org.eclipse.jetty + jetty-webapp + ${version.org.eclipse.jetty} + test + + + org.eclipse.jetty + jetty-proxy + ${version.org.eclipse.jetty} + test + + + + + io.smallrye.reactive + smallrye-reactive-messaging-kafka-test-companion + ${version.io.smallrye.smallrye-reactive-messaging} + test + + + + + org.apache.kafka + kafka_2.13 + ${version.org.apache.kafka} + test + + + + + org.apache.kafka + kafka-server-common + ${version.org.apache.kafka} + test + + + + org.awaitility + awaitility + ${version.org.awaitility.awaitility} + test + + + + org.hamcrest + hamcrest-all + ${version.org.hamcrest.legacy} + test + + + + org.jboss.arquillian.testng + arquillian-testng-container + ${version.org.jboss.arquillian.core} + test + + + + org.jboss.weld.se + weld-se-core + ${version.org.jboss.weld.weld} + test + + + + org.reactivestreams + reactive-streams-tck + ${version.org.reactivestreams} + test + + + + org.testng + testng + ${version.org.testng} + test + + + + + + + + org.apache.maven.plugins + maven-enforcer-plugin + + + + + diff --git a/boms/standard-test/pom.xml b/boms/standard-test/pom.xml index b4c3e01d0556..8f790b65a544 100644 --- a/boms/standard-test/pom.xml +++ b/boms/standard-test/pom.xml @@ -8,7 +8,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT ../../pom.xml @@ -40,12 +40,6 @@ test - - com.github.tomakehurst - wiremock - ${version.com.github.tomakehurst.wiremock} - test - io.rest-assured rest-assured @@ -53,44 +47,6 @@ test - - io.smallrye.reactive - smallrye-reactive-messaging-kafka-test-companion - ${version.io.smallrye.smallrye-reactive-messaging} - - - jaxen - jaxen - ${version.jaxen} - test - - - - jaxen - jaxen - - - jdom - jdom - - - maven-plugins - maven-cobertura-plugin - - - maven-plugins - maven-findbugs-plugin - - - xml-apis - xml-apis - - - xom - xom - - - junit junit @@ -118,27 +74,6 @@ - - - org.apache.kafka - kafka_2.13 - ${version.org.apache.kafka} - test - - - - - org.apache.kafka - kafka-server-common - ${version.org.apache.kafka} - test - org.apache.groovy groovy-all @@ -154,13 +89,6 @@ test - - org.awaitility - awaitility - ${version.org.awaitility.awaitility} - test - - org.codehaus.plexus plexus-utils @@ -180,36 +108,6 @@ - - - org.eclipse.jetty - jetty-http - ${version.org.eclipse.jetty} - test - - - - - org.eclipse.jetty - jetty-io - ${version.org.eclipse.jetty} - test - - - - org.eclipse.jetty - jetty-server - ${version.org.eclipse.jetty} - test - - - - org.eclipse.jetty - jetty-util - ${version.org.eclipse.jetty} - test - - org.hamcrest hamcrest @@ -217,13 +115,6 @@ test - - org.hamcrest - hamcrest-all - ${version.org.hamcrest.legacy} - test - - org.httpunit httpunit @@ -255,12 +146,6 @@ ${version.org.jboss.arquillian.core} test - - org.jboss.arquillian.testng - arquillian-testng-container - ${version.org.jboss.arquillian.core} - test - org.jboss.byteman byteman @@ -354,12 +239,6 @@ test - - org.jboss.weld.se - weld-se-core - ${version.org.jboss.weld.weld} - - org.jsoup jsoup @@ -384,29 +263,7 @@ ${version.org.mockito} test - - org.reactivestreams - reactive-streams-tck - ${version.org.reactivestreams} - test - - - org.springframework.kafka - spring-kafka-test - ${version.org.springframework.kafka} - test - - - - org.apache.kafka - * - - - org.syslog4j syslog4j @@ -427,13 +284,6 @@ test - - org.testng - testng - ${version.org.testng} - test - - org.wildfly.arquillian wildfly-arquillian-common diff --git a/build/pom.xml b/build/pom.xml index 3642c1d4d744..4c61393af360 100644 --- a/build/pom.xml +++ b/build/pom.xml @@ -34,7 +34,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-build diff --git a/client/properties/pom.xml b/client/properties/pom.xml index 4093ebd6e4a9..4b69c10f3764 100644 --- a/client/properties/pom.xml +++ b/client/properties/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT ../../pom.xml diff --git a/client/shade/pom.xml b/client/shade/pom.xml index 239dec3f0ff5..e85b23f5ff4d 100644 --- a/client/shade/pom.xml +++ b/client/shade/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT ../../pom.xml diff --git a/clustering/common/pom.xml b/clustering/common/pom.xml index a348d3944769..08747db8e08b 100644 --- a/clustering/common/pom.xml +++ b/clustering/common/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-common diff --git a/clustering/context/pom.xml b/clustering/context/pom.xml index 7f1729abeb86..a6343c5279eb 100644 --- a/clustering/context/pom.xml +++ b/clustering/context/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-context diff --git a/clustering/ee/cache/pom.xml b/clustering/ee/cache/pom.xml index e1737b7d2957..d7bc0104a840 100644 --- a/clustering/ee/cache/pom.xml +++ b/clustering/ee/cache/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-ee-cache diff --git a/clustering/ee/hotrod/pom.xml b/clustering/ee/hotrod/pom.xml index a9c950250b9e..cbecd825b13a 100644 --- a/clustering/ee/hotrod/pom.xml +++ b/clustering/ee/hotrod/pom.xml @@ -31,7 +31,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-ee-hotrod diff --git a/clustering/ee/infinispan/pom.xml b/clustering/ee/infinispan/pom.xml index 3dfd335d4a28..7ba7ca433e07 100644 --- a/clustering/ee/infinispan/pom.xml +++ b/clustering/ee/infinispan/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-ee-infinispan diff --git a/clustering/ee/infinispan/src/main/java/org/wildfly/clustering/ee/infinispan/PrimaryOwnerLocator.java b/clustering/ee/infinispan/src/main/java/org/wildfly/clustering/ee/infinispan/PrimaryOwnerLocator.java index d324ddf1b015..313b70b910c1 100644 --- a/clustering/ee/infinispan/src/main/java/org/wildfly/clustering/ee/infinispan/PrimaryOwnerLocator.java +++ b/clustering/ee/infinispan/src/main/java/org/wildfly/clustering/ee/infinispan/PrimaryOwnerLocator.java @@ -53,8 +53,13 @@ public Node apply(K key) { Node member = null; while (member == null) { Address address = this.distribution.getPrimaryOwner(key); - // This can return null if member has left the cluster - member = this.memberFactory.createNode(address); + // This has been observed to return null mid-rebalance + if (address != null) { + // This can return null if member has left the cluster + member = this.memberFactory.createNode(address); + } else { + Thread.yield(); + } } return member; } diff --git a/clustering/ee/pom.xml b/clustering/ee/pom.xml index 8893c984f5af..19c4a01a1b60 100644 --- a/clustering/ee/pom.xml +++ b/clustering/ee/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-ee diff --git a/clustering/ee/spi/pom.xml b/clustering/ee/spi/pom.xml index feb9ccca36d6..fa9f6500624d 100644 --- a/clustering/ee/spi/pom.xml +++ b/clustering/ee/spi/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-ee-spi diff --git a/clustering/ejb/cache/pom.xml b/clustering/ejb/cache/pom.xml index b61190c2d23e..7963cef0f9cf 100644 --- a/clustering/ejb/cache/pom.xml +++ b/clustering/ejb/cache/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-ejb-cache diff --git a/clustering/ejb/client/pom.xml b/clustering/ejb/client/pom.xml index bf11415b6fcd..5cd760bcc3df 100644 --- a/clustering/ejb/client/pom.xml +++ b/clustering/ejb/client/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-ejb-client diff --git a/clustering/ejb/extension/pom.xml b/clustering/ejb/extension/pom.xml index 361e78ded41a..2c0f773c91f5 100644 --- a/clustering/ejb/extension/pom.xml +++ b/clustering/ejb/extension/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-ejb-extension diff --git a/clustering/ejb/extension/src/main/java/org/wildfly/extension/clustering/ejb/DistributableEjbSubsystemSchema.java b/clustering/ejb/extension/src/main/java/org/wildfly/extension/clustering/ejb/DistributableEjbSubsystemSchema.java index 76a3c0a66530..a552cd063fea 100644 --- a/clustering/ejb/extension/src/main/java/org/wildfly/extension/clustering/ejb/DistributableEjbSubsystemSchema.java +++ b/clustering/ejb/extension/src/main/java/org/wildfly/extension/clustering/ejb/DistributableEjbSubsystemSchema.java @@ -21,9 +21,9 @@ */ package org.wildfly.extension.clustering.ejb; -import org.jboss.as.controller.LegacySubsystemURN; import org.jboss.as.controller.PersistentResourceXMLDescription; import org.jboss.as.controller.PersistentSubsystemSchema; +import org.jboss.as.controller.SubsystemSchema; import org.jboss.as.controller.xml.VersionedNamespace; import org.jboss.staxmapper.IntVersion; @@ -41,7 +41,7 @@ public enum DistributableEjbSubsystemSchema implements PersistentSubsystemSchema private final VersionedNamespace namespace; DistributableEjbSubsystemSchema(int major, int minor) { - this.namespace = new LegacySubsystemURN<>(DistributableEjbExtension.SUBSYSTEM_NAME, new IntVersion(major, minor)); + this.namespace = SubsystemSchema.createLegacySubsystemURN(DistributableEjbExtension.SUBSYSTEM_NAME, new IntVersion(major, minor)); } @Override diff --git a/clustering/ejb/infinispan/pom.xml b/clustering/ejb/infinispan/pom.xml index 1618d13e12e4..fc47edd452d1 100644 --- a/clustering/ejb/infinispan/pom.xml +++ b/clustering/ejb/infinispan/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-ejb-infinispan diff --git a/clustering/ejb/infinispan/src/main/java/org/wildfly/clustering/ejb/infinispan/timer/InfinispanTimerManager.java b/clustering/ejb/infinispan/src/main/java/org/wildfly/clustering/ejb/infinispan/timer/InfinispanTimerManager.java index ea471a478c6c..2f3df1b3ce43 100644 --- a/clustering/ejb/infinispan/src/main/java/org/wildfly/clustering/ejb/infinispan/timer/InfinispanTimerManager.java +++ b/clustering/ejb/infinispan/src/main/java/org/wildfly/clustering/ejb/infinispan/timer/InfinispanTimerManager.java @@ -186,7 +186,8 @@ public Timer getTimer(I id) { @Override public Stream getActiveTimers() { - return this.scheduler.stream(); + // The primary owner scheduler can miss entries, if called during a concurrent topology change event + return this.group.isSingleton() ? this.scheduledTimers.stream() : this.cache.keySet().stream().filter(TimerCreationMetaDataKeyFilter.INSTANCE).map(Key::getId); } @Override diff --git a/clustering/ejb/infinispan/src/main/java/org/wildfly/clustering/ejb/infinispan/timer/TimerSerializationContextInitializer.java b/clustering/ejb/infinispan/src/main/java/org/wildfly/clustering/ejb/infinispan/timer/TimerSerializationContextInitializer.java index 263db02f94c4..3fccac322b0d 100644 --- a/clustering/ejb/infinispan/src/main/java/org/wildfly/clustering/ejb/infinispan/timer/TimerSerializationContextInitializer.java +++ b/clustering/ejb/infinispan/src/main/java/org/wildfly/clustering/ejb/infinispan/timer/TimerSerializationContextInitializer.java @@ -26,6 +26,7 @@ import org.infinispan.protostream.SerializationContext; import org.wildfly.clustering.marshalling.protostream.AbstractSerializationContextInitializer; +import org.wildfly.clustering.marshalling.protostream.EnumMarshaller; import org.wildfly.clustering.marshalling.protostream.FunctionalMarshaller; /** @@ -40,5 +41,6 @@ public void registerMarshallers(SerializationContext context) { context.registerMarshaller(new IntervalTimerCreationMetaDataMarshaller()); context.registerMarshaller(new ScheduleTimerCreationMetaDataMarshaller()); context.registerMarshaller(new FunctionalMarshaller<>(TimerIndexKey.class, TimerIndexMarshaller.INSTANCE, TimerIndexKey::getId, TimerIndexKey::new)); + context.registerMarshaller(new EnumMarshaller<>(TimerCreationMetaDataKeyFilter.class)); } } diff --git a/clustering/ejb/infinispan/src/main/resources/org.wildfly.clustering.ejb.infinispan.timer.proto b/clustering/ejb/infinispan/src/main/resources/org.wildfly.clustering.ejb.infinispan.timer.proto index 003dcccf7ce1..fac1dabae49e 100644 --- a/clustering/ejb/infinispan/src/main/resources/org.wildfly.clustering.ejb.infinispan.timer.proto +++ b/clustering/ejb/infinispan/src/main/resources/org.wildfly.clustering.ejb.infinispan.timer.proto @@ -59,3 +59,10 @@ message TimerIndexKey { optional string methodName = 3; optional uint32 index = 4; } + +/** + * @TypeId(345) + */ +enum TimerCreationMetaDataKeyFilter { + INSTANCE = 0; +} diff --git a/clustering/ejb/pom.xml b/clustering/ejb/pom.xml index 071a6448418c..fdc47261dddf 100644 --- a/clustering/ejb/pom.xml +++ b/clustering/ejb/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-ejb diff --git a/clustering/ejb/spi/pom.xml b/clustering/ejb/spi/pom.xml index 208dd3d378c2..9ee8b3b15cae 100644 --- a/clustering/ejb/spi/pom.xml +++ b/clustering/ejb/spi/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-ejb-spi diff --git a/clustering/el/expressly/pom.xml b/clustering/el/expressly/pom.xml index 1d442897eeda..f36ec3b52dfb 100644 --- a/clustering/el/expressly/pom.xml +++ b/clustering/el/expressly/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-el-expressly diff --git a/clustering/el/pom.xml b/clustering/el/pom.xml index 6054fbcab0d8..ddd001b7bb9c 100644 --- a/clustering/el/pom.xml +++ b/clustering/el/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-el diff --git a/clustering/faces/api/pom.xml b/clustering/faces/api/pom.xml index 8b3f6f860222..b151c03d7cf9 100644 --- a/clustering/faces/api/pom.xml +++ b/clustering/faces/api/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-faces-api diff --git a/clustering/faces/mojarra/pom.xml b/clustering/faces/mojarra/pom.xml index 505c3b8d07c8..b8bcbf34e928 100644 --- a/clustering/faces/mojarra/pom.xml +++ b/clustering/faces/mojarra/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-faces-mojarra diff --git a/clustering/faces/pom.xml b/clustering/faces/pom.xml index 860daf7b2f9e..87bdded639c4 100644 --- a/clustering/faces/pom.xml +++ b/clustering/faces/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-faces diff --git a/clustering/infinispan/client/api/pom.xml b/clustering/infinispan/client/api/pom.xml index 24d38079a630..22ba58e44400 100644 --- a/clustering/infinispan/client/api/pom.xml +++ b/clustering/infinispan/client/api/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-infinispan-client-api diff --git a/clustering/infinispan/client/pom.xml b/clustering/infinispan/client/pom.xml index e6ebe8a73f61..daaaa8449e6b 100644 --- a/clustering/infinispan/client/pom.xml +++ b/clustering/infinispan/client/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-infinispan-client diff --git a/clustering/infinispan/client/service/pom.xml b/clustering/infinispan/client/service/pom.xml index 2c89c26d3db7..f0b472127c11 100644 --- a/clustering/infinispan/client/service/pom.xml +++ b/clustering/infinispan/client/service/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-infinispan-client-service diff --git a/clustering/infinispan/client/spi/pom.xml b/clustering/infinispan/client/spi/pom.xml index d06d58641315..c13255975a62 100644 --- a/clustering/infinispan/client/spi/pom.xml +++ b/clustering/infinispan/client/spi/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-infinispan-client-spi diff --git a/clustering/infinispan/client/spi/src/main/java/org/wildfly/clustering/infinispan/client/near/CaffeineNearCache.java b/clustering/infinispan/client/spi/src/main/java/org/wildfly/clustering/infinispan/client/near/CaffeineNearCache.java index dd77b5200c32..e62e5e8d4424 100644 --- a/clustering/infinispan/client/spi/src/main/java/org/wildfly/clustering/infinispan/client/near/CaffeineNearCache.java +++ b/clustering/infinispan/client/spi/src/main/java/org/wildfly/clustering/infinispan/client/near/CaffeineNearCache.java @@ -43,18 +43,23 @@ public CaffeineNearCache(Cache> cache) { } @Override - public void put(K key, MetadataValue value) { - this.map.put(key, value); + public boolean putIfAbsent(K key, MetadataValue value) { + return this.map.putIfAbsent(key, value) == null; } @Override - public void putIfAbsent(K key, MetadataValue value) { - this.map.putIfAbsent(key, value); + public boolean remove(K key) { + return this.map.remove(key) != null; } @Override - public boolean remove(K key) { - return this.map.remove(key) != null; + public boolean remove(K key, MetadataValue value) { + return this.map.remove(key, value); + } + + @Override + public boolean replace(K key, MetadataValue prevValue, MetadataValue newValue) { + return this.map.replace(key, prevValue, newValue); } @Override diff --git a/clustering/infinispan/embedded/api/pom.xml b/clustering/infinispan/embedded/api/pom.xml index ac3e528ff1f9..986bb9a0f58c 100644 --- a/clustering/infinispan/embedded/api/pom.xml +++ b/clustering/infinispan/embedded/api/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-infinispan-embedded-api diff --git a/clustering/infinispan/embedded/pom.xml b/clustering/infinispan/embedded/pom.xml index a5070035ec87..f8dea07ac8ec 100644 --- a/clustering/infinispan/embedded/pom.xml +++ b/clustering/infinispan/embedded/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-infinispan-embedded diff --git a/clustering/infinispan/embedded/service/pom.xml b/clustering/infinispan/embedded/service/pom.xml index f89cdc958bed..56d8b3683c71 100644 --- a/clustering/infinispan/embedded/service/pom.xml +++ b/clustering/infinispan/embedded/service/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-infinispan-embedded-service diff --git a/clustering/infinispan/embedded/spi/pom.xml b/clustering/infinispan/embedded/spi/pom.xml index 4d44cde92561..c73a8f7fe8df 100644 --- a/clustering/infinispan/embedded/spi/pom.xml +++ b/clustering/infinispan/embedded/spi/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-infinispan-embedded-spi diff --git a/clustering/infinispan/embedded/spi/src/main/java/org/wildfly/clustering/infinispan/affinity/impl/DefaultKeyAffinityService.java b/clustering/infinispan/embedded/spi/src/main/java/org/wildfly/clustering/infinispan/affinity/impl/DefaultKeyAffinityService.java index 54e8cde2a809..8f8b92e79039 100644 --- a/clustering/infinispan/embedded/spi/src/main/java/org/wildfly/clustering/infinispan/affinity/impl/DefaultKeyAffinityService.java +++ b/clustering/infinispan/embedded/spi/src/main/java/org/wildfly/clustering/infinispan/affinity/impl/DefaultKeyAffinityService.java @@ -73,6 +73,7 @@ @Listener(observation = Observation.POST) public class DefaultKeyAffinityService implements KeyAffinityService, Supplier> { + static final int DEFAULT_QUEUE_SIZE = 100; private static final Logger LOGGER = Logger.getLogger(DefaultKeyAffinityService.class); private final Cache cache; @@ -81,7 +82,7 @@ public class DefaultKeyAffinityService implements KeyAffinityService, Supp private final KeyPartitioner partitioner; private final Predicate
filter; - private volatile int queueSize = 100; + private volatile int queueSize = DEFAULT_QUEUE_SIZE; private volatile Duration timeout = Duration.ofMillis(100L); private volatile ExecutorService executor; diff --git a/clustering/infinispan/embedded/spi/src/main/java/org/wildfly/clustering/infinispan/container/DataContainerConfiguration.java b/clustering/infinispan/embedded/spi/src/main/java/org/wildfly/clustering/infinispan/container/DataContainerConfiguration.java index a19423d896fa..587121d3960e 100644 --- a/clustering/infinispan/embedded/spi/src/main/java/org/wildfly/clustering/infinispan/container/DataContainerConfiguration.java +++ b/clustering/infinispan/embedded/spi/src/main/java/org/wildfly/clustering/infinispan/container/DataContainerConfiguration.java @@ -49,13 +49,19 @@ public boolean test(Object key) { .immutable() .build(); + private final AttributeSet attributes; @SuppressWarnings("rawtypes") private final Attribute evictable; DataContainerConfiguration(AttributeSet attributes) { + this.attributes = attributes; this.evictable = attributes.attribute(EVICTABLE_PREDICATE); } + public AttributeSet attributes() { + return this.attributes; + } + public Predicate evictable() { return this.evictable.get(); } diff --git a/clustering/infinispan/embedded/spi/src/main/java/org/wildfly/clustering/infinispan/container/DataContainerConfigurationBuilder.java b/clustering/infinispan/embedded/spi/src/main/java/org/wildfly/clustering/infinispan/container/DataContainerConfigurationBuilder.java index 673432e67acd..eae145d31c93 100644 --- a/clustering/infinispan/embedded/spi/src/main/java/org/wildfly/clustering/infinispan/container/DataContainerConfigurationBuilder.java +++ b/clustering/infinispan/embedded/spi/src/main/java/org/wildfly/clustering/infinispan/container/DataContainerConfigurationBuilder.java @@ -27,6 +27,7 @@ import java.util.function.Predicate; import org.infinispan.commons.configuration.Builder; +import org.infinispan.commons.configuration.Combine; import org.infinispan.commons.configuration.attributes.AttributeSet; import org.infinispan.configuration.cache.ConfigurationBuilder; @@ -56,8 +57,9 @@ public DataContainerConfiguration create() { } @Override - public DataContainerConfigurationBuilder read(DataContainerConfiguration template) { - return this.evictable(template.evictable()); + public DataContainerConfigurationBuilder read(DataContainerConfiguration template, Combine combine) { + this.attributes.read(template.attributes(), combine); + return this; } @Override diff --git a/clustering/infinispan/embedded/spi/src/test/java/org/wildfly/clustering/infinispan/affinity/impl/DefaultKeyAffinityServiceTestCase.java b/clustering/infinispan/embedded/spi/src/test/java/org/wildfly/clustering/infinispan/affinity/impl/DefaultKeyAffinityServiceTestCase.java index 80b32d1f5f38..a5b2938fa7aa 100644 --- a/clustering/infinispan/embedded/spi/src/test/java/org/wildfly/clustering/infinispan/affinity/impl/DefaultKeyAffinityServiceTestCase.java +++ b/clustering/infinispan/embedded/spi/src/test/java/org/wildfly/clustering/infinispan/affinity/impl/DefaultKeyAffinityServiceTestCase.java @@ -30,6 +30,8 @@ import java.util.Collections; import java.util.List; import java.util.UUID; +import java.util.function.IntPredicate; +import java.util.stream.IntStream; import org.infinispan.AdvancedCache; import org.infinispan.affinity.KeyAffinityService; @@ -107,10 +109,15 @@ public void test() { when(dist.getCacheTopology()).thenReturn(localizedTopology); // Mock a sufficient number of keys + int[] keysPerSegment = new int[3]; + Arrays.fill(keysPerSegment, 0); + int minKeysPerSegment = DefaultKeyAffinityService.DEFAULT_QUEUE_SIZE * SEGMENTS; + IntPredicate needMoreKeys = keys -> (keys < minKeysPerSegment); OngoingStubbing stub = when(generator.getKey()); - for (int i = 0; i < 1000; ++i) { + while (IntStream.of(keysPerSegment).anyMatch(needMoreKeys)) { UUID key = UUID.randomUUID(); int segment = getSegment(key); + keysPerSegment[segment] += 1; stub = stub.thenReturn(key); @@ -126,7 +133,8 @@ public void test() { service.start(); try { - for (int i = 0; i < 50; ++i) { + int iterations = DefaultKeyAffinityService.DEFAULT_QUEUE_SIZE / 2; + for (int i = 0; i < iterations; ++i) { UUID key = service.getKeyForAddress(local); int segment = getSegment(key); assertEquals(LOCAL_SEGMENT, segment); diff --git a/clustering/infinispan/extension/pom.xml b/clustering/infinispan/extension/pom.xml index f7ddc357cdb7..7ab0e4fa2411 100644 --- a/clustering/infinispan/extension/pom.xml +++ b/clustering/infinispan/extension/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-infinispan-extension diff --git a/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/persistence/hotrod/HotRodStore.java b/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/persistence/hotrod/HotRodStore.java index a395bb9f2f1c..d10382355824 100644 --- a/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/persistence/hotrod/HotRodStore.java +++ b/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/persistence/hotrod/HotRodStore.java @@ -30,15 +30,18 @@ import java.util.PrimitiveIterator; import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionStage; +import java.util.concurrent.Executor; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicReferenceArray; import java.util.function.Consumer; +import java.util.function.Function; import java.util.function.Predicate; import java.util.stream.IntStream; import java.util.stream.Stream; import io.reactivex.rxjava3.core.Completable; import io.reactivex.rxjava3.core.Flowable; +import io.reactivex.rxjava3.schedulers.Schedulers; import org.infinispan.Cache; import org.infinispan.client.hotrod.DefaultTemplate; @@ -80,6 +83,7 @@ public class HotRodStore implements NonBlockingStore { private volatile RemoteCacheContainer container; private volatile AtomicReferenceArray> caches; private volatile BlockingManager blockingManager; + private volatile Executor executor; private volatile PersistenceMarshaller marshaller; private volatile MarshallableEntryFactory entryFactory; private volatile int batchSize; @@ -97,6 +101,7 @@ public CompletionStage start(InitializationContext context) { this.container = configuration.remoteCacheContainer(); this.cacheName = cache.getName(); this.blockingManager = context.getBlockingManager(); + this.executor = context.getNonBlockingExecutor(); this.batchSize = configuration.maxBatchSize(); this.marshaller = context.getPersistenceMarshaller(); this.entryFactory = context.getMarshallableEntryFactory(); @@ -161,7 +166,8 @@ public CompletionStage> load(int segment, Object key) { RemoteCache cache = this.segmentCache(segment); if (cache == null) return CompletableFuture.completedStage(null); try { - return cache.getAsync(this.marshalKey(key)).thenApply(value -> (value != null) ? this.entryFactory.create(key, this.unmarshalValue(value)) : null); + return cache.getAsync(this.marshalKey(key)) + .thenApplyAsync(value -> (value != null) ? this.entryFactory.create(key, this.unmarshalValue(value)) : null, this.executor); } catch (PersistenceException e) { return CompletableFuture.failedStage(e); } @@ -173,7 +179,8 @@ public CompletionStage write(int segment, MarshallableEntry delete(int segment, Object key) { RemoteCache cache = this.segmentCache(segment); if (cache == null) return CompletableFuture.completedStage(null); try { - return cache.withFlags(Flag.FORCE_RETURN_VALUE).removeAsync(this.marshalKey(key)).thenApply(Objects::nonNull); + return cache.withFlags(Flag.FORCE_RETURN_VALUE).removeAsync(this.marshalKey(key)) + .thenApplyAsync(Objects::nonNull, this.executor); } catch (PersistenceException e) { return CompletableFuture.failedStage(e); } @@ -198,7 +206,9 @@ public CompletionStage batch(int publisherCount, Publisher Flowable.fromPublisher(sp).map(entry -> Map.entry(entry, sp.getSegment())), publisherCount) .flatMapCompletable(this::write, false, this.batchSize); - return removeCompletable.mergeWith(writeCompletable).toCompletionStage(null); + return removeCompletable.mergeWith(writeCompletable) + .observeOn(Schedulers.from(this.executor)) + .toCompletionStage(null); } private Completable write(Map.Entry, Integer> entry) { @@ -222,7 +232,7 @@ public Flowable publishKeys(IntSet segments, Predicate filter) { } } Stream filteredKeys = (filter != null) ? keys.filter(filter) : keys; - return Flowable.fromPublisher(this.blockingManager.blockingPublisher(Flowable.defer(() -> Flowable.fromStream(filteredKeys).doFinally(filteredKeys::close)))); + return Flowable.fromStream(filteredKeys).observeOn(Schedulers.from(this.executor)).doFinally(filteredKeys::close); } catch (PersistenceException e) { return Flowable.fromCompletionStage(CompletableFuture.failedStage(e)); } @@ -245,7 +255,7 @@ private Flowable> publishEntries(IntSet segments, Predic } } Stream> filteredEntries = (filter != null) ? entries.filter(entry -> filter.test(entry.getKey())) : entries; - return Flowable.fromPublisher(this.blockingManager.blockingPublisher(Flowable.defer(() -> Flowable.fromStream(filteredEntries).doFinally(filteredEntries::close)))); + return Flowable.fromStream(filteredEntries).observeOn(Schedulers.from(this.executor)).doFinally(filteredEntries::close); } catch (PersistenceException e) { return Flowable.fromCompletionStage(CompletableFuture.failedStage(e)); } @@ -257,7 +267,7 @@ public CompletionStage clear() { for (int i = 0; i < this.caches.length(); ++i) { RemoteCache cache = this.caches.get(i); if (cache != null) { - result = CompletableFuture.allOf(result, cache.clearAsync()); + result = CompletableFuture.allOf(result, cache.clearAsync().thenApplyAsync(Function.identity(), this.executor)); } } return result; @@ -268,7 +278,7 @@ public CompletionStage containsKey(int segment, Object key) { RemoteCache cache = this.segmentCache(segment); if (cache == null) return CompletableFuture.completedStage(false); try { - return cache.containsKeyAsync(this.marshalKey(key)); + return cache.containsKeyAsync(this.marshalKey(key)).thenApplyAsync(Function.identity(), this.executor); } catch (PersistenceException e) { return CompletableFuture.failedStage(e); } @@ -276,7 +286,7 @@ public CompletionStage containsKey(int segment, Object key) { @Override public CompletionStage isAvailable() { - return this.container.isAvailable(); + return this.container.isAvailable().thenApplyAsync(Function.identity(), this.executor); } @Override @@ -286,7 +296,7 @@ public CompletionStage size(IntSet segments) { while (iterator.hasNext()) { int segment = iterator.nextInt(); RemoteCache cache = this.caches.get(segment); - result = result.thenCombine(cache.sizeAsync(), Long::sum); + result = result.thenCombineAsync(cache.sizeAsync(), Long::sum, this.executor); } return result; } @@ -324,7 +334,7 @@ public CompletionStage removeSegments(IntSet segments) { RemoteCache cache = this.caches.get(segment); if (cache != null) { this.caches.set(segment, null); - result = CompletableFuture.allOf(result, cache.clearAsync().thenRun(cache::stop).toCompletableFuture()); + result = CompletableFuture.allOf(result, this.blockingManager.thenRunBlocking(cache.clearAsync().thenAcceptAsync(Functions.discardingConsumer(), this.executor), cache::stop, "hotrod-store-remove-segments").toCompletableFuture()); } } return result; diff --git a/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/persistence/jdbc/DataSourceConnectionFactoryConfigurationBuilder.java b/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/persistence/jdbc/DataSourceConnectionFactoryConfigurationBuilder.java index 86e9560d5e77..879df1cdeaa0 100644 --- a/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/persistence/jdbc/DataSourceConnectionFactoryConfigurationBuilder.java +++ b/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/persistence/jdbc/DataSourceConnectionFactoryConfigurationBuilder.java @@ -26,6 +26,7 @@ import javax.sql.DataSource; +import org.infinispan.commons.configuration.Combine; import org.infinispan.commons.configuration.attributes.AttributeSet; import org.infinispan.configuration.global.GlobalConfiguration; import org.infinispan.persistence.jdbc.common.configuration.AbstractJdbcStoreConfigurationBuilder; @@ -66,7 +67,7 @@ public DataSourceConnectionFactoryConfiguration create() { } @Override - public DataSourceConnectionFactoryConfigurationBuilder read(DataSourceConnectionFactoryConfiguration template) { + public DataSourceConnectionFactoryConfigurationBuilder read(DataSourceConnectionFactoryConfiguration template, Combine combine) { this.dependency = new SimpleSupplierDependency<>(template.getDataSource()); return this; } diff --git a/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/subsystem/CacheContainerResourceDefinition.java b/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/subsystem/CacheContainerResourceDefinition.java index e4ff88fb3786..347316b60997 100644 --- a/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/subsystem/CacheContainerResourceDefinition.java +++ b/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/subsystem/CacheContainerResourceDefinition.java @@ -24,8 +24,10 @@ import java.util.EnumMap; import java.util.EnumSet; import java.util.Map; +import java.util.Set; import java.util.function.UnaryOperator; import java.util.stream.Collectors; +import java.util.stream.Stream; import org.infinispan.Cache; import org.infinispan.manager.EmbeddedCacheManager; @@ -34,6 +36,7 @@ import org.jboss.as.clustering.controller.ChildResourceDefinition; import org.jboss.as.clustering.controller.ManagementResourceRegistration; import org.jboss.as.clustering.controller.MetricHandler; +import org.jboss.as.clustering.controller.ResourceDefinitionProvider; import org.jboss.as.clustering.controller.ResourceDescriptor; import org.jboss.as.clustering.controller.ResourceServiceHandler; import org.jboss.as.clustering.controller.ServiceValueExecutorRegistry; @@ -178,6 +181,9 @@ public StringListAttributeDefinition.Builder apply(StringListAttributeDefinition } } + static final Set REQUIRED_CHILDREN = Stream.concat(EnumSet.complementOf(EnumSet.of(ThreadPoolResourceDefinition.CLIENT)).stream(), EnumSet.allOf(ScheduledThreadPoolResourceDefinition.class).stream()).map(ResourceDefinitionProvider::getPathElement).collect(Collectors.toSet()); + static final Set REQUIRED_SINGLETON_CHILDREN = Set.of(NoTransportResourceDefinition.PATH); + CacheContainerResourceDefinition() { super(WILDCARD_PATH, InfinispanExtension.SUBSYSTEM_RESOLVER.createChildResolver(WILDCARD_PATH)); } @@ -194,9 +200,8 @@ public ManagementResourceRegistration register(ManagementResourceRegistration pa .addCapabilities(model -> model.hasDefined(Attribute.DEFAULT_CACHE.getName()), DEFAULT_CAPABILITIES.values()) .addCapabilities(model -> model.hasDefined(Attribute.DEFAULT_CACHE.getName()), EnumSet.allOf(ClusteringDefaultCacheRequirement.class).stream().map(UnaryRequirementCapability::new).collect(Collectors.toList())) .addCapabilities(model -> model.hasDefined(Attribute.DEFAULT_CACHE.getName()), EnumSet.allOf(SingletonDefaultCacheRequirement.class).stream().map(UnaryRequirementCapability::new).collect(Collectors.toList())) - .addRequiredChildren(EnumSet.complementOf(EnumSet.of(ThreadPoolResourceDefinition.CLIENT))) - .addRequiredChildren(ScheduledThreadPoolResourceDefinition.class) - .addRequiredSingletonChildren(NoTransportResourceDefinition.PATH) + .addRequiredChildren(REQUIRED_CHILDREN) + .addRequiredSingletonChildren(REQUIRED_SINGLETON_CHILDREN) .setResourceTransformation(CacheContainerResource::new) ; ServiceValueExecutorRegistry managerExecutors = new ServiceValueExecutorRegistry<>(); diff --git a/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/subsystem/CacheResourceDefinition.java b/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/subsystem/CacheResourceDefinition.java index d30f7af42653..40d3994d0118 100644 --- a/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/subsystem/CacheResourceDefinition.java +++ b/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/subsystem/CacheResourceDefinition.java @@ -23,6 +23,7 @@ package org.jboss.as.clustering.infinispan.subsystem; import java.util.EnumSet; +import java.util.Set; import java.util.function.UnaryOperator; import java.util.stream.Collectors; @@ -131,6 +132,9 @@ static SimpleAttributeDefinitionBuilder createBuilder(String name, ModelType typ ; } + static final Set REQUIRED_CHILDREN = Set.of(ExpirationResourceDefinition.PATH, LockingResourceDefinition.PATH, TransactionResourceDefinition.PATH); + static final Set REQUIRED_SINGLETON_CHILDREN = Set.of(HeapMemoryResourceDefinition.PATH, NoStoreResourceDefinition.PATH); + private final UnaryOperator configurator; private final ResourceServiceHandler handler; @@ -151,8 +155,8 @@ public ManagementResourceRegistration register(ManagementResourceRegistration pa .addCapabilities(Capability.class) .addCapabilities(EnumSet.allOf(ClusteringCacheRequirement.class).stream().map(BinaryRequirementCapability::new).collect(Collectors.toList())) .addCapabilities(EnumSet.allOf(SingletonCacheRequirement.class).stream().map(BinaryRequirementCapability::new).collect(Collectors.toList())) - .addRequiredChildren(ExpirationResourceDefinition.PATH, LockingResourceDefinition.PATH, TransactionResourceDefinition.PATH) - .addRequiredSingletonChildren(HeapMemoryResourceDefinition.PATH, NoStoreResourceDefinition.PATH) + .addRequiredChildren(REQUIRED_CHILDREN) + .addRequiredSingletonChildren(REQUIRED_SINGLETON_CHILDREN) ; new SimpleResourceRegistrar(descriptor, this.handler).register(registration); diff --git a/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/subsystem/ClusteredCacheResourceDefinition.java b/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/subsystem/ClusteredCacheResourceDefinition.java index 5b41e45a2d58..3f5a0b813963 100644 --- a/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/subsystem/ClusteredCacheResourceDefinition.java +++ b/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/subsystem/ClusteredCacheResourceDefinition.java @@ -64,7 +64,7 @@ public RuntimeCapability getDefinition() { } enum Attribute implements org.jboss.as.clustering.controller.Attribute, UnaryOperator { - REMOTE_TIMEOUT("remote-timeout", ModelType.LONG, new ModelNode(TimeUnit.SECONDS.toMillis(10))) { + REMOTE_TIMEOUT("remote-timeout", ModelType.LONG, new ModelNode(TimeUnit.MILLISECONDS.toMillis(17500))) { @Override public SimpleAttributeDefinitionBuilder apply(SimpleAttributeDefinitionBuilder builder) { return builder.setMeasurementUnit(MeasurementUnit.MILLISECONDS); diff --git a/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/subsystem/ClusteredCacheResourceTransformer.java b/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/subsystem/ClusteredCacheResourceTransformer.java index da5dbd5540de..6c0e94cb9ab4 100644 --- a/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/subsystem/ClusteredCacheResourceTransformer.java +++ b/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/subsystem/ClusteredCacheResourceTransformer.java @@ -22,6 +22,8 @@ package org.jboss.as.clustering.infinispan.subsystem; +import org.jboss.as.controller.ModelVersion; +import org.jboss.as.controller.transform.description.AttributeConverter; import org.jboss.as.controller.transform.description.ResourceTransformationDescriptionBuilder; /** @@ -32,4 +34,14 @@ public class ClusteredCacheResourceTransformer extends CacheResourceTransformer ClusteredCacheResourceTransformer(ResourceTransformationDescriptionBuilder builder) { super(builder); } + + @Override + public void accept(ModelVersion version) { + if (InfinispanSubsystemModel.VERSION_17_1_0.requiresTransformation(version)) { + this.builder.getAttributeBuilder() + .setValueConverter(AttributeConverter.DEFAULT_VALUE, ClusteredCacheResourceDefinition.Attribute.REMOTE_TIMEOUT.getDefinition()) + .end(); + } + super.accept(version); + } } diff --git a/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/subsystem/CustomStoreServiceConfigurator.java b/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/subsystem/CustomStoreServiceConfigurator.java index 33d87c19420f..2b9f75f1d184 100644 --- a/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/subsystem/CustomStoreServiceConfigurator.java +++ b/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/subsystem/CustomStoreServiceConfigurator.java @@ -27,6 +27,7 @@ import java.util.List; import java.util.stream.Collectors; +import org.infinispan.commons.configuration.Combine; import org.infinispan.commons.util.AggregatedClassLoader; import org.infinispan.configuration.cache.ConfigurationBuilder; import org.infinispan.configuration.cache.PersistenceConfiguration; @@ -78,8 +79,7 @@ public PersistenceConfiguration get() { @SuppressWarnings("unchecked") Class> storeClass = (Class>) loader.loadClass(this.className).asSubclass(StoreConfigurationBuilder.class); return new ConfigurationBuilder().persistence().passivation(persistence.passivation()).addStore(storeClass) - .async().read(store.async()) - .fetchPersistentState(store.fetchPersistentState()) + .async().read(store.async(), Combine.DEFAULT) .preload(store.preload()) .purgeOnStartup(store.purgeOnStartup()) .shared(store.shared()) diff --git a/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/subsystem/InfinispanSubsystemModel.java b/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/subsystem/InfinispanSubsystemModel.java index b8287d424d11..4d5109eb3f69 100644 --- a/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/subsystem/InfinispanSubsystemModel.java +++ b/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/subsystem/InfinispanSubsystemModel.java @@ -51,9 +51,11 @@ public enum InfinispanSubsystemModel implements SubsystemModel { VERSION_14_0_0(14, 0, 0), // WildFly 23, EAP 7.4 VERSION_15_0_0(15, 0, 0), // WildFly 24-26 VERSION_16_0_0(16, 0, 0), // WildFly 27 - VERSION_17_0_0(17, 0, 0), // WildFly 28-present + VERSION_17_0_0(17, 0, 0), // WildFly 28-29 + VERSION_17_1_0(17, 1, 0), // EAP 8.0 + VERSION_18_0_0(18, 0, 0), // WildFly 30-present ; - static final InfinispanSubsystemModel CURRENT = VERSION_17_0_0; + static final InfinispanSubsystemModel CURRENT = VERSION_18_0_0; private final ModelVersion version; diff --git a/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/subsystem/InfinispanSubsystemSchema.java b/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/subsystem/InfinispanSubsystemSchema.java index 49ba5a4fa2ce..7870439e3335 100644 --- a/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/subsystem/InfinispanSubsystemSchema.java +++ b/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/subsystem/InfinispanSubsystemSchema.java @@ -25,7 +25,6 @@ import javax.xml.stream.XMLStreamException; -import org.jboss.as.controller.LegacySubsystemURN; import org.jboss.as.controller.SubsystemSchema; import org.jboss.as.controller.xml.VersionedNamespace; import org.jboss.dmr.ModelNode; @@ -65,7 +64,7 @@ public enum InfinispanSubsystemSchema implements SubsystemSchema namespace; InfinispanSubsystemSchema(int major, int minor) { - this.namespace = new LegacySubsystemURN<>(InfinispanExtension.SUBSYSTEM_NAME, new IntVersion(major, minor)); + this.namespace = SubsystemSchema.createLegacySubsystemURN(InfinispanExtension.SUBSYSTEM_NAME, new IntVersion(major, minor)); } @Override diff --git a/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/subsystem/InfinispanSubsystemXMLReader.java b/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/subsystem/InfinispanSubsystemXMLReader.java index 38a41cd4fd1b..6ad0974b8665 100644 --- a/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/subsystem/InfinispanSubsystemXMLReader.java +++ b/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/subsystem/InfinispanSubsystemXMLReader.java @@ -179,6 +179,9 @@ private void parseContainer(XMLExtendedStreamReader reader, PathAddress subsyste } } + addRequiredChildOperations(address, CacheContainerResourceDefinition.REQUIRED_CHILDREN, operations); + addRequiredSingletonChildOperations(address, CacheContainerResourceDefinition.REQUIRED_SINGLETON_CHILDREN, operations); + while (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT)) { XMLElement element = XMLElement.forName(reader.getLocalName()); switch (element) { @@ -330,6 +333,9 @@ private void parseLocalCache(XMLExtendedStreamReader reader, PathAddress contain this.parseCacheAttribute(reader, i, address, operations); } + addRequiredChildOperations(address, CacheResourceDefinition.REQUIRED_CHILDREN, operations); + addRequiredSingletonChildOperations(address, CacheResourceDefinition.REQUIRED_SINGLETON_CHILDREN, operations); + while (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT)) { this.parseCacheElement(reader, address, operations); } @@ -346,12 +352,15 @@ private void parseReplicatedCache(XMLExtendedStreamReader reader, PathAddress co this.parseClusteredCacheAttribute(reader, i, address, operations); } + addRequiredChildOperations(address, CacheResourceDefinition.REQUIRED_CHILDREN, operations); + addRequiredChildOperations(address, SharedStateCacheResourceDefinition.REQUIRED_CHILDREN, operations); + addRequiredSingletonChildOperations(address, CacheResourceDefinition.REQUIRED_SINGLETON_CHILDREN, operations); + while (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT)) { this.parseSharedStateCacheElement(reader, address, operations); } } - @SuppressWarnings("deprecation") private void parseScatteredCache(XMLExtendedStreamReader reader, PathAddress containerAddress, Map operations) throws XMLStreamException { String name = require(reader, XMLAttribute.NAME); @@ -376,6 +385,10 @@ private void parseScatteredCache(XMLExtendedStreamReader reader, PathAddress con } } + addRequiredChildOperations(address, CacheResourceDefinition.REQUIRED_CHILDREN, operations); + addRequiredChildOperations(address, SharedStateCacheResourceDefinition.REQUIRED_CHILDREN, operations); + addRequiredSingletonChildOperations(address, CacheResourceDefinition.REQUIRED_SINGLETON_CHILDREN, operations); + while (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT)) { this.parseSharedStateCacheElement(reader, address, operations); } @@ -411,6 +424,10 @@ private void parseDistributedCache(XMLExtendedStreamReader reader, PathAddress c } } + addRequiredChildOperations(address, CacheResourceDefinition.REQUIRED_CHILDREN, operations); + addRequiredChildOperations(address, SharedStateCacheResourceDefinition.REQUIRED_CHILDREN, operations); + addRequiredSingletonChildOperations(address, CacheResourceDefinition.REQUIRED_SINGLETON_CHILDREN, operations); + while (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT)) { this.parseSharedStateCacheElement(reader, address, operations); } @@ -427,6 +444,9 @@ private void parseInvalidationCache(XMLExtendedStreamReader reader, PathAddress this.parseClusteredCacheAttribute(reader, i, address, operations); } + addRequiredChildOperations(address, CacheResourceDefinition.REQUIRED_CHILDREN, operations); + addRequiredSingletonChildOperations(address, CacheResourceDefinition.REQUIRED_SINGLETON_CHILDREN, operations); + while (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT)) { this.parseCacheElement(reader, address, operations); } @@ -692,12 +712,10 @@ private void parseSharedStateCacheElement(XMLExtendedStreamReader reader, PathAd } } - @SuppressWarnings("deprecation") private void parsePartitionHandling(XMLExtendedStreamReader reader, PathAddress cacheAddress, Map operations) throws XMLStreamException { PathAddress address = cacheAddress.append(PartitionHandlingResourceDefinition.PATH); - ModelNode operation = Util.createAddOperation(address); - operations.put(address, operation); + ModelNode operation = operations.get(address); for (int i = 0; i < reader.getAttributeCount(); i++) { XMLAttribute attribute = XMLAttribute.forName(reader.getAttributeLocalName(i)); @@ -732,8 +750,7 @@ private void parsePartitionHandling(XMLExtendedStreamReader reader, PathAddress private void parseStateTransfer(XMLExtendedStreamReader reader, PathAddress cacheAddress, Map operations) throws XMLStreamException { PathAddress address = cacheAddress.append(StateTransferResourceDefinition.PATH); - ModelNode operation = Util.createAddOperation(address); - operations.put(address, operation); + ModelNode operation = operations.get(address); for (int i = 0; i < reader.getAttributeCount(); i++) { XMLAttribute attribute = XMLAttribute.forName(reader.getAttributeLocalName(i)); @@ -764,8 +781,6 @@ private void parseStateTransfer(XMLExtendedStreamReader reader, PathAddress cach private void parseBackups(XMLExtendedStreamReader reader, PathAddress cacheAddress, Map operations) throws XMLStreamException { PathAddress address = cacheAddress.append(BackupsResourceDefinition.PATH); - ModelNode operation = Util.createAddOperation(address); - operations.put(address, operation); while (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT)) { XMLElement element = XMLElement.forName(reader.getLocalName()); @@ -781,7 +796,6 @@ private void parseBackups(XMLExtendedStreamReader reader, PathAddress cacheAddre } } - @SuppressWarnings({ "static-method", "deprecation" }) private void parseBackup(XMLExtendedStreamReader reader, PathAddress backupsAddress, Map operations) throws XMLStreamException { String site = require(reader, XMLAttribute.SITE); @@ -851,8 +865,7 @@ private void parseBackup(XMLExtendedStreamReader reader, PathAddress backupsAddr private void parseLocking(XMLExtendedStreamReader reader, PathAddress cacheAddress, Map operations) throws XMLStreamException { PathAddress address = cacheAddress.append(LockingResourceDefinition.PATH); - ModelNode operation = Util.createAddOperation(address); - operations.put(address, operation); + ModelNode operation = operations.get(address); for (int i = 0; i < reader.getAttributeCount(); i++) { XMLAttribute attribute = XMLAttribute.forName(reader.getAttributeLocalName(i)); @@ -885,10 +898,6 @@ private void parseTransaction(XMLExtendedStreamReader reader, PathAddress cacheA PathAddress address = cacheAddress.append(TransactionResourceDefinition.PATH); ModelNode operation = operations.get(address); - if (operation == null) { - operation = Util.createAddOperation(address); - operations.put(address, operation); - } for (int i = 0; i < reader.getAttributeCount(); i++) { XMLAttribute attribute = XMLAttribute.forName(reader.getAttributeLocalName(i)); @@ -923,7 +932,7 @@ private void parseEviction(XMLExtendedStreamReader reader, PathAddress cacheAddr PathAddress address = cacheAddress.append(HeapMemoryResourceDefinition.PATH); ModelNode operation = Util.createAddOperation(address); - operations.put(address, operation); + operations.put(cacheAddress.append(MemoryResourceDefinition.WILDCARD_PATH), operation); for (int i = 0; i < reader.getAttributeCount(); i++) { XMLAttribute attribute = XMLAttribute.forName(reader.getAttributeLocalName(i)); @@ -947,8 +956,7 @@ private void parseEviction(XMLExtendedStreamReader reader, PathAddress cacheAddr private void parseExpiration(XMLExtendedStreamReader reader, PathAddress cacheAddress, Map operations) throws XMLStreamException { PathAddress address = cacheAddress.append(ExpirationResourceDefinition.PATH); - ModelNode operation = Util.createAddOperation(address); - operations.put(address, operation); + ModelNode operation = operations.get(address); for (int i = 0; i < reader.getAttributeCount(); i++) { XMLAttribute attribute = XMLAttribute.forName(reader.getAttributeLocalName(i)); @@ -1008,7 +1016,7 @@ private void parseHeapMemory(XMLExtendedStreamReader reader, PathAddress cacheAd PathAddress address = cacheAddress.append(HeapMemoryResourceDefinition.PATH); ModelNode operation = Util.createAddOperation(address); - operations.put(address, operation); + operations.put(cacheAddress.append(MemoryResourceDefinition.WILDCARD_PATH), operation); for (int i = 0; i < reader.getAttributeCount(); i++) { XMLAttribute attribute = XMLAttribute.forName(reader.getAttributeLocalName(i)); @@ -1031,7 +1039,7 @@ private void parseBinaryMemory(XMLExtendedStreamReader reader, PathAddress cache PathAddress address = cacheAddress.append(OffHeapMemoryResourceDefinition.BINARY_PATH); ModelNode operation = Util.createAddOperation(address); - operations.put(address, operation); + operations.put(cacheAddress.append(MemoryResourceDefinition.WILDCARD_PATH), operation); for (int i = 0; i < reader.getAttributeCount(); i++) { this.parseBinaryMemoryAttribute(reader, i, operation); @@ -1043,7 +1051,7 @@ private void parseOffHeapMemory(XMLExtendedStreamReader reader, PathAddress cach PathAddress address = cacheAddress.append(OffHeapMemoryResourceDefinition.PATH); ModelNode operation = Util.createAddOperation(address); - operations.put(address, operation); + operations.put(cacheAddress.append(MemoryResourceDefinition.WILDCARD_PATH), operation); for (int i = 0; i < reader.getAttributeCount(); i++) { XMLAttribute attribute = XMLAttribute.forName(reader.getAttributeLocalName(i)); @@ -1111,12 +1119,8 @@ private void applyLegacyStoreAttributeDefaults(ModelNode operation) { private void parseCustomStore(XMLExtendedStreamReader reader, PathAddress cacheAddress, Map operations) throws XMLStreamException { PathAddress address = cacheAddress.append(CustomStoreResourceDefinition.PATH); - PathAddress operationKey = cacheAddress.append(StoreResourceDefinition.WILDCARD_PATH); - if (operations.containsKey(operationKey)) { - throw ParseUtils.unexpectedElement(reader); - } ModelNode operation = Util.createAddOperation(address); - operations.put(operationKey, operation); + operations.put(cacheAddress.append(StoreResourceDefinition.WILDCARD_PATH), operation); for (int i = 0; i < reader.getAttributeCount(); i++) { XMLAttribute attribute = XMLAttribute.forName(reader.getAttributeLocalName(i)); @@ -1137,6 +1141,8 @@ private void parseCustomStore(XMLExtendedStreamReader reader, PathAddress cacheA this.applyLegacyStoreAttributeDefaults(operation); + addRequiredSingletonChildOperations(address, StoreResourceDefinition.REQUIRED_SINGLETON_CHILDREN, operations); + while (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT)) { this.parseStoreElement(reader, address, operations); } @@ -1145,12 +1151,8 @@ private void parseCustomStore(XMLExtendedStreamReader reader, PathAddress cacheA private void parseFileStore(XMLExtendedStreamReader reader, PathAddress cacheAddress, Map operations) throws XMLStreamException { PathAddress address = cacheAddress.append(FileStoreResourceDefinition.PATH); - PathAddress operationKey = cacheAddress.append(StoreResourceDefinition.WILDCARD_PATH); - if (operations.containsKey(operationKey)) { - throw ParseUtils.unexpectedElement(reader); - } ModelNode operation = Util.createAddOperation(address); - operations.put(operationKey, operation); + operations.put(cacheAddress.append(StoreResourceDefinition.WILDCARD_PATH), operation); for (int i = 0; i < reader.getAttributeCount(); i++) { XMLAttribute attribute = XMLAttribute.forName(reader.getAttributeLocalName(i)); @@ -1171,6 +1173,8 @@ private void parseFileStore(XMLExtendedStreamReader reader, PathAddress cacheAdd this.applyLegacyStoreAttributeDefaults(operation); + addRequiredSingletonChildOperations(address, StoreResourceDefinition.REQUIRED_SINGLETON_CHILDREN, operations); + while (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT)) { this.parseStoreElement(reader, address, operations); } @@ -1179,12 +1183,8 @@ private void parseFileStore(XMLExtendedStreamReader reader, PathAddress cacheAdd private void parseRemoteStore(XMLExtendedStreamReader reader, PathAddress cacheAddress, Map operations) throws XMLStreamException { PathAddress address = cacheAddress.append(RemoteStoreResourceDefinition.PATH); - PathAddress operationKey = cacheAddress.append(StoreResourceDefinition.WILDCARD_PATH); - if (operations.containsKey(operationKey)) { - throw ParseUtils.unexpectedElement(reader); - } ModelNode operation = Util.createAddOperation(address); - operations.put(operationKey, operation); + operations.put(cacheAddress.append(StoreResourceDefinition.WILDCARD_PATH), operation); for (int i = 0; i < reader.getAttributeCount(); i++) { XMLAttribute attribute = XMLAttribute.forName(reader.getAttributeLocalName(i)); @@ -1215,6 +1215,8 @@ private void parseRemoteStore(XMLExtendedStreamReader reader, PathAddress cacheA this.applyLegacyStoreAttributeDefaults(operation); + addRequiredSingletonChildOperations(address, StoreResourceDefinition.REQUIRED_SINGLETON_CHILDREN, operations); + while (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT)) { XMLElement element = XMLElement.forName(reader.getLocalName()); switch (element) { @@ -1250,12 +1252,8 @@ private void parseRemoteStore(XMLExtendedStreamReader reader, PathAddress cacheA private void parseHotRodStore(XMLExtendedStreamReader reader, PathAddress cacheAddress, Map operations) throws XMLStreamException { PathAddress address = cacheAddress.append(HotRodStoreResourceDefinition.PATH); - PathAddress operationKey = cacheAddress.append(StoreResourceDefinition.WILDCARD_PATH); - if (operations.containsKey(operationKey)) { - throw ParseUtils.unexpectedElement(reader); - } ModelNode operation = Util.createAddOperation(address); - operations.put(operationKey, operation); + operations.put(cacheAddress.append(StoreResourceDefinition.WILDCARD_PATH), operation); for (int i = 0; i < reader.getAttributeCount(); i++) { XMLAttribute attribute = XMLAttribute.forName(reader.getAttributeLocalName(i)); @@ -1276,6 +1274,8 @@ private void parseHotRodStore(XMLExtendedStreamReader reader, PathAddress cacheA this.applyLegacyStoreAttributeDefaults(operation); + addRequiredSingletonChildOperations(address, StoreResourceDefinition.REQUIRED_SINGLETON_CHILDREN, operations); + while (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT)) { this.parseStoreElement(reader, address, operations); } @@ -1285,14 +1285,14 @@ private void parseJDBCStore(XMLExtendedStreamReader reader, PathAddress cacheAdd PathAddress address = cacheAddress.append(JDBCStoreResourceDefinition.PATH); PathAddress operationKey = cacheAddress.append(StoreResourceDefinition.WILDCARD_PATH); - if (operations.containsKey(operationKey)) { - throw ParseUtils.unexpectedElement(reader); - } ModelNode operation = Util.createAddOperation(address); operations.put(operationKey, operation); this.parseJDBCStoreAttributes(reader, operationKey, operations); + addRequiredChildOperations(address, JDBCStoreResourceDefinition.REQUIRED_CHILDREN, operations); + addRequiredSingletonChildOperations(address, StoreResourceDefinition.REQUIRED_SINGLETON_CHILDREN, operations); + while (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT)) { XMLElement element = XMLElement.forName(reader.getLocalName()); switch (element) { @@ -1311,14 +1311,14 @@ private void parseBinaryKeyedJDBCStore(XMLExtendedStreamReader reader, PathAddre PathAddress address = cacheAddress.append(JDBCStoreResourceDefinition.PATH); PathAddress operationKey = cacheAddress.append(StoreResourceDefinition.WILDCARD_PATH); - if (operations.containsKey(operationKey)) { - throw ParseUtils.unexpectedElement(reader); - } ModelNode operation = Util.createAddOperation(address); operations.put(operationKey, operation); this.parseJDBCStoreAttributes(reader, operationKey, operations); + addRequiredChildOperations(address, JDBCStoreResourceDefinition.REQUIRED_CHILDREN, operations); + addRequiredSingletonChildOperations(address, StoreResourceDefinition.REQUIRED_SINGLETON_CHILDREN, operations); + while (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT)) { XMLElement element = XMLElement.forName(reader.getLocalName()); switch (element) { @@ -1337,14 +1337,14 @@ private void parseStringKeyedJDBCStore(XMLExtendedStreamReader reader, PathAddre PathAddress address = cacheAddress.append(JDBCStoreResourceDefinition.PATH); PathAddress operationKey = cacheAddress.append(StoreResourceDefinition.WILDCARD_PATH); - if (operations.containsKey(operationKey)) { - throw ParseUtils.unexpectedElement(reader); - } ModelNode operation = Util.createAddOperation(address); operations.put(operationKey, operation); this.parseJDBCStoreAttributes(reader, operationKey, operations); + addRequiredChildOperations(address, JDBCStoreResourceDefinition.REQUIRED_CHILDREN, operations); + addRequiredSingletonChildOperations(address, StoreResourceDefinition.REQUIRED_SINGLETON_CHILDREN, operations); + while (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT)) { XMLElement element = XMLElement.forName(reader.getLocalName()); switch (element) { @@ -1363,14 +1363,14 @@ private void parseMixedKeyedJDBCStore(XMLExtendedStreamReader reader, PathAddres PathAddress address = cacheAddress.append(JDBCStoreResourceDefinition.PATH); PathAddress operationKey = cacheAddress.append(StoreResourceDefinition.WILDCARD_PATH); - if (operations.containsKey(operationKey)) { - throw ParseUtils.unexpectedElement(reader); - } ModelNode operation = Util.createAddOperation(address); operations.put(operationKey, operation); this.parseJDBCStoreAttributes(reader, operationKey, operations); + addRequiredChildOperations(address, JDBCStoreResourceDefinition.REQUIRED_CHILDREN, operations); + addRequiredSingletonChildOperations(address, StoreResourceDefinition.REQUIRED_SINGLETON_CHILDREN, operations); + while (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT)) { XMLElement element = XMLElement.forName(reader.getLocalName()); switch (element) { @@ -1428,8 +1428,7 @@ private void parseJDBCStoreAttributes(XMLExtendedStreamReader reader, PathAddres private void parseJDBCStoreBinaryTable(XMLExtendedStreamReader reader, PathAddress storeAddress, Map operations) throws XMLStreamException { PathAddress address = storeAddress.append(StringTableResourceDefinition.PATH); - ModelNode operation = Util.createAddOperation(address); - operations.put(storeAddress.getParent().append(StoreResourceDefinition.WILDCARD_PATH).append(StringTableResourceDefinition.PATH), operation); + ModelNode operation = operations.get(address); for (int i = 0; i < reader.getAttributeCount(); i++) { XMLAttribute attribute = XMLAttribute.forName(reader.getAttributeLocalName(i)); @@ -1450,8 +1449,7 @@ private void parseJDBCStoreBinaryTable(XMLExtendedStreamReader reader, PathAddre private void parseJDBCStoreStringTable(XMLExtendedStreamReader reader, PathAddress storeAddress, Map operations) throws XMLStreamException { PathAddress address = storeAddress.append(StringTableResourceDefinition.PATH); - ModelNode operation = Util.createAddOperation(address); - operations.put(storeAddress.getParent().append(StoreResourceDefinition.WILDCARD_PATH).append(StringTableResourceDefinition.PATH), operation); + ModelNode operation = operations.get(address); for (int i = 0; i < reader.getAttributeCount(); i++) { XMLAttribute attribute = XMLAttribute.forName(reader.getAttributeLocalName(i)); @@ -1664,8 +1662,7 @@ private void parseStoreWriteBehind(XMLExtendedStreamReader reader, PathAddress s private

void parseThreadPool(P pool, XMLExtendedStreamReader reader, PathAddress parentAddress, Map operations) throws XMLStreamException { PathAddress address = parentAddress.append(pool.getPathElement()); - ModelNode operation = Util.createAddOperation(address); - operations.put(address, operation); + ModelNode operation = operations.get(address); for (int i = 0; i < reader.getAttributeCount(); i++) { XMLAttribute attribute = XMLAttribute.forName(reader.getAttributeLocalName(i)); @@ -1701,8 +1698,7 @@ private

void parse private

void parseScheduledThreadPool(P pool, XMLExtendedStreamReader reader, PathAddress parentAddress, Map operations) throws XMLStreamException { PathAddress address = parentAddress.append(pool.getPathElement()); - ModelNode operation = Util.createAddOperation(address); - operations.put(address, operation); + ModelNode operation = operations.get(address); for (int i = 0; i < reader.getAttributeCount(); i++) { XMLAttribute attribute = XMLAttribute.forName(reader.getAttributeLocalName(i)); @@ -1827,6 +1823,8 @@ private void parseRemoteContainer(XMLExtendedStreamReader reader, PathAddress su } } + addRequiredChildOperations(address, RemoteCacheContainerResourceDefinition.REQUIRED_CHILDREN, operations); + while (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT)) { XMLElement element = XMLElement.forName(reader.getLocalName()); switch (element) { @@ -1880,8 +1878,7 @@ private void parseRemoteContainer(XMLExtendedStreamReader reader, PathAddress su private void parseConnectionPool(XMLExtendedStreamReader reader, PathAddress cacheAddress, Map operations) throws XMLStreamException { PathAddress address = cacheAddress.append(ConnectionPoolResourceDefinition.PATH); - ModelNode operation = Util.createAddOperation(address); - operations.put(address, operation); + ModelNode operation = operations.get(address); for (int i = 0; i < reader.getAttributeCount(); i++) { XMLAttribute attribute = XMLAttribute.forName(reader.getAttributeLocalName(i)); @@ -1958,8 +1955,7 @@ private void parseRemoteCluster(XMLExtendedStreamReader reader, PathAddress clus private void parseRemoteCacheContainerSecurity(XMLExtendedStreamReader reader, PathAddress containerAddress, Map operations) throws XMLStreamException { PathAddress address = containerAddress.append(SecurityResourceDefinition.PATH); - ModelNode operation = Util.createAddOperation(address); - operations.put(address, operation); + ModelNode operation = operations.get(address); for (int i = 0; i < reader.getAttributeCount(); i++) { XMLAttribute attribute = XMLAttribute.forName(reader.getAttributeLocalName(i)); @@ -2002,4 +1998,19 @@ private static void readElement(XMLExtendedStreamReader reader, ModelNode operat parser.parseAndSetParameter(definition, reader.getElementText(), operation, reader); } } + + private static void addRequiredChildOperations(PathAddress parentAddress, Set children, Map operations) { + // WFLY-18401 Add required children to boot operations + for (PathElement child : children) { + PathAddress address = parentAddress.append(child); + operations.put(address, Util.createAddOperation(address)); + } + } + + private static void addRequiredSingletonChildOperations(PathAddress parentAddress, Set children, Map operations) { + // WFLY-18401 Add required singleton children to boot operations + for (PathElement child : children) { + operations.put(parentAddress.append(child.getKey()), Util.createAddOperation(parentAddress.append(child))); + } + } } diff --git a/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/subsystem/JDBCStoreResourceDefinition.java b/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/subsystem/JDBCStoreResourceDefinition.java index 315797d882c6..96b7e2448a38 100644 --- a/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/subsystem/JDBCStoreResourceDefinition.java +++ b/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/subsystem/JDBCStoreResourceDefinition.java @@ -22,6 +22,7 @@ package org.jboss.as.clustering.infinispan.subsystem; +import java.util.Set; import java.util.function.UnaryOperator; import org.infinispan.persistence.jdbc.common.DatabaseType; @@ -78,12 +79,14 @@ public AttributeDefinition getDefinition() { } } + static final Set REQUIRED_CHILDREN = Set.of(StringTableResourceDefinition.PATH); + static class ResourceDescriptorConfigurator implements UnaryOperator { @Override public ResourceDescriptor apply(ResourceDescriptor descriptor) { return descriptor.addAttributes(Attribute.class) - .addRequiredChildren(StringTableResourceDefinition.PATH) + .addRequiredChildren(REQUIRED_CHILDREN) ; } } diff --git a/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/subsystem/SharedStateCacheResourceDefinition.java b/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/subsystem/SharedStateCacheResourceDefinition.java index 8f15b1b230bf..8a39962def67 100644 --- a/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/subsystem/SharedStateCacheResourceDefinition.java +++ b/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/subsystem/SharedStateCacheResourceDefinition.java @@ -22,6 +22,7 @@ package org.jboss.as.clustering.infinispan.subsystem; +import java.util.Set; import java.util.function.UnaryOperator; import org.infinispan.Cache; @@ -38,6 +39,8 @@ */ public class SharedStateCacheResourceDefinition extends ClusteredCacheResourceDefinition { + static final Set REQUIRED_CHILDREN = Set.of(PartitionHandlingResourceDefinition.PATH, StateTransferResourceDefinition.PATH, BackupsResourceDefinition.PATH); + private static class ResourceDescriptorConfigurator implements UnaryOperator { private final UnaryOperator configurator; @@ -47,7 +50,7 @@ private static class ResourceDescriptorConfigurator implements UnaryOperator REQUIRED_SINGLETON_CHILDREN = Set.of(StoreWriteThroughResourceDefinition.PATH); + private final UnaryOperator configurator; private final ResourceServiceConfiguratorFactory factory; @@ -142,7 +145,7 @@ public ManagementResourceRegistration register(ManagementResourceRegistration pa .addAttributes(Attribute.class) .addAttributes(DeprecatedAttribute.class) .addCapabilities(Capability.class) - .addRequiredSingletonChildren(StoreWriteThroughResourceDefinition.PATH) + .addRequiredSingletonChildren(REQUIRED_SINGLETON_CHILDREN) ; ResourceServiceHandler handler = new SimpleResourceServiceHandler(this.factory); new SimpleResourceRegistrar(descriptor, handler).register(registration); diff --git a/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/subsystem/StoreServiceConfigurator.java b/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/subsystem/StoreServiceConfigurator.java index c207017aa490..2362f77c04ce 100644 --- a/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/subsystem/StoreServiceConfigurator.java +++ b/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/subsystem/StoreServiceConfigurator.java @@ -28,6 +28,7 @@ import java.util.Properties; import java.util.function.Consumer; +import org.infinispan.commons.configuration.Combine; import org.infinispan.configuration.cache.AbstractStoreConfigurationBuilder; import org.infinispan.configuration.cache.AsyncStoreConfiguration; import org.infinispan.configuration.cache.ConfigurationBuilder; @@ -98,7 +99,7 @@ public PersistenceConfiguration get() { .withProperties(this.properties) ; this.accept(builder); - return builder.async().read(this.async.get()).persistence().create(); + return builder.async().read(this.async.get(), Combine.DEFAULT).persistence().create(); } boolean isPurgeOnStartup() { diff --git a/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/subsystem/remote/RemoteCacheContainerResourceDefinition.java b/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/subsystem/remote/RemoteCacheContainerResourceDefinition.java index 8c6b3044df0f..702c9bf8d3fd 100644 --- a/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/subsystem/remote/RemoteCacheContainerResourceDefinition.java +++ b/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/subsystem/remote/RemoteCacheContainerResourceDefinition.java @@ -23,6 +23,7 @@ package org.jboss.as.clustering.infinispan.subsystem.remote; import java.util.EnumSet; +import java.util.Set; import java.util.concurrent.TimeUnit; import java.util.function.UnaryOperator; @@ -228,6 +229,8 @@ public SimpleAttributeDefinitionBuilder apply(SimpleAttributeDefinitionBuilder b } } + public static final Set REQUIRED_CHILDREN = Set.of(ConnectionPoolResourceDefinition.PATH, ThreadPoolResourceDefinition.CLIENT.getPathElement(), SecurityResourceDefinition.PATH); + public RemoteCacheContainerResourceDefinition() { super(WILDCARD_PATH, InfinispanExtension.SUBSYSTEM_RESOLVER.createChildResolver(WILDCARD_PATH)); } @@ -241,7 +244,7 @@ public ManagementResourceRegistration register(ManagementResourceRegistration pa .addAttributes(ListAttribute.class) .addAttributes(DeprecatedAttribute.class) .addCapabilities(Capability.class) - .addRequiredChildren(ConnectionPoolResourceDefinition.PATH, ThreadPoolResourceDefinition.CLIENT.getPathElement(), SecurityResourceDefinition.PATH) + .addRequiredChildren(REQUIRED_CHILDREN) .setResourceTransformation(RemoteCacheContainerResource::new) ; ServiceValueExecutorRegistry executors = new ServiceValueExecutorRegistry<>(); diff --git a/clustering/infinispan/extension/src/main/resources/schema/jboss-as-infinispan_14_0.xsd b/clustering/infinispan/extension/src/main/resources/schema/jboss-as-infinispan_14_0.xsd index 44c48d51f6ea..082058b8bae2 100644 --- a/clustering/infinispan/extension/src/main/resources/schema/jboss-as-infinispan_14_0.xsd +++ b/clustering/infinispan/extension/src/main/resources/schema/jboss-as-infinispan_14_0.xsd @@ -361,7 +361,7 @@ - + The timeout (in ms) used to wait for an acknowledgment when making a remote call, after which the call is aborted and an exception is thrown. diff --git a/clustering/infinispan/marshalling/pom.xml b/clustering/infinispan/marshalling/pom.xml index 624b008d0bfa..d45ff3b7c7c1 100644 --- a/clustering/infinispan/marshalling/pom.xml +++ b/clustering/infinispan/marshalling/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-infinispan-marshalling diff --git a/clustering/infinispan/pom.xml b/clustering/infinispan/pom.xml index 7cf74469b406..b84a49285b8a 100644 --- a/clustering/infinispan/pom.xml +++ b/clustering/infinispan/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-infinispan diff --git a/clustering/jgroups/api/pom.xml b/clustering/jgroups/api/pom.xml index e2115cd382b4..d721e64850c4 100644 --- a/clustering/jgroups/api/pom.xml +++ b/clustering/jgroups/api/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-jgroups-api diff --git a/clustering/jgroups/extension/pom.xml b/clustering/jgroups/extension/pom.xml index e3f696a4b868..925c6da4997e 100644 --- a/clustering/jgroups/extension/pom.xml +++ b/clustering/jgroups/extension/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-jgroups-extension diff --git a/clustering/jgroups/extension/src/main/java/org/jboss/as/clustering/jgroups/subsystem/JGroupsSubsystemSchema.java b/clustering/jgroups/extension/src/main/java/org/jboss/as/clustering/jgroups/subsystem/JGroupsSubsystemSchema.java index ac7a37b38eaf..ec0585fb444c 100644 --- a/clustering/jgroups/extension/src/main/java/org/jboss/as/clustering/jgroups/subsystem/JGroupsSubsystemSchema.java +++ b/clustering/jgroups/extension/src/main/java/org/jboss/as/clustering/jgroups/subsystem/JGroupsSubsystemSchema.java @@ -25,7 +25,6 @@ import javax.xml.stream.XMLStreamException; -import org.jboss.as.controller.LegacySubsystemURN; import org.jboss.as.controller.SubsystemSchema; import org.jboss.as.controller.xml.VersionedNamespace; import org.jboss.dmr.ModelNode; @@ -54,7 +53,7 @@ public enum JGroupsSubsystemSchema implements SubsystemSchema namespace; JGroupsSubsystemSchema(int major, int minor) { - this.namespace = new LegacySubsystemURN<>(JGroupsExtension.SUBSYSTEM_NAME, new IntVersion(major, minor)); + this.namespace = SubsystemSchema.createLegacySubsystemURN(JGroupsExtension.SUBSYSTEM_NAME, new IntVersion(major, minor)); } @Override diff --git a/clustering/jgroups/pom.xml b/clustering/jgroups/pom.xml index b929bf186479..79a745533616 100644 --- a/clustering/jgroups/pom.xml +++ b/clustering/jgroups/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-jgroups diff --git a/clustering/jgroups/spi/pom.xml b/clustering/jgroups/spi/pom.xml index cf7ed80363a6..586dc1d1164c 100644 --- a/clustering/jgroups/spi/pom.xml +++ b/clustering/jgroups/spi/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-jgroups-spi diff --git a/clustering/marshalling/api/pom.xml b/clustering/marshalling/api/pom.xml index deefc49acedb..518ad7771693 100644 --- a/clustering/marshalling/api/pom.xml +++ b/clustering/marshalling/api/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-marshalling-api diff --git a/clustering/marshalling/jboss/pom.xml b/clustering/marshalling/jboss/pom.xml index f0ebfb910d4c..21e7bff7bd58 100644 --- a/clustering/marshalling/jboss/pom.xml +++ b/clustering/marshalling/jboss/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-marshalling-jboss diff --git a/clustering/marshalling/pom.xml b/clustering/marshalling/pom.xml index 524455a241da..ef3c11cbb28a 100644 --- a/clustering/marshalling/pom.xml +++ b/clustering/marshalling/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-marshalling diff --git a/clustering/marshalling/protostream/pom.xml b/clustering/marshalling/protostream/pom.xml index 6bbbbff7ceae..338a22d092ea 100644 --- a/clustering/marshalling/protostream/pom.xml +++ b/clustering/marshalling/protostream/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-marshalling-protostream diff --git a/clustering/marshalling/spi/pom.xml b/clustering/marshalling/spi/pom.xml index 342138eefa73..0180195fd557 100644 --- a/clustering/marshalling/spi/pom.xml +++ b/clustering/marshalling/spi/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-marshalling-spi diff --git a/clustering/pom.xml b/clustering/pom.xml index e8f942d22601..30edfe38ec58 100644 --- a/clustering/pom.xml +++ b/clustering/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering diff --git a/clustering/server/api/pom.xml b/clustering/server/api/pom.xml index fc8204f31fbb..f69a049ff56e 100644 --- a/clustering/server/api/pom.xml +++ b/clustering/server/api/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-server-api diff --git a/clustering/server/extension/pom.xml b/clustering/server/extension/pom.xml index d78bca5c9a7e..93b926aace20 100644 --- a/clustering/server/extension/pom.xml +++ b/clustering/server/extension/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-server-extension diff --git a/clustering/server/infinispan/pom.xml b/clustering/server/infinispan/pom.xml index 4c6e7a41bfc0..99933a17fce0 100644 --- a/clustering/server/infinispan/pom.xml +++ b/clustering/server/infinispan/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-server-infinispan diff --git a/clustering/server/pom.xml b/clustering/server/pom.xml index e69b8117de77..7c3e1638b61c 100644 --- a/clustering/server/pom.xml +++ b/clustering/server/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-server diff --git a/clustering/server/service/pom.xml b/clustering/server/service/pom.xml index 2f892b6554b8..d0e1e206608b 100644 --- a/clustering/server/service/pom.xml +++ b/clustering/server/service/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-server-service diff --git a/clustering/server/spi/pom.xml b/clustering/server/spi/pom.xml index 8f5b678f5580..409683efc7e8 100644 --- a/clustering/server/spi/pom.xml +++ b/clustering/server/spi/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-server-spi diff --git a/clustering/service/pom.xml b/clustering/service/pom.xml index c933e88850fb..1eebfd938a90 100644 --- a/clustering/service/pom.xml +++ b/clustering/service/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-service diff --git a/clustering/singleton/api/pom.xml b/clustering/singleton/api/pom.xml index 15f4caf666b1..091372cde142 100644 --- a/clustering/singleton/api/pom.xml +++ b/clustering/singleton/api/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-singleton-api diff --git a/clustering/singleton/extension/pom.xml b/clustering/singleton/extension/pom.xml index b34af09f24ad..b1412326edce 100644 --- a/clustering/singleton/extension/pom.xml +++ b/clustering/singleton/extension/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-singleton-extension diff --git a/clustering/singleton/extension/src/main/java/org/wildfly/extension/clustering/singleton/SingletonSubsystemSchema.java b/clustering/singleton/extension/src/main/java/org/wildfly/extension/clustering/singleton/SingletonSubsystemSchema.java index b5f4d4289503..7fdb46480512 100644 --- a/clustering/singleton/extension/src/main/java/org/wildfly/extension/clustering/singleton/SingletonSubsystemSchema.java +++ b/clustering/singleton/extension/src/main/java/org/wildfly/extension/clustering/singleton/SingletonSubsystemSchema.java @@ -25,7 +25,6 @@ import javax.xml.stream.XMLStreamException; -import org.jboss.as.controller.LegacySubsystemURN; import org.jboss.as.controller.SubsystemSchema; import org.jboss.as.controller.xml.VersionedNamespace; import org.jboss.dmr.ModelNode; @@ -45,7 +44,7 @@ public enum SingletonSubsystemSchema implements SubsystemSchema namespace; SingletonSubsystemSchema(int major, int minor) { - this.namespace = new LegacySubsystemURN<>(SingletonExtension.SUBSYSTEM_NAME, new IntVersion(major, minor)); + this.namespace = SubsystemSchema.createLegacySubsystemURN(SingletonExtension.SUBSYSTEM_NAME, new IntVersion(major, minor)); } @Override diff --git a/clustering/singleton/extension/src/main/java/org/wildfly/extension/clustering/singleton/deployment/SingletonDeploymentSchema.java b/clustering/singleton/extension/src/main/java/org/wildfly/extension/clustering/singleton/deployment/SingletonDeploymentSchema.java index 5e29c0b519c9..f5fd4d748b85 100644 --- a/clustering/singleton/extension/src/main/java/org/wildfly/extension/clustering/singleton/deployment/SingletonDeploymentSchema.java +++ b/clustering/singleton/extension/src/main/java/org/wildfly/extension/clustering/singleton/deployment/SingletonDeploymentSchema.java @@ -22,10 +22,12 @@ package org.wildfly.extension.clustering.singleton.deployment; +import java.util.List; + import javax.xml.stream.XMLStreamException; +import org.jboss.as.controller.xml.IntVersionSchema; import org.jboss.as.controller.xml.VersionedNamespace; -import org.jboss.as.controller.xml.VersionedURN; import org.jboss.as.controller.xml.XMLElementSchema; import org.jboss.as.server.deployment.DeploymentUnit; import org.jboss.as.server.deployment.jbossallxml.JBossAllSchema; @@ -45,7 +47,7 @@ public enum SingletonDeploymentSchema implements XMLElementSchema namespace; SingletonDeploymentSchema(int major, int minor) { - this.namespace = new VersionedURN<>(VersionedURN.JBOSS_IDENTIFIER, this.getLocalName(), new IntVersion(major, minor)); + this.namespace = IntVersionSchema.createURN(List.of(IntVersionSchema.JBOSS_IDENTIFIER, this.getLocalName()), new IntVersion(major, minor)); } @Override diff --git a/clustering/singleton/pom.xml b/clustering/singleton/pom.xml index e12cda7f1fe1..f0180a7d5d0a 100644 --- a/clustering/singleton/pom.xml +++ b/clustering/singleton/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-singleton diff --git a/clustering/singleton/server/pom.xml b/clustering/singleton/server/pom.xml index 1445097cc5dd..83539b89d636 100644 --- a/clustering/singleton/server/pom.xml +++ b/clustering/singleton/server/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-singleton-server diff --git a/clustering/singleton/service/pom.xml b/clustering/singleton/service/pom.xml index c950019769a4..d0550b55b076 100644 --- a/clustering/singleton/service/pom.xml +++ b/clustering/singleton/service/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-singleton-service diff --git a/clustering/web/api/pom.xml b/clustering/web/api/pom.xml index 72651e37e8ff..1f7fedcb3068 100644 --- a/clustering/web/api/pom.xml +++ b/clustering/web/api/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-web-api diff --git a/clustering/web/cache/pom.xml b/clustering/web/cache/pom.xml index c790a1dfac9d..2497736fa264 100644 --- a/clustering/web/cache/pom.xml +++ b/clustering/web/cache/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-web-cache diff --git a/clustering/web/container/pom.xml b/clustering/web/container/pom.xml index 4398e215b189..91de48efa196 100644 --- a/clustering/web/container/pom.xml +++ b/clustering/web/container/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-web-container diff --git a/clustering/web/extension/pom.xml b/clustering/web/extension/pom.xml index 73b2c188c3a3..9e424313871f 100644 --- a/clustering/web/extension/pom.xml +++ b/clustering/web/extension/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-web-extension diff --git a/clustering/web/extension/src/main/java/org/wildfly/extension/clustering/web/DistributableWebSubsystemModel.java b/clustering/web/extension/src/main/java/org/wildfly/extension/clustering/web/DistributableWebSubsystemModel.java index 7c7a9d3abb54..11507aac71b8 100644 --- a/clustering/web/extension/src/main/java/org/wildfly/extension/clustering/web/DistributableWebSubsystemModel.java +++ b/clustering/web/extension/src/main/java/org/wildfly/extension/clustering/web/DistributableWebSubsystemModel.java @@ -36,10 +36,11 @@ public enum DistributableWebSubsystemModel implements SubsystemModel { VERSION_1_0_0(1, 0, 0), // WildFly 17 */ - VERSION_2_0_0(2, 0, 0), // WildFly 18-26 - VERSION_3_0_0(3, 0, 0), // WildFly 27 + VERSION_2_0_0(2, 0, 0), // WildFly 18-26, EAP 7.4 + VERSION_3_0_0(3, 0, 0), // WildFly 27-29 + VERSION_4_0_0(4, 0, 0), // WildFly 30-present, EAP 8.0 ; - public static final DistributableWebSubsystemModel CURRENT = VERSION_3_0_0; + public static final DistributableWebSubsystemModel CURRENT = VERSION_4_0_0; private final ModelVersion version; diff --git a/clustering/web/extension/src/main/java/org/wildfly/extension/clustering/web/DistributableWebSubsystemSchema.java b/clustering/web/extension/src/main/java/org/wildfly/extension/clustering/web/DistributableWebSubsystemSchema.java index cfe766c5bd8d..0c5926c8414d 100644 --- a/clustering/web/extension/src/main/java/org/wildfly/extension/clustering/web/DistributableWebSubsystemSchema.java +++ b/clustering/web/extension/src/main/java/org/wildfly/extension/clustering/web/DistributableWebSubsystemSchema.java @@ -22,9 +22,15 @@ package org.wildfly.extension.clustering.web; -import org.jboss.as.controller.LegacySubsystemURN; +import static org.jboss.as.controller.PersistentResourceXMLDescription.builder; + +import java.util.stream.Stream; + +import org.jboss.as.clustering.controller.Attribute; import org.jboss.as.controller.PersistentResourceXMLDescription; import org.jboss.as.controller.PersistentSubsystemSchema; +import org.jboss.as.controller.SubsystemSchema; +import org.jboss.as.controller.PersistentResourceXMLDescription.PersistentResourceXMLBuilder; import org.jboss.as.controller.xml.VersionedNamespace; import org.jboss.staxmapper.IntVersion; @@ -35,15 +41,16 @@ public enum DistributableWebSubsystemSchema implements PersistentSubsystemSchema { VERSION_1_0(1, 0), // WildFly 17 - VERSION_2_0(2, 0), // WildFly 18-26.1 - VERSION_3_0(3, 0), // WildFly 27 + VERSION_2_0(2, 0), // WildFly 18-26.1, EAP 7.4 + VERSION_3_0(3, 0), // WildFly 27-29 + VERSION_4_0(4, 0), // WildFly 30-present, EAP 8.0 ; - static final DistributableWebSubsystemSchema CURRENT = VERSION_3_0; + static final DistributableWebSubsystemSchema CURRENT = VERSION_4_0; private final VersionedNamespace namespace; DistributableWebSubsystemSchema(int major, int minor) { - this.namespace = new LegacySubsystemURN<>(DistributableWebExtension.SUBSYSTEM_NAME, new IntVersion(major, minor)); + this.namespace = SubsystemSchema.createLegacySubsystemURN(DistributableWebExtension.SUBSYSTEM_NAME, new IntVersion(major, minor)); } @Override @@ -53,6 +60,33 @@ public VersionedNamespace getNamesp @Override public PersistentResourceXMLDescription getXMLDescription() { - return DistributableWebXMLDescriptionFactory.INSTANCE.apply(this); + return builder(DistributableWebResourceDefinition.PATH, this.namespace).addAttributes(Attribute.stream(DistributableWebResourceDefinition.Attribute.class)) + .addChild(this.getInfinispanSessionManagementResourceXMLBuilder()) + .addChild(this.getHotRodSessionManagementResourceXMLBuilder()) + .addChild(builder(InfinispanSSOManagementResourceDefinition.WILDCARD_PATH).addAttributes(Attribute.stream(InfinispanSSOManagementResourceDefinition.Attribute.class))) + .addChild(builder(HotRodSSOManagementResourceDefinition.WILDCARD_PATH).addAttributes(Attribute.stream(HotRodSSOManagementResourceDefinition.Attribute.class))) + .addChild(builder(LocalRoutingProviderResourceDefinition.PATH).setXmlElementName("local-routing")) + .addChild(builder(InfinispanRoutingProviderResourceDefinition.PATH).addAttributes(Attribute.stream(InfinispanRoutingProviderResourceDefinition.Attribute.class)).setXmlElementName("infinispan-routing")) + .build(); + } + + private PersistentResourceXMLBuilder getInfinispanSessionManagementResourceXMLBuilder() { + PersistentResourceXMLBuilder builder = builder(InfinispanSessionManagementResourceDefinition.WILDCARD_PATH).addAttributes(Stream.concat(Attribute.stream(InfinispanSessionManagementResourceDefinition.Attribute.class), Attribute.stream(SessionManagementResourceDefinition.Attribute.class))); + addAffinityChildren(builder).addChild(builder(PrimaryOwnerAffinityResourceDefinition.PATH).setXmlElementName("primary-owner-affinity")); + if (this.namespace.since(DistributableWebSubsystemSchema.VERSION_2_0)) { + builder.addChild(builder(RankedAffinityResourceDefinition.PATH).addAttributes(Attribute.stream(RankedAffinityResourceDefinition.Attribute.class)).setXmlElementName("ranked-affinity")); + } + return builder; + } + + private PersistentResourceXMLBuilder getHotRodSessionManagementResourceXMLBuilder() { + return addAffinityChildren(builder(HotRodSessionManagementResourceDefinition.WILDCARD_PATH).addAttributes(Stream.concat(Attribute.stream(HotRodSessionManagementResourceDefinition.Attribute.class), Attribute.stream(SessionManagementResourceDefinition.Attribute.class)))); + } + + private static PersistentResourceXMLBuilder addAffinityChildren(PersistentResourceXMLBuilder builder) { + return builder + .addChild(builder(NoAffinityResourceDefinition.PATH).setXmlElementName("no-affinity")) + .addChild(builder(LocalAffinityResourceDefinition.PATH).setXmlElementName("local-affinity")) + ; } } diff --git a/clustering/web/extension/src/main/java/org/wildfly/extension/clustering/web/DistributableWebXMLDescriptionFactory.java b/clustering/web/extension/src/main/java/org/wildfly/extension/clustering/web/DistributableWebXMLDescriptionFactory.java deleted file mode 100644 index 96945834781d..000000000000 --- a/clustering/web/extension/src/main/java/org/wildfly/extension/clustering/web/DistributableWebXMLDescriptionFactory.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2018, Red Hat, Inc., and individual contributors - * as indicated by the @author tags. See the copyright.txt file in the - * distribution for a full listing of individual contributors. - * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ - -package org.wildfly.extension.clustering.web; - -import static org.jboss.as.controller.PersistentResourceXMLDescription.builder; - -import java.util.function.Function; -import java.util.stream.Stream; - -import org.jboss.as.clustering.controller.Attribute; -import org.jboss.as.controller.PersistentResourceXMLDescription; -import org.jboss.as.controller.PersistentResourceXMLDescription.PersistentResourceXMLBuilder; - -/** - * XML description factory for the distributable-web subsystem. - * @author Paul Ferraro - */ -public enum DistributableWebXMLDescriptionFactory implements Function { - INSTANCE; - - @Override - public PersistentResourceXMLDescription apply(DistributableWebSubsystemSchema schema) { - return builder(DistributableWebResourceDefinition.PATH, schema.getNamespace()).addAttributes(Attribute.stream(DistributableWebResourceDefinition.Attribute.class)) - .addChild(getInfinispanSessionManagementResourceXMLBuilder(schema)) - .addChild(getHotRodSessionManagementResourceXMLBuilder(schema)) - .addChild(builder(InfinispanSSOManagementResourceDefinition.WILDCARD_PATH).addAttributes(Attribute.stream(InfinispanSSOManagementResourceDefinition.Attribute.class))) - .addChild(builder(HotRodSSOManagementResourceDefinition.WILDCARD_PATH).addAttributes(Attribute.stream(HotRodSSOManagementResourceDefinition.Attribute.class))) - .addChild(builder(LocalRoutingProviderResourceDefinition.PATH).setXmlElementName("local-routing")) - .addChild(builder(InfinispanRoutingProviderResourceDefinition.PATH).addAttributes(Attribute.stream(InfinispanRoutingProviderResourceDefinition.Attribute.class)).setXmlElementName("infinispan-routing")) - .build(); - } - - private static PersistentResourceXMLBuilder getInfinispanSessionManagementResourceXMLBuilder(DistributableWebSubsystemSchema schema) { - PersistentResourceXMLBuilder builder = builder(InfinispanSessionManagementResourceDefinition.WILDCARD_PATH).addAttributes(Stream.concat(Attribute.stream(InfinispanSessionManagementResourceDefinition.Attribute.class), Attribute.stream(SessionManagementResourceDefinition.Attribute.class))); - addAffinityChildren(builder).addChild(builder(PrimaryOwnerAffinityResourceDefinition.PATH).setXmlElementName("primary-owner-affinity")); - if (schema.since(DistributableWebSubsystemSchema.VERSION_2_0)) { - builder.addChild(builder(RankedAffinityResourceDefinition.PATH).addAttributes(Attribute.stream(RankedAffinityResourceDefinition.Attribute.class)).setXmlElementName("ranked-affinity")); - } - return builder; - } - - private static PersistentResourceXMLBuilder getHotRodSessionManagementResourceXMLBuilder(DistributableWebSubsystemSchema schema) { - return addAffinityChildren(builder(HotRodSessionManagementResourceDefinition.WILDCARD_PATH).addAttributes(Stream.concat(Attribute.stream(HotRodSessionManagementResourceDefinition.Attribute.class), Attribute.stream(SessionManagementResourceDefinition.Attribute.class)))); - } - - private static PersistentResourceXMLBuilder addAffinityChildren(PersistentResourceXMLBuilder builder) { - return builder - .addChild(builder(NoAffinityResourceDefinition.PATH).setXmlElementName("no-affinity")) - .addChild(builder(LocalAffinityResourceDefinition.PATH).setXmlElementName("local-affinity")) - ; - } -} diff --git a/clustering/web/extension/src/main/java/org/wildfly/extension/clustering/web/HotRodSessionManagementResourceDefinition.java b/clustering/web/extension/src/main/java/org/wildfly/extension/clustering/web/HotRodSessionManagementResourceDefinition.java index 44226dccba70..9281438dd664 100644 --- a/clustering/web/extension/src/main/java/org/wildfly/extension/clustering/web/HotRodSessionManagementResourceDefinition.java +++ b/clustering/web/extension/src/main/java/org/wildfly/extension/clustering/web/HotRodSessionManagementResourceDefinition.java @@ -30,6 +30,7 @@ import org.jboss.as.controller.PathElement; import org.jboss.as.controller.SimpleAttributeDefinitionBuilder; import org.jboss.as.controller.registry.AttributeAccess.Flag; +import org.jboss.dmr.ModelNode; import org.jboss.dmr.ModelType; import org.wildfly.clustering.infinispan.client.service.InfinispanClientRequirement; @@ -43,7 +44,7 @@ static PathElement pathElement(String name) { return PathElement.pathElement("hotrod-session-management", name); } - enum Attribute implements org.jboss.as.clustering.controller.Attribute, UnaryOperator { + public enum Attribute implements org.jboss.as.clustering.controller.Attribute, UnaryOperator { REMOTE_CACHE_CONTAINER("remote-cache-container", ModelType.STRING) { @Override public SimpleAttributeDefinitionBuilder apply(SimpleAttributeDefinitionBuilder builder) { @@ -54,7 +55,13 @@ public SimpleAttributeDefinitionBuilder apply(SimpleAttributeDefinitionBuilder b } }, CACHE_CONFIGURATION("cache-configuration", ModelType.STRING), - ; + EXPIRATION_THREAD_POOL_SIZE("expiration-thread-pool-size", ModelType.INT) { + @Override + public SimpleAttributeDefinitionBuilder apply(SimpleAttributeDefinitionBuilder builder) { + return builder.setDefaultValue(new ModelNode(16)); + } + }, + ; private final AttributeDefinition definition; Attribute(String name, ModelType type) { diff --git a/clustering/web/extension/src/main/java/org/wildfly/extension/clustering/web/HotRodSessionManagementResourceTransformer.java b/clustering/web/extension/src/main/java/org/wildfly/extension/clustering/web/HotRodSessionManagementResourceTransformer.java index 23734d0e237e..d45b2a3c1b9e 100644 --- a/clustering/web/extension/src/main/java/org/wildfly/extension/clustering/web/HotRodSessionManagementResourceTransformer.java +++ b/clustering/web/extension/src/main/java/org/wildfly/extension/clustering/web/HotRodSessionManagementResourceTransformer.java @@ -25,6 +25,7 @@ import java.util.function.Consumer; import org.jboss.as.controller.ModelVersion; +import org.jboss.as.controller.transform.description.DiscardAttributeChecker; import org.jboss.as.controller.transform.description.ResourceTransformationDescriptionBuilder; /** @@ -43,5 +44,9 @@ public void accept(ModelVersion version) { ResourceTransformationDescriptionBuilder builder = this.parent.addChildResource(HotRodSessionManagementResourceDefinition.WILDCARD_PATH); this.accept(version, builder); + + builder.getAttributeBuilder() + .setDiscard(DiscardAttributeChecker.ALWAYS, HotRodSessionManagementResourceDefinition.Attribute.EXPIRATION_THREAD_POOL_SIZE.getName()) + .end(); } } diff --git a/clustering/web/extension/src/main/java/org/wildfly/extension/clustering/web/HotRodSessionManagementServiceConfigurator.java b/clustering/web/extension/src/main/java/org/wildfly/extension/clustering/web/HotRodSessionManagementServiceConfigurator.java index a20a17f63ce1..678f7adea1ee 100644 --- a/clustering/web/extension/src/main/java/org/wildfly/extension/clustering/web/HotRodSessionManagementServiceConfigurator.java +++ b/clustering/web/extension/src/main/java/org/wildfly/extension/clustering/web/HotRodSessionManagementServiceConfigurator.java @@ -23,6 +23,7 @@ package org.wildfly.extension.clustering.web; import static org.wildfly.extension.clustering.web.HotRodSessionManagementResourceDefinition.Attribute.CACHE_CONFIGURATION; +import static org.wildfly.extension.clustering.web.HotRodSessionManagementResourceDefinition.Attribute.EXPIRATION_THREAD_POOL_SIZE; import static org.wildfly.extension.clustering.web.HotRodSessionManagementResourceDefinition.Attribute.REMOTE_CACHE_CONTAINER; import org.jboss.as.controller.OperationContext; @@ -42,6 +43,7 @@ public class HotRodSessionManagementServiceConfigurator extends SessionManagemen private volatile String containerName; private volatile String configurationName; + private volatile int expirationThreadPoolSize; HotRodSessionManagementServiceConfigurator(PathAddress address) { super(address); @@ -51,6 +53,7 @@ public class HotRodSessionManagementServiceConfigurator extends SessionManagemen public ServiceConfigurator configure(OperationContext context, ModelNode model) throws OperationFailedException { this.containerName = REMOTE_CACHE_CONTAINER.resolveModelAttribute(context, model).asString(); this.configurationName = CACHE_CONFIGURATION.resolveModelAttribute(context, model).asStringOrNull(); + this.expirationThreadPoolSize = EXPIRATION_THREAD_POOL_SIZE.resolveModelAttribute(context, model).asInt(); return super.configure(context, model); } @@ -68,4 +71,9 @@ public String getContainerName() { public String getConfigurationName() { return this.configurationName; } + + @Override + public int getExpirationThreadPoolSize() { + return this.expirationThreadPoolSize; + } } diff --git a/clustering/web/extension/src/main/java/org/wildfly/extension/clustering/web/deployment/DistributableWebDeploymentSchema.java b/clustering/web/extension/src/main/java/org/wildfly/extension/clustering/web/deployment/DistributableWebDeploymentSchema.java index 41cbe72ff20d..5131c15070d8 100644 --- a/clustering/web/extension/src/main/java/org/wildfly/extension/clustering/web/deployment/DistributableWebDeploymentSchema.java +++ b/clustering/web/extension/src/main/java/org/wildfly/extension/clustering/web/deployment/DistributableWebDeploymentSchema.java @@ -22,10 +22,12 @@ package org.wildfly.extension.clustering.web.deployment; +import java.util.List; + import javax.xml.stream.XMLStreamException; +import org.jboss.as.controller.xml.IntVersionSchema; import org.jboss.as.controller.xml.VersionedNamespace; -import org.jboss.as.controller.xml.VersionedURN; import org.jboss.as.controller.xml.XMLElementSchema; import org.jboss.as.server.deployment.DeploymentUnit; import org.jboss.as.server.deployment.jbossallxml.JBossAllSchema; @@ -41,11 +43,12 @@ public enum DistributableWebDeploymentSchema implements XMLElementSchema namespace; DistributableWebDeploymentSchema(int major, int minor) { - this.namespace = new VersionedURN<>(VersionedURN.JBOSS_IDENTIFIER, this.getLocalName(), new IntVersion(major, minor)); + this.namespace = IntVersionSchema.createURN(List.of(IntVersionSchema.JBOSS_IDENTIFIER, this.getLocalName()), new IntVersion(major, minor)); } @Override diff --git a/clustering/web/extension/src/main/java/org/wildfly/extension/clustering/web/deployment/DistributableWebDeploymentXMLReader.java b/clustering/web/extension/src/main/java/org/wildfly/extension/clustering/web/deployment/DistributableWebDeploymentXMLReader.java index d4a80b5bddf2..6703bc59fee9 100644 --- a/clustering/web/extension/src/main/java/org/wildfly/extension/clustering/web/deployment/DistributableWebDeploymentXMLReader.java +++ b/clustering/web/extension/src/main/java/org/wildfly/extension/clustering/web/deployment/DistributableWebDeploymentXMLReader.java @@ -67,6 +67,7 @@ public class DistributableWebDeploymentXMLReader implements XMLElementReader extends DistributableSessionManagementConfiguration, RemoteCacheConfiguration { + /** + * Returns the size of the thread pool used for processing expiration events from the remote Infinispan cluster. + * @return + */ + int getExpirationThreadPoolSize(); } diff --git a/clustering/web/extension/src/main/java/org/wildfly/extension/clustering/web/session/hotrod/HotRodSessionManagerFactoryServiceConfigurator.java b/clustering/web/extension/src/main/java/org/wildfly/extension/clustering/web/session/hotrod/HotRodSessionManagerFactoryServiceConfigurator.java index ec5bb517d3e4..4bda5892c399 100644 --- a/clustering/web/extension/src/main/java/org/wildfly/extension/clustering/web/session/hotrod/HotRodSessionManagerFactoryServiceConfigurator.java +++ b/clustering/web/extension/src/main/java/org/wildfly/extension/clustering/web/session/hotrod/HotRodSessionManagerFactoryServiceConfigurator.java @@ -84,14 +84,17 @@ public HotRodSessionManagerFactoryServiceConfigurator(HotRodSessionManagementCon @Override public ServiceConfigurator configure(CapabilityServiceSupport support) { Integer maxActiveSessions = this.getMaxActiveSessions(); - NearCacheMode mode = (maxActiveSessions == null) || (maxActiveSessions == 0) ? NearCacheMode.DISABLED : NearCacheMode.INVALIDATED; + NearCacheMode mode = (maxActiveSessions != null) && (maxActiveSessions > 0) ? NearCacheMode.INVALIDATED : NearCacheMode.DISABLED; String configurationName = this.configuration.getConfigurationName(); String templateName = (configurationName != null) ? configurationName : DefaultTemplate.DIST_SYNC.getTemplateName(); SessionAttributePersistenceStrategy strategy = this.getAttributePersistenceStrategy(); this.cacheConfigurator = new RemoteCacheServiceConfigurator<>(this.getServiceName().append("cache"), this.configuration.getContainerName(), this.getDeploymentName(), new Consumer() { @Override public void accept(RemoteCacheConfigurationBuilder builder) { - builder.forceReturnValues(false).nearCacheMode(mode).templateName(templateName).transactionMode(TransactionMode.NONE).nearCacheFactory(new SessionManagerNearCacheFactory(maxActiveSessions, strategy)); + builder.forceReturnValues(false).nearCacheMode(mode).templateName(templateName).transactionMode(TransactionMode.NONE); + if (mode.invalidated()) { + builder.nearCacheFactory(new SessionManagerNearCacheFactory(maxActiveSessions, strategy)); + } } }).configure(support); this.cache = new ServiceSupplierDependency<>(this.cacheConfigurator.getServiceName()); @@ -157,4 +160,9 @@ public RemoteCache getCache() { public SpecificationProvider getSpecificationProvider() { return this.factoryConfiguration.getSpecificationProvider(); } + + @Override + public int getExpirationThreadPoolSize() { + return this.configuration.getExpirationThreadPoolSize(); + } } diff --git a/clustering/web/extension/src/main/resources/org/wildfly/extension/clustering/web/LocalDescriptions.properties b/clustering/web/extension/src/main/resources/org/wildfly/extension/clustering/web/LocalDescriptions.properties index b42cbeae3251..a4b6506831f7 100644 --- a/clustering/web/extension/src/main/resources/org/wildfly/extension/clustering/web/LocalDescriptions.properties +++ b/clustering/web/extension/src/main/resources/org/wildfly/extension/clustering/web/LocalDescriptions.properties @@ -27,6 +27,7 @@ distributable-web.affinity.ranked.max-routes=The maximum number of routes to enc distributable-web.hotrod-session-management=HotRod-based session management provider distributable-web.hotrod-session-management.remote-cache-container=The name of the remote cache container associated with this provider distributable-web.hotrod-session-management.cache-configuration=The name of cache configuration on the remote cache container. +distributable-web.hotrod-session-management.expiration-thread-pool-size=Configures the number of threads dedicated to processing expiration events from the remote Infinispan cluster. distributable-web.single-sign-on-management.add=Adds a distributable single sign-on management provider distributable-web.single-sign-on-management.remove=Removes a distributable single sign-on management provider diff --git a/clustering/web/extension/src/main/resources/schema/distributable-web_4_0.xsd b/clustering/web/extension/src/main/resources/schema/distributable-web_4_0.xsd new file mode 100644 index 000000000000..8b9cd7c9ed71 --- /dev/null +++ b/clustering/web/extension/src/main/resources/schema/distributable-web_4_0.xsd @@ -0,0 +1,224 @@ + + + + + + + + + + References an existing session management provider + + + + + Defines a deployment specific Infinispan cache-based session management provider + + + + + Defines a deployment specific HotRod remote cache-based session management provider + + + + + + + + + References the name of an existing session management provider + + + + + + + + Defines the granularity of cache entry mapping for the attributes of a session. + + + + + Indicates the marshalling implementation used for serializing attributes of a session. + + + + + + + + + + + + + + Web requests will have an affinity for the primary owner of a given session. + Behaves the same as local-affinity if the backing cache is not distributed nor replicated. + + + + + + + Web requests will have an affinity for the first available node in a list comprised of: primary owner, backup nodes, local node (if not a primary nor backup owner). + Behaves the same as local-affinity if the cache is not distributed, nor replicated. + Must be explicitly supported by the load balancer. + + + + + + + + + References a cache-container defined by the Infinispan subsystem. + + + + + + References a cache within the associated cache-container. + If unspecified, the default cache of the associated cache-container is assumed. + + + + + + + + + + + + + + + Web requests not have an affinity for any particular server. + Intended for use cases where web session state is not maintained within the application server. + + + + + + + Web requests have an affinity for the member that last handled a given session. + This option corresponds to traditional sticky session behavior. + + + + + + + References a remote-cache-container defined by the Infinispan subsystem. + + + + + References a named configuration on the remote server. + + + + + Configures the number of threads dedicated to processing expiration events from the remote Infinispan cluster. + + + + + + + + + + + + Stores all session attributes within a single cache entry. + Generally more expensive than ATTRIBUTE granularity, but preserves any cross-attribute object references. + + + + + + + Stores each session attribute within a separate cache entry. + Generally more efficient than SESSION granularity, but does not preserve any cross-attribute object references. + + + + + + + + + + + + Session attributes will be marshalled using JBoss Marshalling. + + + + + + + Session attributes will be marshalled using ProtoStream. + + + + + + + + + + + + Web requests not have an affinity for any particular server. + Intended for use cases where web session state is not maintained within the application server. + + + + + + + Web requests have an affinity for the member that last handled a given session. + This option corresponds to traditional sticky session behavior. + + + + + + + + + + The delimiter used to separate ranked routes within the session ID. + + + + + The maximum number of routes to append to the session ID. + + + + + + + + + + Identifies an immutable session attribute class. + + + + + + + + + + diff --git a/clustering/web/extension/src/main/resources/schema/wildfly-distributable-web_4_0.xsd b/clustering/web/extension/src/main/resources/schema/wildfly-distributable-web_4_0.xsd new file mode 100644 index 000000000000..0322c5f1736a --- /dev/null +++ b/clustering/web/extension/src/main/resources/schema/wildfly-distributable-web_4_0.xsd @@ -0,0 +1,297 @@ + + + + + + + + + + + + + Defines an Infinispan cache-based session management provider + + + + + Defines a deployment specific HotRod remote cache-based session management provider + + + + + + + Defines an Infinispan cache-based single sign-on management provider + + + + + Defines an HotRod remote cache-based single sign-on management provider + + + + + + + Configures support for local routing + + + + + Configures support for cluster-aware routing + + + + + + + Identifies the default session management provider for distributable web applications + + + + + Identifies the default single sign-on management provider + + + + + + + + Uniquely identifies this session management provider. + + + + + Defines the granularity of cache entry mapping for the attributes of a session. + + + + + Indicates the marshalling implementation used for serializing attributes of a session. + + + + + + + + Uniquely identifies this single sign-on management provider. + + + + + + + + + + + + + Web requests will have an affinity for the primary owner of a given session. + Behaves the same as local-affinity if the backing cache is not distributed nor replicated. + + + + + + + Web requests will have an affinity for the first available node in a list comprised of: primary owner, backup nodes, local node (if not a primary nor backup owner). + Behaves the same as local-affinity if the cache is not distributed, nor replicated. + Must be explicitly supported by the load balancer. + + + + + + + + + + + + + + + + + + + + + + + + + Web requests not have an affinity for any particular server. + Intended for use cases where web session state is not maintained within the application server. + + + + + + + Web requests have an affinity for the member that last handled a given session. + This option corresponds to traditional sticky session behavior. + + + + + + + + + Configures the number of threads dedicated to processing expiration events from the remote Infinispan cluster. + + + + + + + + + + + + + + + + + + + + + + + References a cache-container defined by the Infinispan subsystem. + + + + + + References a cache within the associated cache-container. + If unspecified, the default cache of the associated cache-container is assumed. + + + + + + + + + References a remote-cache-container defined by the Infinispan subsystem. + + + + + References a named configuration on the remote server. + + + + + + + + + + Stores all session attributes within a single cache entry. + Generally more expensive than ATTRIBUTE granularity, but preserves any cross-attribute object references. + + + + + + + Stores each session attribute within a separate cache entry. + Generally more efficient than SESSION granularity, but does not preserve any cross-attribute object references. + + + + + + + + + + + + Session attributes will be marshalled using JBoss Marshalling. + + + + + + + Session attributes will be marshalled using ProtoStream. + + + + + + + + + + + + Web requests not have an affinity for any particular server. + Intended for use cases where web session state is not maintained within the application server. + + + + + + + Web requests have an affinity for the member that last handled a given session. + This option corresponds to traditional sticky session behavior. + + + + + + + + + + The delimiter used to separate ranked routes within the session ID. + + + + + The maximum number of routes to append to the session ID. + + + + + + + + \ No newline at end of file diff --git a/clustering/web/extension/src/test/resources/org/wildfly/extension/clustering/web/deployment/distributable-web-4.0.xml b/clustering/web/extension/src/test/resources/org/wildfly/extension/clustering/web/deployment/distributable-web-4.0.xml new file mode 100644 index 000000000000..b43cd9b9546d --- /dev/null +++ b/clustering/web/extension/src/test/resources/org/wildfly/extension/clustering/web/deployment/distributable-web-4.0.xml @@ -0,0 +1,7 @@ + + + + java.util.Locale + java.util.UUID + + diff --git a/clustering/web/extension/src/test/resources/org/wildfly/extension/clustering/web/deployment/distributable-web-hotrod-4.0.xml b/clustering/web/extension/src/test/resources/org/wildfly/extension/clustering/web/deployment/distributable-web-hotrod-4.0.xml new file mode 100644 index 000000000000..a12f44c20665 --- /dev/null +++ b/clustering/web/extension/src/test/resources/org/wildfly/extension/clustering/web/deployment/distributable-web-hotrod-4.0.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/clustering/web/extension/src/test/resources/org/wildfly/extension/clustering/web/deployment/distributable-web-infinispan-4.0.xml b/clustering/web/extension/src/test/resources/org/wildfly/extension/clustering/web/deployment/distributable-web-infinispan-4.0.xml new file mode 100644 index 000000000000..dac8aae85402 --- /dev/null +++ b/clustering/web/extension/src/test/resources/org/wildfly/extension/clustering/web/deployment/distributable-web-infinispan-4.0.xml @@ -0,0 +1,8 @@ + + + + + java.util.Locale + java.util.UUID + + diff --git a/clustering/web/extension/src/test/resources/org/wildfly/extension/clustering/web/distributable-web-4.0.xml b/clustering/web/extension/src/test/resources/org/wildfly/extension/clustering/web/distributable-web-4.0.xml new file mode 100644 index 000000000000..018650d689a1 --- /dev/null +++ b/clustering/web/extension/src/test/resources/org/wildfly/extension/clustering/web/distributable-web-4.0.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/clustering/web/extension/src/test/resources/org/wildfly/extension/clustering/web/wildfly-distributable-web-transform-2_0_0.xml b/clustering/web/extension/src/test/resources/org/wildfly/extension/clustering/web/wildfly-distributable-web-transform-2_0_0.xml index 4d5fb642e032..c351373c0df5 100644 --- a/clustering/web/extension/src/test/resources/org/wildfly/extension/clustering/web/wildfly-distributable-web-transform-2_0_0.xml +++ b/clustering/web/extension/src/test/resources/org/wildfly/extension/clustering/web/wildfly-distributable-web-transform-2_0_0.xml @@ -1,11 +1,11 @@ - + - + diff --git a/clustering/web/extension/src/test/resources/org/wildfly/extension/clustering/web/wildfly-distributable-web-transform-reject.xml b/clustering/web/extension/src/test/resources/org/wildfly/extension/clustering/web/wildfly-distributable-web-transform-reject.xml index 41a83fd53666..1fe9641c838f 100644 --- a/clustering/web/extension/src/test/resources/org/wildfly/extension/clustering/web/wildfly-distributable-web-transform-reject.xml +++ b/clustering/web/extension/src/test/resources/org/wildfly/extension/clustering/web/wildfly-distributable-web-transform-reject.xml @@ -1,4 +1,4 @@ - + diff --git a/clustering/web/hotrod/pom.xml b/clustering/web/hotrod/pom.xml index 713f13a57753..d83332d36c69 100644 --- a/clustering/web/hotrod/pom.xml +++ b/clustering/web/hotrod/pom.xml @@ -31,7 +31,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-web-hotrod diff --git a/clustering/web/hotrod/src/main/java/org/wildfly/clustering/web/hotrod/session/HotRodSessionAttributesFactoryConfiguration.java b/clustering/web/hotrod/src/main/java/org/wildfly/clustering/web/hotrod/session/HotRodSessionAttributesFactoryConfiguration.java index 6d020a64e793..63ceebcbaa1d 100644 --- a/clustering/web/hotrod/src/main/java/org/wildfly/clustering/web/hotrod/session/HotRodSessionAttributesFactoryConfiguration.java +++ b/clustering/web/hotrod/src/main/java/org/wildfly/clustering/web/hotrod/session/HotRodSessionAttributesFactoryConfiguration.java @@ -22,7 +22,6 @@ package org.wildfly.clustering.web.hotrod.session; -import org.wildfly.clustering.ee.cache.CacheProperties; import org.wildfly.clustering.ee.hotrod.HotRodConfiguration; import org.wildfly.clustering.web.cache.session.SessionAttributesFactoryConfiguration; @@ -35,9 +34,4 @@ * @param attributes serialized form type */ public interface HotRodSessionAttributesFactoryConfiguration extends SessionAttributesFactoryConfiguration, HotRodConfiguration { - - @Override - default CacheProperties getCacheProperties() { - return HotRodConfiguration.super.getCacheProperties(); - } } diff --git a/clustering/web/hotrod/src/main/java/org/wildfly/clustering/web/hotrod/session/HotRodSessionFactory.java b/clustering/web/hotrod/src/main/java/org/wildfly/clustering/web/hotrod/session/HotRodSessionFactory.java index 289324692c3f..fac36582fa3b 100644 --- a/clustering/web/hotrod/src/main/java/org/wildfly/clustering/web/hotrod/session/HotRodSessionFactory.java +++ b/clustering/web/hotrod/src/main/java/org/wildfly/clustering/web/hotrod/session/HotRodSessionFactory.java @@ -22,8 +22,7 @@ package org.wildfly.clustering.web.hotrod.session; -import java.io.IOException; -import java.nio.ByteBuffer; +import java.time.Duration; import java.time.Instant; import java.util.Collection; import java.util.concurrent.CopyOnWriteArraySet; @@ -36,15 +35,12 @@ import org.infinispan.client.hotrod.RemoteCache; import org.infinispan.client.hotrod.annotation.ClientCacheEntryExpired; import org.infinispan.client.hotrod.annotation.ClientListener; -import org.infinispan.client.hotrod.event.ClientCacheEntryCustomEvent; -import org.infinispan.commons.io.UnsignedNumeric; -import org.infinispan.commons.marshall.Marshaller; +import org.infinispan.client.hotrod.event.ClientCacheEntryExpiredEvent; import org.wildfly.clustering.Registrar; import org.wildfly.clustering.Registration; import org.wildfly.clustering.context.DefaultExecutorService; import org.wildfly.clustering.context.DefaultThreadFactory; import org.wildfly.clustering.ee.Remover; -import org.wildfly.clustering.ee.hotrod.HotRodConfiguration; import org.wildfly.clustering.web.LocalContextFactory; import org.wildfly.clustering.web.cache.session.CompositeSessionFactory; import org.wildfly.clustering.web.cache.session.CompositeSessionMetaDataEntry; @@ -54,7 +50,7 @@ import org.wildfly.clustering.web.cache.session.SessionAttributesFactory; import org.wildfly.clustering.web.cache.session.SessionCreationMetaDataEntry; import org.wildfly.clustering.web.cache.session.SessionMetaDataFactory; -import org.wildfly.clustering.web.cache.session.SimpleSessionCreationMetaData; +import org.wildfly.clustering.web.cache.session.SimpleSessionAccessMetaData; import org.wildfly.clustering.web.hotrod.logging.Logger; import org.wildfly.clustering.web.session.ImmutableSession; import org.wildfly.clustering.web.session.ImmutableSessionAttributes; @@ -62,18 +58,22 @@ import org.wildfly.security.manager.WildFlySecurityManager; /** + * Factory for creating a {@link org.wildfly.clustering.web.session.Session} backed by a set of {@link RemoteCache} entries. * @author Paul Ferraro + * @param the marshalling context type + * @param the session attribute entry type + * @param the local context type */ -@ClientListener(converterFactoryName = "___eager-key-value-version-converter", useRawData = true) // References org.infinispan.server.hotrod.KeyValueVersionConverterFactory -public class HotRodSessionFactory extends CompositeSessionFactory implements Registrar> { +@ClientListener +public class HotRodSessionFactory extends CompositeSessionFactory implements Registrar> { - private final RemoteCache> creationMetaDataCache; + private final RemoteCache> creationMetaDataCache; private final RemoteCache accessMetaDataCache; - private final ImmutableSessionMetaDataFactory> metaDataFactory; - private final ImmutableSessionAttributesFactory attributesFactory; + private final ImmutableSessionMetaDataFactory> metaDataFactory; + private final ImmutableSessionAttributesFactory attributesFactory; private final Remover attributesRemover; private final Collection> listeners = new CopyOnWriteArraySet<>(); - private final ExecutorService executor = Executors.newCachedThreadPool(new DefaultThreadFactory(this.getClass())); + private final ExecutorService executor; private final boolean nearCacheEnabled; /** @@ -83,14 +83,15 @@ public class HotRodSessionFactory extends CompositeSessionFactory> metaDataFactory, SessionAttributesFactory attributesFactory, LocalContextFactory localContextFactory) { + public HotRodSessionFactory(HotRodSessionFactoryConfiguration config, SessionMetaDataFactory> metaDataFactory, SessionAttributesFactory attributesFactory, LocalContextFactory localContextFactory) { super(metaDataFactory, attributesFactory, localContextFactory); this.metaDataFactory = metaDataFactory; this.attributesFactory = attributesFactory; this.attributesRemover = attributesFactory; this.creationMetaDataCache = config.getCache(); this.accessMetaDataCache= config.getCache(); - this.creationMetaDataCache.addClientListener(this, null, new Object[] { Boolean.TRUE }); + this.executor = Executors.newFixedThreadPool(config.getExpirationThreadPoolSize(), new DefaultThreadFactory(this.getClass())); + this.creationMetaDataCache.addClientListener(this); this.nearCacheEnabled = this.creationMetaDataCache.getRemoteCacheContainer().getConfiguration().remoteCaches().get(this.creationMetaDataCache.getName()).nearCacheMode().enabled(); } @@ -106,51 +107,42 @@ public void close() { } @ClientCacheEntryExpired - public void expired(ClientCacheEntryCustomEvent event) { - RemoteCache> creationMetaDataCache = this.creationMetaDataCache; + public void expired(ClientCacheEntryExpiredEvent event) { + RemoteCache> creationMetaDataCache = this.creationMetaDataCache; RemoteCache accessMetaDataCache = this.accessMetaDataCache; - ImmutableSessionMetaDataFactory> metaDataFactory = this.metaDataFactory; - ImmutableSessionAttributesFactory attributesFactory = this.attributesFactory; + ImmutableSessionMetaDataFactory> metaDataFactory = this.metaDataFactory; + ImmutableSessionAttributesFactory attributesFactory = this.attributesFactory; Remover attributesRemover = this.attributesRemover; Collection> listeners = this.listeners; boolean nearCacheEnabled = this.nearCacheEnabled; + String id = event.getKey().getId(); Runnable task = new Runnable() { @Override public void run() { - ByteBuffer buffer = ByteBuffer.wrap(event.getEventData()); - byte[] key = new byte[UnsignedNumeric.readUnsignedInt(buffer)]; - buffer.get(key); - byte[] value = buffer.remaining() > 0 ? new byte[UnsignedNumeric.readUnsignedInt(buffer)] : null; - if (value != null) { - buffer.get(value); - } - Marshaller marshaller = creationMetaDataCache.getRemoteCacheContainer().getConfiguration().marshaller(); - String id = null; - try { - SessionCreationMetaDataKey creationKey = (SessionCreationMetaDataKey) marshaller.objectFromByteBuffer(key); - id = creationKey.getId(); - @SuppressWarnings("unchecked") - SessionCreationMetaDataEntry creationEntry = (value != null) ? (SessionCreationMetaDataEntry) marshaller.objectFromByteBuffer(value) : new SessionCreationMetaDataEntry<>(new SimpleSessionCreationMetaData(Instant.EPOCH)); - // Ensure entry is removed from near cache + SessionCreationMetaDataEntry creationMetaDataEntry = creationMetaDataCache.withFlags(Flag.FORCE_RETURN_VALUE).remove(new SessionCreationMetaDataKey(id)); + if (creationMetaDataEntry != null) { + // Ensure access metadata entry is removed from near cache if (nearCacheEnabled) { - creationMetaDataCache.withFlags(Flag.SKIP_LISTENER_NOTIFICATION).remove(creationKey); + accessMetaDataCache.withFlags(Flag.SKIP_LISTENER_NOTIFICATION).remove(new SessionAccessMetaDataKey(id)); } - SessionAccessMetaData accessMetaData = accessMetaDataCache.withFlags(Flag.FORCE_RETURN_VALUE).remove(new SessionAccessMetaDataKey(id)); - if (accessMetaData != null) { - V attributesValue = attributesFactory.findValue(id); - if (attributesValue != null) { - ImmutableSessionMetaData metaData = metaDataFactory.createImmutableSessionMetaData(id, new CompositeSessionMetaDataEntry<>(creationEntry, accessMetaData)); - ImmutableSessionAttributes attributes = attributesFactory.createImmutableSessionAttributes(id, attributesValue); - ImmutableSession session = HotRodSessionFactory.this.createImmutableSession(id, metaData, attributes); - Logger.ROOT_LOGGER.tracef("Session %s has expired.", id); - for (Consumer listener : listeners) { - listener.accept(session); - } - attributesRemover.remove(id); + AV attributesValue = attributesFactory.findValue(id); + if (attributesValue != null) { + // Fabricate a reasonable SessionAccessMetaData + SessionAccessMetaData accessMetaData = new SimpleSessionAccessMetaData(); + Duration lastAccess = Duration.ofSeconds(1); + Duration sinceCreation = Duration.between(creationMetaDataEntry.getMetaData().getCreationTime(), Instant.now()).minus(lastAccess); + accessMetaData.setLastAccessDuration(sinceCreation, lastAccess); + + // Notify session expiration listeners + ImmutableSessionMetaData metaData = metaDataFactory.createImmutableSessionMetaData(id, new CompositeSessionMetaDataEntry<>(creationMetaDataEntry, accessMetaData)); + ImmutableSessionAttributes attributes = attributesFactory.createImmutableSessionAttributes(id, attributesValue); + ImmutableSession session = HotRodSessionFactory.this.createImmutableSession(id, metaData, attributes); + Logger.ROOT_LOGGER.tracef("Session %s has expired.", id); + for (Consumer listener : listeners) { + listener.accept(session); } + attributesRemover.remove(id); } - } catch (IOException | ClassNotFoundException e) { - Logger.ROOT_LOGGER.failedToExpireSession(e, id); } } }; diff --git a/clustering/web/hotrod/src/main/java/org/wildfly/clustering/web/hotrod/session/HotRodSessionFactoryConfiguration.java b/clustering/web/hotrod/src/main/java/org/wildfly/clustering/web/hotrod/session/HotRodSessionFactoryConfiguration.java new file mode 100644 index 000000000000..d020fa4ed732 --- /dev/null +++ b/clustering/web/hotrod/src/main/java/org/wildfly/clustering/web/hotrod/session/HotRodSessionFactoryConfiguration.java @@ -0,0 +1,37 @@ +/* + * JBoss, Home of Professional Open Source. + * Copyright 2023, Red Hat, Inc., and individual contributors + * as indicated by the @author tags. See the copyright.txt file in the + * distribution for a full listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ + +package org.wildfly.clustering.web.hotrod.session; + +import org.wildfly.clustering.ee.hotrod.HotRodConfiguration; + +/** + * Encapsulates the configuration of a {@link HotRodSessionFactory}. + * @author Paul Ferraro + */ +public interface HotRodSessionFactoryConfiguration extends HotRodConfiguration { + /** + * Returns the size of the thread pool used for processing expiration events from the remote Infinispan cluster. + * @return + */ + int getExpirationThreadPoolSize(); +} diff --git a/clustering/web/hotrod/src/main/java/org/wildfly/clustering/web/hotrod/session/HotRodSessionManagerFactoryConfiguration.java b/clustering/web/hotrod/src/main/java/org/wildfly/clustering/web/hotrod/session/HotRodSessionManagerFactoryConfiguration.java index 1e1d3fe3bcd4..194abd234ffa 100644 --- a/clustering/web/hotrod/src/main/java/org/wildfly/clustering/web/hotrod/session/HotRodSessionManagerFactoryConfiguration.java +++ b/clustering/web/hotrod/src/main/java/org/wildfly/clustering/web/hotrod/session/HotRodSessionManagerFactoryConfiguration.java @@ -21,7 +21,6 @@ */ package org.wildfly.clustering.web.hotrod.session; -import org.wildfly.clustering.ee.hotrod.HotRodConfiguration; import org.wildfly.clustering.web.session.SessionManagerFactoryConfiguration; /** @@ -31,5 +30,5 @@ * @param the local context type * @author Paul Ferraro */ -public interface HotRodSessionManagerFactoryConfiguration extends SessionManagerFactoryConfiguration, HotRodConfiguration { +public interface HotRodSessionManagerFactoryConfiguration extends SessionManagerFactoryConfiguration, HotRodSessionFactoryConfiguration { } diff --git a/clustering/web/hotrod/src/main/java/org/wildfly/clustering/web/hotrod/session/HotRodSessionMetaDataFactory.java b/clustering/web/hotrod/src/main/java/org/wildfly/clustering/web/hotrod/session/HotRodSessionMetaDataFactory.java index 85e61c3b6b87..c8ae85e45156 100644 --- a/clustering/web/hotrod/src/main/java/org/wildfly/clustering/web/hotrod/session/HotRodSessionMetaDataFactory.java +++ b/clustering/web/hotrod/src/main/java/org/wildfly/clustering/web/hotrod/session/HotRodSessionMetaDataFactory.java @@ -23,7 +23,6 @@ package org.wildfly.clustering.web.hotrod.session; import java.time.Duration; -import java.util.HashSet; import java.util.Map; import java.util.Set; import java.util.function.Function; @@ -34,6 +33,7 @@ import org.wildfly.clustering.ee.MutatorFactory; import org.wildfly.clustering.ee.cache.CacheProperties; import org.wildfly.clustering.ee.hotrod.HotRodConfiguration; +import org.wildfly.clustering.ee.hotrod.RemoteCacheEntryMutator; import org.wildfly.clustering.ee.hotrod.RemoteCacheMutatorFactory; import org.wildfly.clustering.web.cache.session.CompositeSessionMetaData; import org.wildfly.clustering.web.cache.session.CompositeSessionMetaDataEntry; @@ -48,75 +48,76 @@ import org.wildfly.clustering.web.session.ImmutableSessionMetaData; /** + * Factory for creating {@link SessionMetaData} backed by a pair of {@link RemoteCache} entries. * @author Paul Ferraro + * @param the local context type */ -public class HotRodSessionMetaDataFactory implements SessionMetaDataFactory> { +public class HotRodSessionMetaDataFactory implements SessionMetaDataFactory> { private final RemoteCache, Object> cache; - private final RemoteCache> creationMetaDataCache; - private final MutatorFactory> creationMetaDataMutatorFactory; + private final RemoteCache> creationMetaDataCache; private final RemoteCache accessMetaDataCache; - private final MutatorFactory accessMetaDataMutatorFactory; + private final MutatorFactory> creationMetaDataMutatorFactory; private final CacheProperties properties; public HotRodSessionMetaDataFactory(HotRodConfiguration configuration) { this.cache = configuration.getCache(); this.creationMetaDataCache = configuration.getCache(); - this.creationMetaDataMutatorFactory = new RemoteCacheMutatorFactory<>(this.creationMetaDataCache, new Function, Duration>() { - @Override - public Duration apply(SessionCreationMetaDataEntry entry) { - return entry.getMetaData().getTimeout(); - } - }); + this.creationMetaDataMutatorFactory = new RemoteCacheMutatorFactory<>(this.creationMetaDataCache); this.accessMetaDataCache = configuration.getCache(); - this.accessMetaDataMutatorFactory = new RemoteCacheMutatorFactory<>(this.accessMetaDataCache); this.properties = configuration.getCacheProperties(); } @Override - public CompositeSessionMetaDataEntry createValue(String id, SessionCreationMetaData creationMetaData) { - SessionCreationMetaDataEntry creationMetaDataEntry = new SessionCreationMetaDataEntry<>(creationMetaData); + public CompositeSessionMetaDataEntry createValue(String id, SessionCreationMetaData creationMetaData) { + SessionCreationMetaDataEntry creationMetaDataEntry = new SessionCreationMetaDataEntry<>(creationMetaData); SessionAccessMetaData accessMetaData = new SimpleSessionAccessMetaData(); this.creationMetaDataMutatorFactory.createMutator(new SessionCreationMetaDataKey(id), creationMetaDataEntry).mutate(); - this.accessMetaDataMutatorFactory.createMutator(new SessionAccessMetaDataKey(id), accessMetaData).mutate(); + this.createSessionAccessMetaDataMutator(new SessionAccessMetaDataKey(id), accessMetaData, creationMetaData).mutate(); return new CompositeSessionMetaDataEntry<>(creationMetaDataEntry, accessMetaData); } @Override - public CompositeSessionMetaDataEntry findValue(String id) { + public CompositeSessionMetaDataEntry findValue(String id) { SessionCreationMetaDataKey creationMetaDataKey = new SessionCreationMetaDataKey(id); SessionAccessMetaDataKey accessMetaDataKey = new SessionAccessMetaDataKey(id); - Set> keys = new HashSet<>(3); - keys.add(creationMetaDataKey); - keys.add(accessMetaDataKey); // Use bulk read - Map, Object> entries = this.cache.getAll(keys); + Map, Object> entries = this.cache.getAll(Set.of(creationMetaDataKey, accessMetaDataKey)); @SuppressWarnings("unchecked") - SessionCreationMetaDataEntry creationMetaDataEntry = (SessionCreationMetaDataEntry) entries.get(creationMetaDataKey); + SessionCreationMetaDataEntry creationMetaDataEntry = (SessionCreationMetaDataEntry) entries.get(creationMetaDataKey); SessionAccessMetaData accessMetaData = (SessionAccessMetaData) entries.get(accessMetaDataKey); if ((creationMetaDataEntry != null) && (accessMetaData != null)) { return new CompositeSessionMetaDataEntry<>(creationMetaDataEntry, accessMetaData); } + // Any orphan entry should not be removed here - this would otherwise interfere with expiration listener return null; } @Override - public InvalidatableSessionMetaData createSessionMetaData(String id, CompositeSessionMetaDataEntry entry) { + public InvalidatableSessionMetaData createSessionMetaData(String id, CompositeSessionMetaDataEntry entry) { boolean newSession = entry.getCreationMetaData().isNew(); + boolean requireMutator = !this.properties.isTransactional() || !newSession; - SessionCreationMetaDataKey creationMetaDataKey = new SessionCreationMetaDataKey(id); - Mutator creationMutator = this.properties.isTransactional() && newSession ? Mutator.PASSIVE : this.creationMetaDataMutatorFactory.createMutator(creationMetaDataKey, new SessionCreationMetaDataEntry<>(entry.getCreationMetaData(), entry.getLocalContext())); - SessionCreationMetaData creationMetaData = new MutableSessionCreationMetaData(entry.getCreationMetaData(), creationMutator); + SessionCreationMetaData creationMetaData = entry.getCreationMetaData(); + if (requireMutator) { + SessionCreationMetaDataKey creationMetaDataKey = new SessionCreationMetaDataKey(id); + SessionCreationMetaDataEntry creationMetaDataEntry = new SessionCreationMetaDataEntry<>(creationMetaData, entry.getLocalContext()); + Mutator mutator = this.creationMetaDataMutatorFactory.createMutator(creationMetaDataKey, creationMetaDataEntry); + creationMetaData = new MutableSessionCreationMetaData(creationMetaData, mutator); + } - SessionAccessMetaDataKey accessMetaDataKey = new SessionAccessMetaDataKey(id); - Mutator accessMutator = this.properties.isTransactional() && newSession ? Mutator.PASSIVE : this.accessMetaDataMutatorFactory.createMutator(accessMetaDataKey, entry.getAccessMetaData()); - SessionAccessMetaData accessMetaData = new MutableSessionAccessMetaData(entry.getAccessMetaData(), accessMutator); + SessionAccessMetaData accessMetaData = entry.getAccessMetaData(); + if (requireMutator) { + SessionAccessMetaDataKey accessMetaDataKey = new SessionAccessMetaDataKey(id); + Mutator mutator = this.createSessionAccessMetaDataMutator(accessMetaDataKey, accessMetaData, creationMetaData); + accessMetaData = new MutableSessionAccessMetaData(entry.getAccessMetaData(), mutator); + } return new CompositeSessionMetaData(creationMetaData, accessMetaData); } @Override - public ImmutableSessionMetaData createImmutableSessionMetaData(String id, CompositeSessionMetaDataEntry entry) { + public ImmutableSessionMetaData createImmutableSessionMetaData(String id, CompositeSessionMetaDataEntry entry) { return new CompositeSessionMetaData(entry.getCreationMetaData(), entry.getAccessMetaData()); } @@ -126,4 +127,13 @@ public boolean remove(String id) { this.creationMetaDataCache.remove(new SessionCreationMetaDataKey(id)); return true; } -} + + private Mutator createSessionAccessMetaDataMutator(SessionAccessMetaDataKey key, SessionAccessMetaData value, SessionCreationMetaData creationMetaData) { + // Max-idle for expiration references session timeout from creation metadata entry + return new RemoteCacheEntryMutator<>(this.accessMetaDataCache, key, value, new Function<>() { + @Override + public Duration apply(SessionAccessMetaData accessMetaData) { + return creationMetaData.getTimeout(); + } + }); + }} diff --git a/clustering/web/infinispan/pom.xml b/clustering/web/infinispan/pom.xml index dcc4e0082927..9d5082e9b6d1 100644 --- a/clustering/web/infinispan/pom.xml +++ b/clustering/web/infinispan/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-web-infinispan diff --git a/clustering/web/pom.xml b/clustering/web/pom.xml index 9a8d16e290b5..5d4d66797981 100644 --- a/clustering/web/pom.xml +++ b/clustering/web/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-web diff --git a/clustering/web/service/pom.xml b/clustering/web/service/pom.xml index 597b273961b6..fe51728c3b72 100644 --- a/clustering/web/service/pom.xml +++ b/clustering/web/service/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-web-service diff --git a/clustering/web/spi/pom.xml b/clustering/web/spi/pom.xml index adb24ff585dc..fa2e643fa4c8 100644 --- a/clustering/web/spi/pom.xml +++ b/clustering/web/spi/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-web-spi diff --git a/clustering/web/undertow/pom.xml b/clustering/web/undertow/pom.xml index dcf46627b02f..132fbe0076ed 100644 --- a/clustering/web/undertow/pom.xml +++ b/clustering/web/undertow/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-web-undertow diff --git a/clustering/weld/core/pom.xml b/clustering/weld/core/pom.xml index 2a77b8850b79..e1f722da4cc8 100644 --- a/clustering/weld/core/pom.xml +++ b/clustering/weld/core/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-weld-core diff --git a/clustering/weld/ejb/pom.xml b/clustering/weld/ejb/pom.xml index f28d06e107de..a78edab9101e 100644 --- a/clustering/weld/ejb/pom.xml +++ b/clustering/weld/ejb/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-weld-ejb diff --git a/clustering/weld/pom.xml b/clustering/weld/pom.xml index 69ba5e40f75b..8098b5889a31 100644 --- a/clustering/weld/pom.xml +++ b/clustering/weld/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-weld diff --git a/clustering/weld/web/pom.xml b/clustering/weld/web/pom.xml index 76192d1537ce..816a988f2154 100644 --- a/clustering/weld/web/pom.xml +++ b/clustering/weld/web/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-clustering-weld-web diff --git a/connector/pom.xml b/connector/pom.xml index f3aa5ed09ed6..07816bb7945a 100644 --- a/connector/pom.xml +++ b/connector/pom.xml @@ -32,7 +32,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-connector WildFly: Connector Subsystem diff --git a/connector/src/main/java/org/jboss/as/connector/metadata/api/common/Credential.java b/connector/src/main/java/org/jboss/as/connector/metadata/api/common/Credential.java index fda01eb1f75f..d14e2dc9b841 100644 --- a/connector/src/main/java/org/jboss/as/connector/metadata/api/common/Credential.java +++ b/connector/src/main/java/org/jboss/as/connector/metadata/api/common/Credential.java @@ -18,6 +18,9 @@ import org.jboss.as.controller.security.CredentialReference; import org.jboss.jca.common.api.metadata.common.SecurityMetadata; +import java.util.HashMap; +import java.util.Map; + /** * Extension of {@link org.jboss.jca.common.api.metadata.common.Credential} with added Elytron support. * @@ -29,6 +32,85 @@ public interface Credential extends org.jboss.jca.common.api.metadata.common.Cre * A Tag. * */ + public enum Attribute + { + /** unknown attribute + * + */ + UNKNOWN(null), + /** + * userName attribute + */ + USER_NAME("user-name"), + /** + * password attribute + */ + PASSWORD("password"); + + private String name; + + /** + * + * Create a new Tag. + * + * @param name a name + */ + Attribute(final String name) { + this.name = name; + } + + /** + * Get the local name of this element. + * + * @return the local name + */ + public String getLocalName() { + return name; + } + + /** + * {@inheritDoc} + */ + public String toString() { + return name; + } + + private static final Map MAP; + + static { + final Map map = new HashMap<>(); + for (Credential.Attribute element : values()) { + final String name = element.getLocalName(); + if (name != null) + map.put(name, element); + } + MAP = map; + } + + /** + * Set the value + * @param v The name + * @return The value + */ + Credential.Attribute value(String v) { + name = v; + return this; + } + + /** + * + * Static method to get enum instance given localName XsdString + * + * @param localName a XsdString used as localname (typically tag name as defined in xsd) + * @return the enum instance + */ + public static Credential.Attribute forName(String localName) { + final Credential.Attribute element = MAP.get(localName); + return element == null ? UNKNOWN.value(localName) : element; + } + } + + enum Tag { // new Elytron tag @@ -55,10 +137,12 @@ enum Tag /** * userName tag */ + @Deprecated USER_NAME("user-name"), /** * password tag */ + @Deprecated PASSWORD("password"), /** diff --git a/connector/src/main/java/org/jboss/as/connector/subsystems/datasources/DataSourcesExtension.java b/connector/src/main/java/org/jboss/as/connector/subsystems/datasources/DataSourcesExtension.java index a6c51fc365f1..33ab49619cf5 100644 --- a/connector/src/main/java/org/jboss/as/connector/subsystems/datasources/DataSourcesExtension.java +++ b/connector/src/main/java/org/jboss/as/connector/subsystems/datasources/DataSourcesExtension.java @@ -203,6 +203,7 @@ public void initializeParsers(final ExtensionParsingContext context) { context.setSubsystemXmlMapping(SUBSYSTEM_NAME, Namespace.DATASOURCES_5_0.getUriString(), DataSourceSubsystemParser::new); context.setSubsystemXmlMapping(SUBSYSTEM_NAME, Namespace.DATASOURCES_6_0.getUriString(), DataSourceSubsystemParser::new); context.setSubsystemXmlMapping(SUBSYSTEM_NAME, Namespace.DATASOURCES_7_0.getUriString(), DataSourceSubsystemParser::new); + context.setSubsystemXmlMapping(SUBSYSTEM_NAME, Namespace.DATASOURCES_7_1.getUriString(), DataSourceSubsystemParser::new); } public static final class DataSourceSubsystemParser implements XMLStreamConstants, XMLElementReader>, @@ -404,8 +405,8 @@ private void writeDS(XMLExtendedStreamWriter writer, boolean isXADataSource, Mod REAUTHPLUGIN_PROPERTIES.isMarshallable(dataSourceNode); if (securityRequired) { writer.writeStartElement(DataSource.Tag.SECURITY.getLocalName()); - USERNAME.marshallAsElement(dataSourceNode, writer); - PASSWORD.marshallAsElement(dataSourceNode, writer); + USERNAME.marshallAsAttribute(dataSourceNode, writer); + PASSWORD.marshallAsAttribute(dataSourceNode, writer); SECURITY_DOMAIN.marshallAsElement(dataSourceNode, writer); CREDENTIAL_REFERENCE.marshallAsElement(dataSourceNode, writer); ELYTRON_ENABLED.marshallAsElement(dataSourceNode, writer); @@ -443,8 +444,8 @@ private void writeDS(XMLExtendedStreamWriter writer, boolean isXADataSource, Mod NO_RECOVERY.marshallAsAttribute(dataSourceNode, writer); if (hasAnyOf(dataSourceNode, RECOVERY_USERNAME, RECOVERY_PASSWORD, RECOVERY_SECURITY_DOMAIN, RECOVERY_ELYTRON_ENABLED, RECOVERY_CREDENTIAL_REFERENCE)) { writer.writeStartElement(Recovery.Tag.RECOVER_CREDENTIAL.getLocalName()); - RECOVERY_USERNAME.marshallAsElement(dataSourceNode, writer); - RECOVERY_PASSWORD.marshallAsElement(dataSourceNode, writer); + RECOVERY_USERNAME.marshallAsAttribute(dataSourceNode, writer); + RECOVERY_PASSWORD.marshallAsAttribute(dataSourceNode, writer); RECOVERY_ELYTRON_ENABLED.marshallAsElement(dataSourceNode, writer); RECOVERY_AUTHENTICATION_CONTEXT.marshallAsElement(dataSourceNode, writer); RECOVERY_SECURITY_DOMAIN.marshallAsElement(dataSourceNode, writer); diff --git a/connector/src/main/java/org/jboss/as/connector/subsystems/datasources/DataSourcesTransformers.java b/connector/src/main/java/org/jboss/as/connector/subsystems/datasources/DataSourcesTransformers.java index 3973b3aa799b..2506596572bf 100644 --- a/connector/src/main/java/org/jboss/as/connector/subsystems/datasources/DataSourcesTransformers.java +++ b/connector/src/main/java/org/jboss/as/connector/subsystems/datasources/DataSourcesTransformers.java @@ -40,6 +40,7 @@ public class DataSourcesTransformers implements ExtensionTransformerRegistration { + private static final ModelVersion VERSION_7_0_0 = ModelVersion.create(7, 0, 0); private static final ModelVersion EAP_7_4 = ModelVersion.create(6, 0, 0); @Override @@ -50,10 +51,14 @@ public String getSubsystemName() { @Override public void registerTransformers(SubsystemTransformerRegistration subsystemRegistration) { ChainedTransformationDescriptionBuilder chainedBuilder = TransformationDescriptionBuilder.Factory.createChainedSubystemInstance(subsystemRegistration.getCurrentSubsystemVersion()); - get600TransformationDescription(chainedBuilder.createBuilder(subsystemRegistration.getCurrentSubsystemVersion(), EAP_7_4)); + + //no transformation here - just XML parsing change + chainedBuilder.createBuilder(subsystemRegistration.getCurrentSubsystemVersion(), VERSION_7_0_0).build(); + + get600TransformationDescription(chainedBuilder.createBuilder(VERSION_7_0_0, EAP_7_4)); chainedBuilder.buildAndRegister(subsystemRegistration, new ModelVersion[]{ - EAP_7_4 + VERSION_7_0_0, EAP_7_4 }); } diff --git a/connector/src/main/java/org/jboss/as/connector/subsystems/datasources/DsParser.java b/connector/src/main/java/org/jboss/as/connector/subsystems/datasources/DsParser.java index 5a8f13237015..dae676b390fd 100644 --- a/connector/src/main/java/org/jboss/as/connector/subsystems/datasources/DsParser.java +++ b/connector/src/main/java/org/jboss/as/connector/subsystems/datasources/DsParser.java @@ -1510,9 +1510,12 @@ private void parseXADataSource_7_0(XMLExtendedStreamReader reader, final List= 0) { + parseElytronSupportedRecoveryCredential_7_1(reader, node); + } else { + parseElytronSupportedRecoveryCredential(reader, node); + } break; } case RECOVER_PLUGIN: { @@ -1322,6 +1326,20 @@ protected void parseElytronSupportedRecovery(XMLExtendedStreamReader reader, Mod private void parseSecuritySettings(XMLExtendedStreamReader reader, ModelNode node) throws XMLStreamException, ParserException, ValidateException { + for (Recovery.Attribute attribute : Recovery.Attribute.values()) { + switch (attribute) { + case NO_RECOVERY: { + String value = rawAttributeText(reader, NO_RECOVERY.getXmlName()); + if (value != null) { + NO_RECOVERY.parseAndSetParameter(value, node, reader); + } + break; + } + default: + break; + } + } + boolean securtyDomainMatched = false; while (reader.hasNext()) { switch (reader.nextTag()) { @@ -1440,7 +1458,6 @@ private void parseElytronSupportedSecuritySettings(XMLExtendedStreamReader reade private void parseRecoveryCredential(XMLExtendedStreamReader reader, ModelNode node) throws XMLStreamException, ParserException, ValidateException { - while (reader.hasNext()) { switch (reader.nextTag()) { case END_ELEMENT: { @@ -1485,6 +1502,76 @@ private void parseRecoveryCredential(XMLExtendedStreamReader reader, ModelNode n throw ParseUtils.unexpectedEndElement(reader); } + private void parseElytronSupportedRecoveryCredential_7_1(XMLExtendedStreamReader reader, ModelNode node) + throws XMLStreamException, ParserException, ValidateException { + + for (Credential.Attribute attribute : Credential.Attribute.values()) { + switch (attribute) { + case USER_NAME: { + String value = rawAttributeText(reader, RECOVERY_USERNAME.getXmlName()); + if (value != null) { + RECOVERY_USERNAME.parseAndSetParameter(value, node, reader); + } + break; + } + case PASSWORD: { + String value = rawAttributeText(reader, RECOVERY_PASSWORD.getXmlName()); + if (value != null) { + RECOVERY_PASSWORD.parseAndSetParameter(value, node, reader); + } + break; + } + default: + break; + } + } + + while (reader.hasNext()) { + switch (reader.nextTag()) { + case END_ELEMENT: { + if (DataSource.Tag.forName(reader.getLocalName()) == DataSource.Tag.SECURITY + || Recovery.Tag.forName(reader.getLocalName()) == Recovery.Tag.RECOVER_CREDENTIAL) { + + return; + } else { + if (Credential.Tag.forName(reader.getLocalName()) == Credential.Tag.UNKNOWN) { + throw ParseUtils.unexpectedEndElement(reader); + } + } + break; + } + case START_ELEMENT: { + switch (Credential.Tag.forName(reader.getLocalName())) { + case CREDENTIAL_REFERENCE: { + RECOVERY_CREDENTIAL_REFERENCE.getParser().parseElement(RECOVERY_CREDENTIAL_REFERENCE, reader, node); + break; + } + case SECURITY_DOMAIN: { + String value = rawElementText(reader); + RECOVERY_SECURITY_DOMAIN.parseAndSetParameter(value, node, reader); + break; + } + case ELYTRON_ENABLED: { + String value = rawElementText(reader); + value = value == null? "true": value; + RECOVERY_ELYTRON_ENABLED.parseAndSetParameter(value, node, reader); + break; + } + case AUTHENTICATION_CONTEXT: { + String value = rawElementText(reader); + RECOVERY_AUTHENTICATION_CONTEXT.parseAndSetParameter(value, node, reader); + break; + } + default: + throw ParseUtils.unexpectedElement(reader); + } + break; + } + } + } + throw ParseUtils.unexpectedEndElement(reader); + } + private void parseElytronSupportedRecoveryCredential(XMLExtendedStreamReader reader, ModelNode node) throws XMLStreamException, ParserException, ValidateException { diff --git a/connector/src/main/java/org/jboss/as/connector/subsystems/resourceadapters/Constants.java b/connector/src/main/java/org/jboss/as/connector/subsystems/resourceadapters/Constants.java index b5da64277c61..f9996b1d78a5 100644 --- a/connector/src/main/java/org/jboss/as/connector/subsystems/resourceadapters/Constants.java +++ b/connector/src/main/java/org/jboss/as/connector/subsystems/resourceadapters/Constants.java @@ -567,7 +567,7 @@ public void marshallAsElement(AttributeDefinition attribute, ModelNode resourceM .build(); static SimpleAttributeDefinition RECOVERY_USERNAME = new SimpleAttributeDefinitionBuilder(RECOVERY_USERNAME_NAME, ModelType.STRING, true) - .setXmlName(Credential.Tag.USER_NAME.getLocalName()) + .setXmlName(Credential.Attribute.USER_NAME.getLocalName()) .setDefaultValue(new ModelNode()) .setAllowExpression(true) .setMeasurementUnit(MeasurementUnit.NONE) @@ -577,7 +577,7 @@ public void marshallAsElement(AttributeDefinition attribute, ModelNode resourceM .build(); static SimpleAttributeDefinition RECOVERY_PASSWORD = new SimpleAttributeDefinitionBuilder(RECOVERY_PASSWORD_NAME, ModelType.STRING, true) - .setXmlName(Credential.Tag.PASSWORD.getLocalName()) + .setXmlName(Credential.Attribute.PASSWORD.getLocalName()) .setDefaultValue(new ModelNode()) .setAllowExpression(true) .setMeasurementUnit(MeasurementUnit.NONE) diff --git a/connector/src/main/java/org/jboss/as/connector/subsystems/resourceadapters/Namespace.java b/connector/src/main/java/org/jboss/as/connector/subsystems/resourceadapters/Namespace.java index 99cd796d6e70..810be6300ce2 100644 --- a/connector/src/main/java/org/jboss/as/connector/subsystems/resourceadapters/Namespace.java +++ b/connector/src/main/java/org/jboss/as/connector/subsystems/resourceadapters/Namespace.java @@ -49,12 +49,14 @@ public enum Namespace { RESOURCEADAPTERS_6_1("urn:jboss:domain:resource-adapters:6.1"), - RESOURCEADAPTERS_7_0("urn:jboss:domain:resource-adapters:7.0"); + RESOURCEADAPTERS_7_0("urn:jboss:domain:resource-adapters:7.0"), + + RESOURCEADAPTERS_7_1("urn:jboss:domain:resource-adapters:7.1"); /** * The current namespace version. */ - public static final Namespace CURRENT = RESOURCEADAPTERS_7_0; + public static final Namespace CURRENT = RESOURCEADAPTERS_7_1; private final String name; diff --git a/connector/src/main/java/org/jboss/as/connector/subsystems/resourceadapters/ResourceAdapterSubsystemParser.java b/connector/src/main/java/org/jboss/as/connector/subsystems/resourceadapters/ResourceAdapterSubsystemParser.java index 6c8e96fe2815..d90a230f83f9 100644 --- a/connector/src/main/java/org/jboss/as/connector/subsystems/resourceadapters/ResourceAdapterSubsystemParser.java +++ b/connector/src/main/java/org/jboss/as/connector/subsystems/resourceadapters/ResourceAdapterSubsystemParser.java @@ -438,8 +438,8 @@ private void writeConDef(XMLExtendedStreamWriter streamWriter, ModelNode conDef, || conDef.hasDefined(RECOVERY_SECURITY_DOMAIN.getName()) || conDef.hasDefined(RECOVERY_ELYTRON_ENABLED.getName())) { streamWriter.writeStartElement(Recovery.Tag.RECOVER_CREDENTIAL.getLocalName()); - RECOVERY_USERNAME.marshallAsElement(conDef, streamWriter); - RECOVERY_PASSWORD.marshallAsElement(conDef, streamWriter); + RECOVERY_USERNAME.marshallAsAttribute(conDef, streamWriter); + RECOVERY_PASSWORD.marshallAsAttribute(conDef, streamWriter); RECOVERY_CREDENTIAL_REFERENCE.marshallAsElement(conDef, streamWriter); RECOVERY_SECURITY_DOMAIN.marshallAsElement(conDef, streamWriter); RECOVERY_ELYTRON_ENABLED.marshallAsElement(conDef, streamWriter); diff --git a/connector/src/main/java/org/jboss/as/connector/subsystems/resourceadapters/ResourceAdaptersExtension.java b/connector/src/main/java/org/jboss/as/connector/subsystems/resourceadapters/ResourceAdaptersExtension.java index a94a14c6be4e..968040efa2dd 100644 --- a/connector/src/main/java/org/jboss/as/connector/subsystems/resourceadapters/ResourceAdaptersExtension.java +++ b/connector/src/main/java/org/jboss/as/connector/subsystems/resourceadapters/ResourceAdaptersExtension.java @@ -100,6 +100,7 @@ public void initializeParsers(final ExtensionParsingContext context) { context.setSubsystemXmlMapping(SUBSYSTEM_NAME, Namespace.RESOURCEADAPTERS_6_0.getUriString(), resourceAdapterSubsystemParser); context.setSubsystemXmlMapping(SUBSYSTEM_NAME, Namespace.RESOURCEADAPTERS_6_1.getUriString(), resourceAdapterSubsystemParser); context.setSubsystemXmlMapping(SUBSYSTEM_NAME, Namespace.RESOURCEADAPTERS_7_0.getUriString(), resourceAdapterSubsystemParser); + context.setSubsystemXmlMapping(SUBSYSTEM_NAME, Namespace.RESOURCEADAPTERS_7_1.getUriString(), resourceAdapterSubsystemParser); } } diff --git a/connector/src/main/java/org/jboss/as/connector/subsystems/resourceadapters/ResourceAdaptersSubSystemAdd.java b/connector/src/main/java/org/jboss/as/connector/subsystems/resourceadapters/ResourceAdaptersSubsystemAdd.java similarity index 100% rename from connector/src/main/java/org/jboss/as/connector/subsystems/resourceadapters/ResourceAdaptersSubSystemAdd.java rename to connector/src/main/java/org/jboss/as/connector/subsystems/resourceadapters/ResourceAdaptersSubsystemAdd.java diff --git a/connector/src/main/java/org/jboss/as/connector/subsystems/resourceadapters/ResourceAdaptersTransformers.java b/connector/src/main/java/org/jboss/as/connector/subsystems/resourceadapters/ResourceAdaptersTransformers.java index a715d5071cf3..26cfd8729d41 100644 --- a/connector/src/main/java/org/jboss/as/connector/subsystems/resourceadapters/ResourceAdaptersTransformers.java +++ b/connector/src/main/java/org/jboss/as/connector/subsystems/resourceadapters/ResourceAdaptersTransformers.java @@ -47,6 +47,8 @@ @MetaInfServices(ExtensionTransformerRegistration.class) public class ResourceAdaptersTransformers implements ExtensionTransformerRegistration { + private static final ModelVersion VERSION_7_0_0 = ModelVersion.create(7, 0, 0); + @Override public String getSubsystemName() { return ResourceAdaptersExtension.SUBSYSTEM_NAME; @@ -58,7 +60,9 @@ public void registerTransformers(SubsystemTransformerRegistration subsystemRegis ChainedTransformationDescriptionBuilder chainedBuilder = TransformationDescriptionBuilder.Factory.createChainedSubystemInstance(currentModel); - register700Transformers(chainedBuilder.createBuilder(currentModel, VERSION_6_1_0)); // 7.0.0 to 6.1.0 transformer + //no transformation here - just XML parsing change + chainedBuilder.createBuilder(subsystemRegistration.getCurrentSubsystemVersion(), VERSION_7_0_0).build(); + register700Transformers(chainedBuilder.createBuilder(VERSION_7_0_0, VERSION_6_1_0)); // 7.0.0 to 6.1.0 transformer register610Transformers(chainedBuilder.createBuilder(VERSION_6_1_0, VERSION_6_0_0)); // 6.1.0 to 6.0.0 transformer chainedBuilder.buildAndRegister(subsystemRegistration, new ModelVersion[] { VERSION_6_1_0, VERSION_6_0_0 }); diff --git a/connector/src/main/resources/schema/wildfly-datasources_5_0.xsd b/connector/src/main/resources/schema/wildfly-datasources_5_0.xsd index 7a4a445a36ef..0b80587a5421 100644 --- a/connector/src/main/resources/schema/wildfly-datasources_5_0.xsd +++ b/connector/src/main/resources/schema/wildfly-datasources_5_0.xsd @@ -898,24 +898,26 @@ - - - - + + + + sa-pass ]]> - - - - - - - - Credential to be used by the configuration. - - - + + + + + + + Credential to be used by the configuration. + + + + + diff --git a/connector/src/main/resources/schema/wildfly-datasources_6_0.xsd b/connector/src/main/resources/schema/wildfly-datasources_6_0.xsd index a65a92642cb3..f8e64cdf6b08 100644 --- a/connector/src/main/resources/schema/wildfly-datasources_6_0.xsd +++ b/connector/src/main/resources/schema/wildfly-datasources_6_0.xsd @@ -898,25 +898,27 @@ - - - - + + + + sa-pass ]]> - - - - - - - - Credential to be used by the configuration. - - - - + + + + + + + Credential to be used by the configuration. + + + + + + - - - - - - - + + + + + + sa ]]> - - - + + + + @@ -908,14 +909,15 @@ + + + + Credential to be used by the configuration. + + + + - - - - Credential to be used by the configuration. - - - diff --git a/connector/src/main/resources/schema/wildfly-datasources_7_1.xsd b/connector/src/main/resources/schema/wildfly-datasources_7_1.xsd new file mode 100644 index 000000000000..2ff6408b944d --- /dev/null +++ b/connector/src/main/resources/schema/wildfly-datasources_7_1.xsd @@ -0,0 +1,1138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + jdbc:hsqldb:hsql://localhost:1701 + ]]> + + + + + + + org.hsqldb.jdbcDriver + ]]> + + + + + + + org.h2.jdbcx.JdbcDataSource + ]]> + + + + + + + + + + + + + + UTF-8 + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 10 + myhost.mydomain.com + 1557 + mydb + myserver + ]]> + + + + + + + oracle.jdbc.xa.client.OracleXADataSource + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + ]]> + + + + + + + + ]]> + + + + + + + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + ]]> + + + + + + + 300 + ]]> + + + + + + + 300 + ]]> + + + + + + + + + + + + + + + + + + + + + 300 + ]]> + + + + + + + + + + + + + + + + + + nowarn + ]]> + + + + + + + + + + + + + + + ]]> + + + + + + + + + + + 1 + ]]> + + + + + + + 1 + ]]> + + + + + + + + + + + + + + true. + Default is false + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ]]> + + + + + + + + + + + + + true + ]]> + + + + + + + + ]]> + + + + + + + + Ex: + ]]> + + + + + + + true + ]]> + + + + + + + true + ]]> + + + + + + + + + + + + + + Credential to be used by the configuration. + + + + + + + HsqlDbRealm + ]]> + + + + + + + + + ]]> + + + + + + + + HsqlDbContext + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + org.hsqldb.jdbcDriver + ]]> + + + + + + + oracle.jdbc.xa.client.OracleXADataSource + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/connector/src/main/resources/schema/wildfly-resource-adapters_7_1.xsd b/connector/src/main/resources/schema/wildfly-resource-adapters_7_1.xsd new file mode 100644 index 000000000000..c8ff25516e66 --- /dev/null +++ b/connector/src/main/resources/schema/wildfly-resource-adapters_7_1.xsd @@ -0,0 +1,1137 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + myra.rar + ]]> + + + + + + + org.jboss.ironjacamar.ra16out + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 300 + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + ]]> + + + + + + + 1 + ]]> + + + + + + + + + + + + + + false. + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + ]]> + + + + + + + + ]]> + + + + + + + + Ex: + ]]> + + + + + + + true + ]]> + + + + + + + true + ]]> + + + + + + + + + + + + + + + + ]]> + + + + + + + HsqlDbRealm + ]]> + + + + + + + HsqlDbRealm + ]]> + + + + + + + + + ]]> + + + + + + + + + HsqlDbContext + ]]> + + + + + + + + HsqlDbContext + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Credential to be used by the configuration. + + + + + + + + HsqlDbRealm + ]]> + + + + + + + + + ]]> + + + + + + + + HsqlDbContext + ]]> + + + + + + + + + + sa + ]]> + + + + + + + sa-pass + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ApplicationDomain + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/connector/src/test/java/org/jboss/as/connector/subsystems/datasources/DatasourcesSubsystemTestCase.java b/connector/src/test/java/org/jboss/as/connector/subsystems/datasources/DatasourcesSubsystemTestCase.java index d20f4a3db9ee..03561765a276 100644 --- a/connector/src/test/java/org/jboss/as/connector/subsystems/datasources/DatasourcesSubsystemTestCase.java +++ b/connector/src/test/java/org/jboss/as/connector/subsystems/datasources/DatasourcesSubsystemTestCase.java @@ -67,7 +67,7 @@ protected String getSubsystemXml() throws IOException { @Override protected String getSubsystemXsdPath() throws Exception { - return "schema/wildfly-datasources_7_0.xsd"; + return "schema/wildfly-datasources_7_1.xsd"; } @Test diff --git a/connector/src/test/java/org/jboss/as/connector/subsystems/resourceadapters/ResourceAdaptersSubsystemTestCase.java b/connector/src/test/java/org/jboss/as/connector/subsystems/resourceadapters/ResourceAdaptersSubsystemTestCase.java index 375e178d3186..63e8ab60c7b1 100644 --- a/connector/src/test/java/org/jboss/as/connector/subsystems/resourceadapters/ResourceAdaptersSubsystemTestCase.java +++ b/connector/src/test/java/org/jboss/as/connector/subsystems/resourceadapters/ResourceAdaptersSubsystemTestCase.java @@ -52,7 +52,7 @@ protected String getSubsystemXml() throws IOException { @Override protected String getSubsystemXsdPath() throws Exception { - return "schema/wildfly-resource-adapters_7_0.xsd"; + return "schema/wildfly-resource-adapters_7_1.xsd"; } @Override @@ -91,6 +91,11 @@ public void testExpressionConfigElytron() throws Exception { standardSubsystemTest("resource-adapters-pool-elytron-enabled.xml", "resource-adapters-pool-elytron-enabled-expression.xml", true); } + @Test + public void testLegacyRecovery() throws Exception { + standardSubsystemTest("resource-adapters-legacy-recovery-parsing-7_0.xml", null, false); + } + protected AdditionalInitialization createAdditionalInitialization() { return AdditionalInitialization.MANAGEMENT diff --git a/connector/src/test/java/org/jboss/as/connector/subsystems/resourceadapters/ResourceAdaptersTransformersTestCase.java b/connector/src/test/java/org/jboss/as/connector/subsystems/resourceadapters/ResourceAdaptersTransformersTestCase.java index 365f37dd71f8..3266ad773c39 100644 --- a/connector/src/test/java/org/jboss/as/connector/subsystems/resourceadapters/ResourceAdaptersTransformersTestCase.java +++ b/connector/src/test/java/org/jboss/as/connector/subsystems/resourceadapters/ResourceAdaptersTransformersTestCase.java @@ -62,12 +62,12 @@ public ResourceAdaptersTransformersTestCase() { @Override protected String getSubsystemXml() throws IOException { - return readResource("resource-adapters-transform_7_0.xml"); + return readResource("resource-adapters-transform_7_1.xml"); } @Override protected String getSubsystemXsdPath() { - return "schema/wildfly-resource-adapters_7_0.xsd"; + return "schema/wildfly-resource-adapters_7_1.xsd"; } /** @@ -103,7 +103,7 @@ public void test740transformers() throws Exception { * @throws Exception if an error occurs during the kernel initialization or the subsystem transformation validation. */ private void testTransformer(final ModelTestControllerVersion controllerVersion) throws Exception { - String subsystemXml = "resource-adapters-transform_7_0.xml"; + String subsystemXml = "resource-adapters-transform_7_1.xml"; ModelVersion modelVersion = getResourceAdapterModel(controllerVersion); KernelServicesBuilder builder = createKernelServicesBuilder(createAdditionalInitialization()).setSubsystemXmlResource(subsystemXml); KernelServices mainServices = initialKernelServices(builder, controllerVersion); diff --git a/connector/src/test/resources/org/jboss/as/connector/subsystems/complextestcases/ra.xml b/connector/src/test/resources/org/jboss/as/connector/subsystems/complextestcases/ra.xml index 22d6025a2611..f1825d5d10aa 100644 --- a/connector/src/test/resources/org/jboss/as/connector/subsystems/complextestcases/ra.xml +++ b/connector/src/test/resources/org/jboss/as/connector/subsystems/complextestcases/ra.xml @@ -1,4 +1,4 @@ - + some.rar @@ -45,14 +45,12 @@ 5000 true - - - sa - sa-pass + + HsqlDbRealm - - - C + + + C diff --git a/connector/src/test/resources/org/jboss/as/connector/subsystems/datasources/datasources-elytron-enabled-expression.xml b/connector/src/test/resources/org/jboss/as/connector/subsystems/datasources/datasources-elytron-enabled-expression.xml index 99e9da5d409e..fb7aa2ee21cc 100644 --- a/connector/src/test/resources/org/jboss/as/connector/subsystems/datasources/datasources-elytron-enabled-expression.xml +++ b/connector/src/test/resources/org/jboss/as/connector/subsystems/datasources/datasources-elytron-enabled-expression.xml @@ -1,4 +1,4 @@ - + @@ -178,9 +178,7 @@ ${test.expr:false} - - ${test.expr:token} - ${test.expr:token} + ${test.expr:true} diff --git a/connector/src/test/resources/org/jboss/as/connector/subsystems/datasources/datasources-elytron-enabled.xml b/connector/src/test/resources/org/jboss/as/connector/subsystems/datasources/datasources-elytron-enabled.xml index aad619a67ca9..6278430afe0f 100644 --- a/connector/src/test/resources/org/jboss/as/connector/subsystems/datasources/datasources-elytron-enabled.xml +++ b/connector/src/test/resources/org/jboss/as/connector/subsystems/datasources/datasources-elytron-enabled.xml @@ -1,4 +1,4 @@ - + @@ -179,9 +179,7 @@ false - - token - token + true diff --git a/connector/src/test/resources/org/jboss/as/connector/subsystems/datasources/datasources-full-expression.xml b/connector/src/test/resources/org/jboss/as/connector/subsystems/datasources/datasources-full-expression.xml index ddf2af075a42..e68c97e73ed4 100644 --- a/connector/src/test/resources/org/jboss/as/connector/subsystems/datasources/datasources-full-expression.xml +++ b/connector/src/test/resources/org/jboss/as/connector/subsystems/datasources/datasources-full-expression.xml @@ -1,4 +1,4 @@ - + - - - ${test.expr:sa} - - - ${test.expr:sa} - + ${test.expr:Property1} @@ -162,26 +156,13 @@ - - - ${test.expr:sa} - - - ${test.expr:sa} - + ${test.expr:Property1} - - - ${test.expr:sa} - - - ${test.expr:sa} - - + Property5 ${test.expr:Property6} diff --git a/connector/src/test/resources/org/jboss/as/connector/subsystems/datasources/datasources-full.xml b/connector/src/test/resources/org/jboss/as/connector/subsystems/datasources/datasources-full.xml index 4396fce562dc..7917dc9ee592 100644 --- a/connector/src/test/resources/org/jboss/as/connector/subsystems/datasources/datasources-full.xml +++ b/connector/src/test/resources/org/jboss/as/connector/subsystems/datasources/datasources-full.xml @@ -1,4 +1,4 @@ - + @@ -46,13 +46,7 @@ - - - sa - - - sa - + Property1 @@ -160,26 +154,13 @@ - - - sa - - - sa - + Property1 - - - sa - - - sa - - + Property5 Property6 diff --git a/connector/src/test/resources/org/jboss/as/connector/subsystems/datasources/datasources-minimal.xml b/connector/src/test/resources/org/jboss/as/connector/subsystems/datasources/datasources-minimal.xml index 712b9fa2f27d..de4a4f85d4fd 100644 --- a/connector/src/test/resources/org/jboss/as/connector/subsystems/datasources/datasources-minimal.xml +++ b/connector/src/test/resources/org/jboss/as/connector/subsystems/datasources/datasources-minimal.xml @@ -1,13 +1,10 @@ - + jdbc:h2:mem:test;DB_CLOSE_DELAY=-1 h2 - - sa - sa - + diff --git a/connector/src/test/resources/org/jboss/as/connector/subsystems/resourceadapters/resource-adapters-full.xml b/connector/src/test/resources/org/jboss/as/connector/subsystems/resourceadapters/resource-adapters-full.xml index 71a583db22ad..5199aa64f6b3 100644 --- a/connector/src/test/resources/org/jboss/as/connector/subsystems/resourceadapters/resource-adapters-full.xml +++ b/connector/src/test/resources/org/jboss/as/connector/subsystems/resourceadapters/resource-adapters-full.xml @@ -1,4 +1,4 @@ - + archive @@ -51,9 +51,7 @@ false - - userName - pwd + token @@ -105,10 +103,7 @@ false - - userName - pwd - + value diff --git a/connector/src/test/resources/org/jboss/as/connector/subsystems/resourceadapters/resource-adapters-legacy-recovery-parsing-7_0.xml b/connector/src/test/resources/org/jboss/as/connector/subsystems/resourceadapters/resource-adapters-legacy-recovery-parsing-7_0.xml new file mode 100644 index 000000000000..b8295c6efb07 --- /dev/null +++ b/connector/src/test/resources/org/jboss/as/connector/subsystems/resourceadapters/resource-adapters-legacy-recovery-parsing-7_0.xml @@ -0,0 +1,17 @@ + + + + archive.rar + + + + + userName + pwd + + + + + + + diff --git a/connector/src/test/resources/org/jboss/as/connector/subsystems/resourceadapters/resource-adapters-pool-elytron-enabled-expression.xml b/connector/src/test/resources/org/jboss/as/connector/subsystems/resourceadapters/resource-adapters-pool-elytron-enabled-expression.xml index e204b28a9f93..1ba3403b9ab4 100644 --- a/connector/src/test/resources/org/jboss/as/connector/subsystems/resourceadapters/resource-adapters-pool-elytron-enabled-expression.xml +++ b/connector/src/test/resources/org/jboss/as/connector/subsystems/resourceadapters/resource-adapters-pool-elytron-enabled-expression.xml @@ -1,4 +1,4 @@ - + @@ -77,9 +77,7 @@ - - - ${test.expr:userName} + diff --git a/connector/src/test/resources/org/jboss/as/connector/subsystems/resourceadapters/resource-adapters-pool-elytron-enabled.xml b/connector/src/test/resources/org/jboss/as/connector/subsystems/resourceadapters/resource-adapters-pool-elytron-enabled.xml index 8155063a666f..3f8b9654999d 100644 --- a/connector/src/test/resources/org/jboss/as/connector/subsystems/resourceadapters/resource-adapters-pool-elytron-enabled.xml +++ b/connector/src/test/resources/org/jboss/as/connector/subsystems/resourceadapters/resource-adapters-pool-elytron-enabled.xml @@ -1,4 +1,4 @@ - + @@ -77,9 +77,7 @@ - - - userName + diff --git a/connector/src/test/resources/org/jboss/as/connector/subsystems/resourceadapters/resource-adapters-pool-expression.xml b/connector/src/test/resources/org/jboss/as/connector/subsystems/resourceadapters/resource-adapters-pool-expression.xml index b746c0db5e47..80cda446335e 100644 --- a/connector/src/test/resources/org/jboss/as/connector/subsystems/resourceadapters/resource-adapters-pool-expression.xml +++ b/connector/src/test/resources/org/jboss/as/connector/subsystems/resourceadapters/resource-adapters-pool-expression.xml @@ -1,4 +1,4 @@ - + @@ -83,11 +83,7 @@ - - - ${test.expr:userName} - - ${test.expr:pwd} + ${test.expr:token} diff --git a/connector/src/test/resources/org/jboss/as/connector/subsystems/resourceadapters/resource-adapters-pool.xml b/connector/src/test/resources/org/jboss/as/connector/subsystems/resourceadapters/resource-adapters-pool.xml index 057122d81815..2cc10b5f57d3 100644 --- a/connector/src/test/resources/org/jboss/as/connector/subsystems/resourceadapters/resource-adapters-pool.xml +++ b/connector/src/test/resources/org/jboss/as/connector/subsystems/resourceadapters/resource-adapters-pool.xml @@ -1,4 +1,4 @@ - + @@ -84,11 +84,7 @@ - - - userName - - pwd + token diff --git a/connector/src/test/resources/org/jboss/as/connector/subsystems/resourceadapters/resource-adapters-transform_7_0.xml b/connector/src/test/resources/org/jboss/as/connector/subsystems/resourceadapters/resource-adapters-transform_7_1.xml similarity index 94% rename from connector/src/test/resources/org/jboss/as/connector/subsystems/resourceadapters/resource-adapters-transform_7_0.xml rename to connector/src/test/resources/org/jboss/as/connector/subsystems/resourceadapters/resource-adapters-transform_7_1.xml index 77d857ed6294..ef9eca07ccb7 100644 --- a/connector/src/test/resources/org/jboss/as/connector/subsystems/resourceadapters/resource-adapters-transform_7_0.xml +++ b/connector/src/test/resources/org/jboss/as/connector/subsystems/resourceadapters/resource-adapters-transform_7_1.xml @@ -1,4 +1,4 @@ - + @@ -84,11 +84,7 @@ - - - ${test.expr:userName} - - ${test.expr:pwd} + ${test.expr:token} diff --git a/connector/src/test/resources/org/jboss/as/connector/subsystems/resourceadapters/resource-adapters-xapool-expression.xml b/connector/src/test/resources/org/jboss/as/connector/subsystems/resourceadapters/resource-adapters-xapool-expression.xml index 47d01af93937..b501f3426963 100644 --- a/connector/src/test/resources/org/jboss/as/connector/subsystems/resourceadapters/resource-adapters-xapool-expression.xml +++ b/connector/src/test/resources/org/jboss/as/connector/subsystems/resourceadapters/resource-adapters-xapool-expression.xml @@ -1,4 +1,4 @@ - + @@ -74,12 +74,7 @@ - - - ${test.expr:userName} - - ${test.expr:pwd} - + ${test.expr:value} diff --git a/connector/src/test/resources/org/jboss/as/connector/subsystems/resourceadapters/resource-adapters-xapool.xml b/connector/src/test/resources/org/jboss/as/connector/subsystems/resourceadapters/resource-adapters-xapool.xml index 9b16dcce3d73..fc072e8f324b 100644 --- a/connector/src/test/resources/org/jboss/as/connector/subsystems/resourceadapters/resource-adapters-xapool.xml +++ b/connector/src/test/resources/org/jboss/as/connector/subsystems/resourceadapters/resource-adapters-xapool.xml @@ -1,4 +1,4 @@ - + @@ -74,11 +74,8 @@ - + - userName - - pwd diff --git a/datasources-agroal/pom.xml b/datasources-agroal/pom.xml index 3672f2ace7b1..0fe8d9699fd9 100644 --- a/datasources-agroal/pom.xml +++ b/datasources-agroal/pom.xml @@ -28,7 +28,7 @@ org.wildfly wildfly-parent - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT ../pom.xml diff --git a/dist/pom.xml b/dist/pom.xml index 3e9457ff2d84..b88d7d93803b 100644 --- a/dist/pom.xml +++ b/dist/pom.xml @@ -34,7 +34,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-dist @@ -51,9 +51,9 @@ import - ${project.groupId} + ${ee.maven.groupId} wildfly-standard-test-bom - ${project.version} + ${ee.maven.version} pom import diff --git a/docs/pom.xml b/docs/pom.xml index 3af8d0555efa..58cfa14ce94e 100644 --- a/docs/pom.xml +++ b/docs/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT ../pom.xml diff --git a/docs/src/main/asciidoc/Bootable_Guide.adoc b/docs/src/main/asciidoc/Bootable_Guide.adoc index 52098a24fefa..8871bfc7cbf3 100644 --- a/docs/src/main/asciidoc/Bootable_Guide.adoc +++ b/docs/src/main/asciidoc/Bootable_Guide.adoc @@ -11,7 +11,6 @@ WildFly team; :source-highlighter: coderay ifdef::env-github[] -:imagesdir: images/ :tip-caption: :bulb: :note-caption: :information_source: :important-caption: :heavy_exclamation_mark: diff --git a/docs/src/main/asciidoc/Cloud_References.adoc b/docs/src/main/asciidoc/Cloud_References.adoc index 382b4011bbc2..0f076d887397 100644 --- a/docs/src/main/asciidoc/Cloud_References.adoc +++ b/docs/src/main/asciidoc/Cloud_References.adoc @@ -1,19 +1,19 @@ -# References +== References -## Helm +=== Helm * https://helm.sh/[Official page] * https://helm.sh/docs/intro/install/[Installing Helm] * https://github.com/wildfly/wildfly-charts/blob/main/charts/wildfly/README.md[Helm Chart for WildFly] ** https://www.wildfly.org/news/2021/05/05/helm-charts-for-wildfly/[Related blog post] * https://docs.wildfly.org/wildfly-charts/[Helm Charts for WildFly] -## OpenShift +=== OpenShift * https://access.redhat.com/downloads/content/290/[Download OpenShift] * https://developers.redhat.com/products/openshift-local/overview[Red Hat OpenShift Local] * https://www.redhat.com/en/technologies/cloud-computing/openshift/try-it[Try Red Hat OpenShift] * https://docs.okd.io/latest/cli_reference/openshift_cli/getting-started-cli.html#cli-installing-cli_cli-developer-commands[Getting started with the OpenShift CLI] -## WildFly +=== WildFly * https://docs.wildfly.org/wildfly-maven-plugin/[WildFly Maven Plugin (wildfly-maven-plugin)] * https://github.com/wildfly-extras/wildfly-jar-maven-plugin[Bootable Jar GitHub repository] * https://docs.wildfly.org/bootablejar/[Bootable Jar Documentation] diff --git a/docs/src/main/asciidoc/Getting_Started_Developing_Applications_Guide.adoc b/docs/src/main/asciidoc/Getting_Started_Developing_Applications_Guide.adoc index 63bd7645e995..fc9bafa4fcb4 100644 --- a/docs/src/main/asciidoc/Getting_Started_Developing_Applications_Guide.adoc +++ b/docs/src/main/asciidoc/Getting_Started_Developing_Applications_Guide.adoc @@ -64,7 +64,6 @@ and using the web management interface. :leveloffset: +1 -include::_extras/Developing_Jakarta_Server_Faces_Project_Using_Maven_and_IntelliJ.adoc[] +include::_extras/Developing_Jakarta_Faces_Project_Using_Maven_and_IntelliJ.adoc[] include::_extras/Getting_Started_Developing_Applications_Presentation_Demo.adoc[] - diff --git a/docs/src/main/asciidoc/Getting_Started_Guide.adoc b/docs/src/main/asciidoc/Getting_Started_Guide.adoc index 440229654581..f40b9a3cfa9f 100644 --- a/docs/src/main/asciidoc/Getting_Started_Guide.adoc +++ b/docs/src/main/asciidoc/Getting_Started_Guide.adoc @@ -11,7 +11,6 @@ WildFly team; :source-highlighter: coderay ifdef::env-github[] -:imagesdir: images/ :tip-caption: :bulb: :note-caption: :information_source: :important-caption: :heavy_exclamation_mark: @@ -86,7 +85,7 @@ Profile |WildFly {wildflyVersion} Full Configuration |WildFly {wildflyVersion} D |Jakarta Security 3.0 |X |X |X |X -|Jakarta Server Faces 4.0 |X |X |X |X +|Jakarta Faces 4.0 |X |X |X |X |Jakarta Server Pages 3.1 |X |X |X |X @@ -444,7 +443,7 @@ As with previous WildFly releases, you can point your browser to *_http://localhost:8080_* (if using the default configured http port) which brings you to the Welcome Screen: -image:wildfly.png[images/wildfly.png] +image:images/wildfly.png[wildfly.png] From here you can access links to the WildFly community documentation set, stay up-to-date on the latest project information, have a diff --git a/docs/src/main/asciidoc/Getting_Started_on_OpenShift.adoc b/docs/src/main/asciidoc/Getting_Started_on_OpenShift.adoc index 84ba8b2fbeb9..b706752f8420 100644 --- a/docs/src/main/asciidoc/Getting_Started_on_OpenShift.adoc +++ b/docs/src/main/asciidoc/Getting_Started_on_OpenShift.adoc @@ -2,18 +2,18 @@ This guide is designed to assist you through obtaining an OpenShift instance and installing WildFly, complete with a deployed application. It is not intended to cover all possible configurations, as links to more detailed documentation will be provided. -=== Obtaining an OpenShift Instance +== Obtaining an OpenShift Instance There are many https://www.redhat.com/en/technologies/cloud-computing/openshift/try-it[options] available for running OpenShift. This guide will mention two. -===== Code-ready-containers +=== Code-ready-containers If you wish to run a local development environment, then https://developers.redhat.com/products/openshift-local/overview[CRC] is likely to be a good starting point. -===== Developer sandbox +=== Developer sandbox The Red Hat OpenShift https://developers.redhat.com/developer-sandbox[Developer Sandbox] is a hosted environment, and is free to use for development purposes. This guide will focus on usage of the hosted developer sandbox environment. The sandbox should be provisioned from the page above before proceeding further. -=== OpenShift +== OpenShift In order to use OpenShift effectively, in addition to a running instance, you will need the OpenShift `web console`. To access this tool, from your OpenShift sandbox click the terminal icon (i.e. `>_`) at the top right of your sandbox portal. A terminal tab will pop up at the bottom of the page. It is also possible to use the OpenShift command line terminal locally (`oc` command). This may be obtained from your package manager or downloaded from your OpenShift sandbox (in your control panel, clicking on the question mark icon at the top right of the console presents a drop-down menu where `Command line tools` takes you to the latest version of `oc`). @@ -35,10 +35,10 @@ In the OpenShift sandbox, it is not possible to create a new project but, in cas ``` oc new-project ``` -=== Helm Charts +== Helm Charts https://helm.sh/[Helm] provides an easy way to manage and share applications on Kubernetes and OpenShift. We will use it to deploy our example applications to OpenShift. -===== Install Helm and Helm Charts +=== Install Helm and Helm Charts See the instructions for installing Helm https://helm.sh/docs/intro/install/[here]. Helm is installed on your local system as a command, which we will use to install the WildFly Charts. Once Helm is installed, we can proceed to use it to install the Helm Charts in our OpenShift instance: ``` helm repo add wildfly https://docs.wildfly.org/wildfly-charts/ @@ -154,4 +154,5 @@ If you wish to remove the application when you are done with it, simply run: ``` helm uninstall jaxrs-client-from-chart ``` -== link:Cloud_References{outfilesuffix}[References] + +include::Cloud_References.adoc[] diff --git a/docs/src/main/asciidoc/Quickstarts.adoc b/docs/src/main/asciidoc/Quickstarts.adoc index 43ec3eaf5f63..881d0cfdf6ea 100644 --- a/docs/src/main/asciidoc/Quickstarts.adoc +++ b/docs/src/main/asciidoc/Quickstarts.adoc @@ -11,7 +11,6 @@ WildFly team; :source-highlighter: coderay ifdef::env-github[] -:imagesdir: images/ :tip-caption: :bulb: :note-caption: :information_source: :important-caption: :heavy_exclamation_mark: diff --git a/docs/src/main/asciidoc/WildFly_and_WildFly_Preview.adoc b/docs/src/main/asciidoc/WildFly_and_WildFly_Preview.adoc index 5ddd975b4f26..6aa5e36327aa 100644 --- a/docs/src/main/asciidoc/WildFly_and_WildFly_Preview.adoc +++ b/docs/src/main/asciidoc/WildFly_and_WildFly_Preview.adoc @@ -11,7 +11,6 @@ WildFly team; :source-highlighter: coderay ifdef::env-github[] -:imagesdir: images/ :tip-caption: :bulb: :note-caption: :information_source: :important-caption: :heavy_exclamation_mark: diff --git a/docs/src/main/asciidoc/_admin-guide/Default_HTTP_Interface_Security.adoc b/docs/src/main/asciidoc/_admin-guide/Default_HTTP_Interface_Security.adoc index 8c96f9390e92..3e6dab4697b1 100644 --- a/docs/src/main/asciidoc/_admin-guide/Default_HTTP_Interface_Security.adoc +++ b/docs/src/main/asciidoc/_admin-guide/Default_HTTP_Interface_Security.adoc @@ -2,7 +2,7 @@ = Default HTTP Interface Security ifdef::env-github[] -:imagesdir: ../images/ +:imagesdir: ../ :tip-caption: :bulb: :note-caption: :information_source: :important-caption: :heavy_exclamation_mark: @@ -24,7 +24,7 @@ default user in the distribution. If you attempt to connect to the admin console before you have added a user to the server you will be presented with the following screen. -image:no-users.png[images/no-users.png] +image:images/no-users.png[alt=no-users.png] //// The user are stored in a properties file called mgmt-users.properties @@ -43,7 +43,7 @@ the same password. To manipulate the files and add users we provide a utility add-user.sh and add-user.bat to add the users and generate the hashes, to add a user you should execute the script and follow the guided process. -image:add-user.png[images/add-user.png] + +image:images/add-user.png[alt=add-user.png] + The full details of the add-user utility are described later but for the purpose of accessing the management interface you need to enter the following values: - diff --git a/docs/src/main/asciidoc/_admin-guide/Operating_modes.adoc b/docs/src/main/asciidoc/_admin-guide/Operating_modes.adoc index 46a1a375a7af..9728d22f9789 100644 --- a/docs/src/main/asciidoc/_admin-guide/Operating_modes.adoc +++ b/docs/src/main/asciidoc/_admin-guide/Operating_modes.adoc @@ -2,7 +2,7 @@ = Operating mode ifdef::env-github[] -:imagesdir: ../images/ +:imagesdir: ../ :tip-caption: :bulb: :note-caption: :information_source: :important-caption: :heavy_exclamation_mark: @@ -58,7 +58,7 @@ Controller. See <> for details. The following is an example managed domain topology: -image:DC-HC-Server.png[images/DC-HC-Server.png] +image::images/DC-HC-Server.png[alt=DC-HC-Server.png] [[host]] === Host diff --git a/docs/src/main/asciidoc/_admin-guide/RBAC.adoc b/docs/src/main/asciidoc/_admin-guide/RBAC.adoc index ec87bb1b27d4..c4367e74d2e5 100644 --- a/docs/src/main/asciidoc/_admin-guide/RBAC.adoc +++ b/docs/src/main/asciidoc/_admin-guide/RBAC.adoc @@ -2,7 +2,7 @@ = Authorizing management actions with Role Based Access Control ifdef::env-github[] -:imagesdir: ../images/ +:imagesdir: ../ :tip-caption: :bulb: :note-caption: :information_source: :important-caption: :heavy_exclamation_mark: @@ -261,7 +261,7 @@ admin console. Navigate to the "Administration" tab and the "Users" subtab. From there individual user mappings can be added, removed, or edited. -image:usermapping.png[images/usermapping.png,width=450] +image:images/usermapping.png[alt=usermapping.png,width=450] The CLI can also be used to map individuals users to roles. @@ -328,7 +328,7 @@ console. Navigate to the "Administration" tab and the "Groups" subtab. From there group mappings can be added, removed, or edited. -image:groupmapping.png[images/groupmapping.png,width=450] +image:images/groupmapping.png[alt=groupmapping.png,width=450] The CLI can also be used to map groups to roles. The only difference to individual user mapping is the value of the `type` attribute should be @@ -365,7 +365,7 @@ In the web based admin console, navigate to the "Administration" tab, "Roles" subtab, highlight the relevant role, click the "Edit" button and click on the "Include All" checkbox: -image:includeall.png[images/includeall.png,width=450] +image:images/includeall.png[alt=includeall.png,width=450] The same change can be made using the CLI: @@ -392,7 +392,7 @@ where the `include-all` attribute is set to true for a role. In the admin console, excludes are done in the same screens as includes. In the add dialog, simply change the "Type" pulldown to "Exclude". -image:excludemapping.png[images/excludemapping.png,width=450] +image:images/excludemapping.png[alt=excludemapping.png,width=450] In the CLI, excludes are identical to includes, except the resource address has `exclude` instead of `include` as the key for the last @@ -559,14 +559,14 @@ Both server-group and host scoped roles can be added, removed or edited via the admin console. Select "Scoped Roles" from the "Administration" tab, "Roles" subtab: -image:scopedroles.png[images/scopedroles.png,width=450] +image:images/scopedroles.png[alt=scopedroles.png,width=450] When adding a new scoped role, use the dialogue's "Type" pull down to choose between a host scoped role and a server-group scoped role. Then place the names of the relevant hosts or server groups in the "Scope" text are. -image:addscopedrole.png[images/addscopedrole.png,width=450] +image:images/addscopedrole.png[alt=addscopedrole.png,width=450] [[configuring-constraints]] == Configuring constraints @@ -1142,7 +1142,7 @@ Users can learn in which roles they are operating. In the admin console, click on your name in the top right corner; the roles you are in will be shown. -image:callersroles.png[images/callersroles.png,width=450] +image:images/callersroles.png[alt=callersroles.png,width=450] CLI users should use the `whoami` operation with the `verbose` attribute set: @@ -1222,11 +1222,11 @@ Admin console users can change the role in which they operate by clicking on their name in the top right corner and clicking on the "Run as..." link. -image:callersroles.png[images/callersroles.png,width=450] +image:images/callersroles.png[alt=callersroles.png,width=450] Then select the role in which you wish to operate: -image:runasrole.png[images/runasrole.png,width=450] +image:images/runasrole.png[alt=runasrole.png,width=450] The console will need to be restarted in order for the change to take effect. diff --git a/docs/src/main/asciidoc/_admin-guide/Subsystem_configuration.adoc b/docs/src/main/asciidoc/_admin-guide/Subsystem_configuration.adoc index 1507d3e93771..78b2b70c42d5 100644 --- a/docs/src/main/asciidoc/_admin-guide/Subsystem_configuration.adoc +++ b/docs/src/main/asciidoc/_admin-guide/Subsystem_configuration.adoc @@ -78,6 +78,8 @@ include::subsystem-configuration/Resource_adapters.adoc[] include::subsystem-configuration/Jakarta_Batch.adoc[] +include::subsystem-configuration/Jakarta_Faces.adoc[] + include::subsystem-configuration/JMX.adoc[] include::subsystem-configuration/Deployment_Scanner.adoc[] diff --git a/docs/src/main/asciidoc/_admin-guide/add-user-utility.adoc b/docs/src/main/asciidoc/_admin-guide/add-user-utility.adoc index a67579116380..33e2995c7798 100644 --- a/docs/src/main/asciidoc/_admin-guide/add-user-utility.adoc +++ b/docs/src/main/asciidoc/_admin-guide/add-user-utility.adoc @@ -2,7 +2,7 @@ = add-user utility ifdef::env-github[] -:imagesdir: ../images/ +:imagesdir: ../ :tip-caption: :bulb: :note-caption: :information_source: :important-caption: :heavy_exclamation_mark: @@ -58,7 +58,7 @@ unless you have switched to a different realm. [[interactive-mode]] ==== Interactive Mode -image:add-mgmt-user-interactive.png[images/add-mgmt-user-interactive.png] +image:images/add-mgmt-user-interactive.png[alt=add-mgmt-user-interactive.png] Here we have added a new Management User called `adminUser`, as you can see some of the questions offer default responses so you can just press @@ -74,7 +74,7 @@ management chapter. To add a user in non-interactive mode the command `./add-user.sh {username} {password`} can be used. -image:add-mgmt-user-non-interactive.png[images/add-mgmt-user-non-interactive.png] +image:images/add-mgmt-user-non-interactive.png[alt=add-mgmt-user-non-interactive.png] [WARNING] @@ -94,7 +94,7 @@ user. [[interactive-mode-1]] ==== Interactive Mode -image:add-app-user-interactive.png[images/add-app-user-interactive.png] +image:images/add-app-user-interactive.png[alt=add-app-user-interactive.png] Here a new user called `appUser` has been added, in this case a comma separated list of roles has also been specified. @@ -109,7 +109,7 @@ a connection from one server to another. To add an application user non-interactively use the command `./add-user.sh -a {username} {password`}. -image:add-app-user-non-interactive.png[images/add-app-user-non-interactive.png] +image:images/add-app-user-non-interactive.png[alt=add-app-user-non-interactive.png] [NOTE] @@ -130,7 +130,7 @@ your intention. [[interactive-mode-2]] ==== Interactive Mode -image:update-mgmt-user-interactive.png[images/update-mgmt-user-interactive.png] +image:images/update-mgmt-user-interactive.png[alt=update-mgmt-user-interactive.png] [[non-interactive-mode-2]] ==== Non-Interactive Mode @@ -143,7 +143,7 @@ with no confirmation prompt. ==== Interactive Mode -image:update-app-user-interactive.png[images/update-app-user-interactive.png] +image:images/update-app-user-interactive.png[alt=update-app-user-interactive.png] [NOTE] diff --git a/docs/src/main/asciidoc/_admin-guide/subsystem-configuration/Jakarta_Faces.adoc b/docs/src/main/asciidoc/_admin-guide/subsystem-configuration/Jakarta_Faces.adoc new file mode 100644 index 000000000000..6b3f77c26d25 --- /dev/null +++ b/docs/src/main/asciidoc/_admin-guide/subsystem-configuration/Jakarta_Faces.adoc @@ -0,0 +1,120 @@ +:module-url: https://raw.githubusercontent.com/wildfly/wildfly/main/jsf/multi-jsf-installer/src/main/resources + +[[Jakarta_Faces]] += Jakarta Faces Configuration + +Jakarta Faces configuration is handled by the `jsf` subsystem. The `jsf` subsystem +allows multiple Jakarta Faces implementations to be installed on the same WildFly server. In particular, any +version that implements spec level 4.0 or higher can be installed. For each Jakarta Faces +implementation, a new slot needs to be created under `jakarta.faces.impl`, `jakarta.faces.api`, and +`org.jboss.as.jsf-injection`. When the `jsf` subsystem starts up, it scans the module path to find all +the Jakarta Faces implementations that have been installed. The default Jakarta Faces implementation that +WildFly should use is defined by the `default-jsf-impl-slot` subsystem attribute. + +[[installing-a-new-jsf-implementation-via-feature-pack]] +== Installing a new Jakarta Faces implementation via a feature pack + +WildFly supports provisioning a server using the Galleon tool, which allows an administrator to provision a server with +only the desired features, which are delivered as feature packs. For more information, see link:Galleon_Guide{outfilesuffix}[Provisioning WildFly with Galleon]. +For an example of such a feature pack, see the https://github.com/wildfly-extras/wildfly-myfaces-feature-pack[WildFly MyFaces Feature Pack] +project in the WildFly Extras GitHub organization. + +As a quick start, to provision a server using this feature pack, one might use a commandline like the following: + +[source,bash] +----- +$ galleon.sh provision myfaces_server.xml --dir=$SERVER_DIR +----- + +.myfaces_server.xml +[source,xml] +----- + + + + + + + + + + + + + + + + + + + + +----- + +[[start-the-server]] +=== Start the server + +After starting the server, the following CLI command can be used to verify that your new Jakarta Faces +implementation has been installed successfully. The new Jakarta Faces implementation should appear in the output +of this command. + +[source,options="nowrap"] +---- +[standalone@localhost:9990 /] /subsystem=jsf:list-active-jsf-impls() +---- + +[[changing-the-default-jsf-implementation]] +== Changing the default Jakarta Faces implementation + +The following CLI command can be used to make a newly installed Jakarta Faces implementation the default Jakarta +Server Faces implementation used by WildFly: + +[source,options="nowrap"] +---- +/subsystem=jsf/:write-attribute(name=default-jsf-impl-slot,value=-) +---- + +A server restart will be required for this change to take effect. + +[[configuring-a-jsf-app-to-use-a-non-default-jsf-implementation]] +== Configuring a Jakarta Faces app to use a non-default Jakarta Faces implementation + +A Jakarta Faces app can be configured to use an installed Jakarta Faces implementation that's not the +default implementation by adding a `org.jboss.jbossfaces.JSF_CONFIG_NAME` context parameter to its `web.xml` file. For +example, to indicate that a Jakarta Faces app should use MyFaces 4.0.0 (assuming MyFaces 4.0.0 has been installed +on the server), the following context parameter would need to be added: + +[source,xml,options="nowrap"] +---- + + org.jboss.jbossfaces.JSF_CONFIG_NAME + myfaces-4.0.0 + +---- + +If a Jakarta Faces app does not specify this context parameter, the default Jakarta Faces implementation +will be used for that app. + +[[disallowing-doctype-declarations]] +== Disallowing DOCTYPE declarations + +The following CLI commands can be used to disallow DOCTYPE declarations in Jakarta Faces deployments: + +[source,options="nowrap"] +---- +/subsystem=jsf:write-attribute(name=disallow-doctype-decl, value=true) +reload +---- + +This setting can be overridden for a particular Jakarta Faces deployment by adding the +`com.sun.faces.disallowDoctypeDecl` context parameter to the deployment's `web.xml` file: + +[source,xml,options="nowrap"] +---- + + com.sun.faces.disallowDoctypeDecl + false + +---- diff --git a/docs/src/main/asciidoc/_developer-guide/Implicit_module_dependencies_for_deployments.adoc b/docs/src/main/asciidoc/_developer-guide/Implicit_module_dependencies_for_deployments.adoc index cf3d1d1b99db..953a60f773b0 100644 --- a/docs/src/main/asciidoc/_developer-guide/Implicit_module_dependencies_for_deployments.adoc +++ b/docs/src/main/asciidoc/_developer-guide/Implicit_module_dependencies_for_deployments.adoc @@ -76,6 +76,8 @@ that are added to a deployment, by various deployers within WildFly. [[which-are-the-implicit-module-dependencies]] == Which are the implicit module dependencies? +NOTE: The sun.jdk is no longer added by the Core Server as an implicit dependency. + [cols=",,,",,options="header"] |======================================================================= |Subsystem responsible for adding the implicit dependency |Dependencies @@ -139,7 +141,7 @@ is a SAR archive |Security Subsystem |org.picketbox |  |  -|Web Subsystem |  |javaee.api jakarta.faces.api jakarta.faces.impl org.hibernate.validator org.jboss.as.web org.jboss.logging |The deployment is a WAR archive. Jakarta Server Faces +|Web Subsystem |  |javaee.api jakarta.faces.api jakarta.faces.impl org.hibernate.validator org.jboss.as.web org.jboss.logging |The deployment is a WAR archive. Jakarta Faces is only added if used. Multiple version options exist for Jakarta Faces. |Web Services Subsystem |org.jboss.ws.api org.jboss.ws.spi |  |  diff --git a/docs/src/main/asciidoc/_developer-guide/Jakarta_XML_Web_Services/WS-Security.adoc b/docs/src/main/asciidoc/_developer-guide/Jakarta_XML_Web_Services/WS-Security.adoc index b91a34d80c56..99757c692521 100644 --- a/docs/src/main/asciidoc/_developer-guide/Jakarta_XML_Web_Services/WS-Security.adoc +++ b/docs/src/main/asciidoc/_developer-guide/Jakarta_XML_Web_Services/WS-Security.adoc @@ -2,7 +2,7 @@ = WS-Security ifdef::env-github[] -:imagesdir: ../../images/ +:imagesdir: ../../ :tip-caption: :bulb: :note-caption: :information_source: :important-caption: :heavy_exclamation_mark: @@ -31,7 +31,7 @@ configure WS-Security. With public key cryptography, a user has a pair of public and private keys. These are generated using a large prime number and a key function. -image:Public_key_making.png[images/Public_key_making.png] +image:images/Public_key_making.png[alt=Public_key_making.png] The keys are related mathematically, but cannot be derived from one another. With these keys we can encrypt messages. For example, if Bob @@ -40,7 +40,7 @@ public key. Alice can then decrypt this message using her private key. Only Alice can decrypt this message as she is the only one with the private key. -image:Public_key_encryption-mod.svg.png[images/Public_key_encryption-mod.svg.png] +image:images/Public_key_encryption-mod.svg.png[alt=Public_key_encryption-mod.svg.png] Messages can also be signed. This allows you to ensure the authenticity of the message. If Alice wants to send a message to Bob, and Bob wants @@ -48,7 +48,7 @@ to be sure that it is from Alice, Alice can sign the message using her private key. Bob can then verify that the message is from Alice by using her public key. -image:250px-Public_key_making.svg.png[images/250px-Public_key_making.svg.png] +image:images/250px-Public_key_making.svg.png[alt=250px-Public_key_making.svg.png] [[jboss-ws-security-support]] == JBoss WS-Security support diff --git a/docs/src/main/asciidoc/_developer-guide/ejb3/Jakarta_Enterprise_Beans_Deployment_Runtime_Resources.adoc b/docs/src/main/asciidoc/_developer-guide/ejb3/Jakarta_Enterprise_Beans_Deployment_Runtime_Resources.adoc index 0899dae0a6df..c7f2f295ddff 100644 --- a/docs/src/main/asciidoc/_developer-guide/ejb3/Jakarta_Enterprise_Beans_Deployment_Runtime_Resources.adoc +++ b/docs/src/main/asciidoc/_developer-guide/ejb3/Jakarta_Enterprise_Beans_Deployment_Runtime_Resources.adoc @@ -2,6 +2,7 @@ = Jakarta Enterprise Beans Deployment Runtime Resources ifdef::env-github[] +:imagesdir: ../../ :tip-caption: :bulb: :note-caption: :information_source: :important-caption: :heavy_exclamation_mark: @@ -101,7 +102,7 @@ The following is a sample output for a stateless session bean named `ManagedStat To view it in WildFly Administration Console, go to the `Management Model` section of the target deployment. For example, -image:ejb/stateless-management-resource.png[images/ejb/stateless-management-resource.png] +image:images/ejb/stateless-management-resource.png[alt=ejb/stateless-management-resource.png] [[Stateful_Session_Bean_Runtime_Resources]] == Stateful Session Bean Runtime Resources @@ -182,7 +183,7 @@ The following is a sample output for a stateful session bean named `ManagedState To view it in WildFly Administration Console, go to the `Management Model` section of the target deployment. For example, -image:ejb/stateful-management-resource.png[images/ejb/stateful-management-resource.png] +image:images/ejb/stateful-management-resource.png[alt=ejb/stateful-management-resource.png] [[Singleton_Bean_Runtime_Resources]] == Singleton Bean Runtime Resources @@ -257,7 +258,7 @@ The following is a sample output for a singleton bean named `ManagedSingletonBea To view it in WildFly Administration Console, go to the `Management Model` section of the target deployment. For example, -image:ejb/singleton-management-resource.png[images/ejb/singleton-management-resource.png] +image:images/ejb/singleton-management-resource.png[alt=ejb/singleton-management-resource.png] [[Message_Driven_Bean_Runtime_Resources]] == Message-driven Bean Runtime Resources @@ -328,4 +329,4 @@ The following is a sample output for a message-driven bean named `ManagedMDB` in To view it in WildFly Administration Console, go to the `Management Model` section of the target deployment. For example, -image:ejb/mdb-management-resource.png[images/ejb/mdb-management-resource.png] +image:images/ejb/mdb-management-resource.png[alt=ejb/mdb-management-resource.png] diff --git a/docs/src/main/asciidoc/_elytron/Keycloak_SAML_Integration.adoc b/docs/src/main/asciidoc/_elytron/Keycloak_SAML_Integration.adoc index 59da4e84c41f..5ede81b65a84 100644 --- a/docs/src/main/asciidoc/_elytron/Keycloak_SAML_Integration.adoc +++ b/docs/src/main/asciidoc/_elytron/Keycloak_SAML_Integration.adoc @@ -26,8 +26,7 @@ The Keycloak SAML adapter can then be added to the WildFly installation with the [source] ---- -TODO: Update the version here when we know what it is -galleon.sh install org.keycloak:keycloak-saml-adapter-galleon-pack:999 --layers=keycloak-client-saml --dir=wildfly +galleon.sh install org.keycloak:keycloak-saml-adapter-galleon-pack:22.0.1 --layers=keycloak-client-saml --dir=wildfly ---- [NOTE] @@ -63,7 +62,7 @@ using both the `web-server` and `keycloak-client-saml` layers: org.keycloak keycloak-saml-adapter-galleon-pack - 999 + 22.0.1 @@ -156,7 +155,7 @@ using both the `web-server` and `keycloak-client-saml` layers: org.keycloak keycloak-saml-adapter-galleon-pack - 999 + 22.0.1 diff --git a/docs/src/main/asciidoc/_extras/Developing_Jakarta_Server_Faces_Project_Using_Maven_and_IntelliJ.adoc b/docs/src/main/asciidoc/_extras/Developing_Jakarta_Faces_Project_Using_Maven_and_IntelliJ.adoc similarity index 69% rename from docs/src/main/asciidoc/_extras/Developing_Jakarta_Server_Faces_Project_Using_Maven_and_IntelliJ.adoc rename to docs/src/main/asciidoc/_extras/Developing_Jakarta_Faces_Project_Using_Maven_and_IntelliJ.adoc index 54df957ce64a..a462869a0444 100644 --- a/docs/src/main/asciidoc/_extras/Developing_Jakarta_Server_Faces_Project_Using_Maven_and_IntelliJ.adoc +++ b/docs/src/main/asciidoc/_extras/Developing_Jakarta_Faces_Project_Using_Maven_and_IntelliJ.adoc @@ -1,8 +1,8 @@ -[[Developing_Jakarta_Server_Faces_Project_Using,_Maven_and_IntelliJ]] -= Developing Jakarta Server Faces Project Using JBoss AS7, Maven and IntelliJ +[[Developing_Jakarta_Faces_Project_Using,_Maven_and_IntelliJ]] += Developing Jakarta Faces Project Using JBoss AS7, Maven and IntelliJ ifdef::env-github[] -:imagesdir: ../images/ +:imagesdir: ../ :tip-caption: :bulb: :note-caption: :information_source: :important-caption: :heavy_exclamation_mark: @@ -11,19 +11,19 @@ ifdef::env-github[] endif::[] JBoss AS7 is a very 'modern' application server that has very fast -startup speed. So it's an excellent container to test your Jakarta Server Faces project. +startup speed. So it's an excellent container to test your Jakarta Faces project. In this article, I'd like to show you how to use AS7, maven and IntelliJ -together to develop your Jakarta Server Faces project. +together to develop your Jakarta Faces project. In this article I'd like to introduce the following things: * Create a project using Maven -* Add Jakarta Server Faces into project +* Add Jakarta Faces into project * Writing Code * Add JBoss AS 7 deploy plugin into project * Deploy project to JBoss AS 7 * Import project into IntelliJ -* Add IntelliJ Jakarta Server Faces support to project +* Add IntelliJ Jakarta Faces support to project * Add JBoss AS7 to IntelliJ * Debugging project with IntelliJ and AS7 @@ -83,14 +83,14 @@ mvn archetype:create -DarchetypeGroupId=org.apache.maven.archetypes \ If everything goes fine maven will generate the project for us: -image:jsf/8108c4f111aab2c3465472eb84cf1d9b7cf912d0.jpg[images/jsf/8108c4f111aab2c3465472eb84cf1d9b7cf912d0.jpg] +image:images/jsf/8108c4f111aab2c3465472eb84cf1d9b7cf912d0.jpg[alt=jsf/8108c4f111aab2c3465472eb84cf1d9b7cf912d0.jpg] The contents of the project is shown as above. -[[add-Jakarta-Server-Faces-into-project]] -== Add Jakarta Server Faces into project +[[add-Jakarta-Faces-into-project]] +== Add Jakarta Faces into project -The Jakarta Server Faces library is now included in maven repo, so we can let maven to +The Jakarta Faces library is now included in maven repo, so we can let maven to manage the download for us. First is to add repository into our pom.xml: [source,java,options="nowrap"] @@ -102,7 +102,7 @@ manage the download for us. First is to add repository into our pom.xml: ---- -Then we add Jakarta Server Faces dependency into pom.xml: +Then we add Jakarta Faces dependency into pom.xml: [source,xml,options="nowrap"] ---- @@ -116,7 +116,7 @@ Then we add Jakarta Server Faces dependency into pom.xml: Please note the 'scope' is 'provided', because we don't want to bundle the jsf.jar into the war produced by our project later, as JBoss AS7 -already have Jakarta Server Faces bundled in. +already have Jakarta Faces bundled in. Then we run 'mvn install' to update the project, and maven will download jsf-api for us automatically. @@ -124,7 +124,7 @@ jsf-api for us automatically. [[writing-code]] == Writing Code -Writing Jakarta Server Faces code in this article is trivial, so I've put written a +Writing Jakarta Faces code in this article is trivial, so I've put written a project called 'jsfdemo' onto github: https://github.com/liweinan/jsfdemo @@ -223,14 +223,14 @@ mvn -q jboss-as:deploy Maven will use some time to download necessary components for a while, so please wait patiently. After a while, we can see the result: -image:jsf/97d781c6be9db755aef80a110f1d9b29590610d6.jpg[images/jsf/97d781c6be9db755aef80a110f1d9b29590610d6.jpg] +image:images/jsf/97d781c6be9db755aef80a110f1d9b29590610d6.jpg[alt=jsf/97d781c6be9db755aef80a110f1d9b29590610d6.jpg] And if you check the console output of AS7, you can see the project is deployed: -image:jsf/2._java.jpg[images/jsf/2._java.jpg] +image:images/jsf/2._java.jpg[alt=jsf/2._java.jpg] -Now we have learnt how to create a Jakarta Server Faces project and deploy it to AS7 +Now we have learnt how to create a Jakarta Faces project and deploy it to AS7 without any help from graphical tools. Next let's see how to use IntelliJ IDEA to go on developing/debugging our project. @@ -240,54 +240,54 @@ IntelliJ IDEA to go on developing/debugging our project. Now it's time to import the project into IntelliJ. Now let's open IntelliJ, and choose 'New Project...': -image:jsf/05222f3059e387df96ce04d2aea156c82af15096.jpg[images/jsf/05222f3059e387df96ce04d2aea156c82af15096.jpg] +image:images/jsf/05222f3059e387df96ce04d2aea156c82af15096.jpg[alt=jsf/05222f3059e387df96ce04d2aea156c82af15096.jpg] The we choose 'Import project from external model': -image:jsf/d68a0cdbc8c90db3db8af998f34616f73c7fe809.jpg[images/jsf/d68a0cdbc8c90db3db8af998f34616f73c7fe809.jpg] +image:images/jsf/d68a0cdbc8c90db3db8af998f34616f73c7fe809.jpg[alt=jsf/d68a0cdbc8c90db3db8af998f34616f73c7fe809.jpg] Next step is choosing 'Maven': -image:jsf/0b3d1cb5794fb54a2465da93648b5a0d1a6643f3.jpg[images/jsf/0b3d1cb5794fb54a2465da93648b5a0d1a6643f3.jpg] +image:images/jsf/0b3d1cb5794fb54a2465da93648b5a0d1a6643f3.jpg[alt=jsf/0b3d1cb5794fb54a2465da93648b5a0d1a6643f3.jpg] Then IntelliJ will ask you the position of the project you want to import. In 'Root directory' input your project's directory and leave other options as default: -image:jsf/2f192d02993248c97e2ac42ea8f3105d855e5cdf.jpg[images/jsf/2f192d02993248c97e2ac42ea8f3105d855e5cdf.jpg] +image:images/jsf/2f192d02993248c97e2ac42ea8f3105d855e5cdf.jpg[alt=jsf/2f192d02993248c97e2ac42ea8f3105d855e5cdf.jpg] For next step, just click 'Next': -image:jsf/3a3ee36eb581930822c4a66362795345f5d2f9a7.jpg[images/jsf/3a3ee36eb581930822c4a66362795345f5d2f9a7.jpg] +image:images/jsf/3a3ee36eb581930822c4a66362795345f5d2f9a7.jpg[alt=jsf/3a3ee36eb581930822c4a66362795345f5d2f9a7.jpg] Finally click 'Finish': -image:jsf/91e40cd0b1545cff4622857d6dc9959f96faf056.jpg[images/jsf/91e40cd0b1545cff4622857d6dc9959f96faf056.jpg] +image:images/jsf/91e40cd0b1545cff4622857d6dc9959f96faf056.jpg[alt=jsf/91e40cd0b1545cff4622857d6dc9959f96faf056.jpg] Hooray! We've imported the project into IntelliJ now icon:smile-o[role="yellow"] -[[adding-intellij-Jakarta-Server-Faces-support-to-project]] -== Adding IntelliJ Jakarta Server Faces support to project +[[adding-intellij-Jakarta-Faces-support-to-project]] +== Adding IntelliJ Jakarta Faces support to project Let's see how to use IntelliJ and AS7 to debug the project. First we -need to add 'Jakarta Server Faces' facet into project. Open project setting: +need to add 'Jakarta Faces' facet into project. Open project setting: -image:jsf/8b8d0051f4f15033f17cb859c65f2d8481914678.jpg[images/jsf/8b8d0051f4f15033f17cb859c65f2d8481914678.jpg] +image:images/jsf/8b8d0051f4f15033f17cb859c65f2d8481914678.jpg[alt=jsf/8b8d0051f4f15033f17cb859c65f2d8481914678.jpg] Click on 'Facets' section on left; Select 'Web' facet that we already -have, and click the '+' on top, choose 'Jakarta Server Faces': +have, and click the '+' on top, choose 'Jakarta Faces': -image:jsf/e6947b84a56a698ca1392a440081bddfb5cae284.jpg[images/jsf/e6947b84a56a698ca1392a440081bddfb5cae284.jpg] +image:images/jsf/e6947b84a56a698ca1392a440081bddfb5cae284.jpg[alt=jsf/e6947b84a56a698ca1392a440081bddfb5cae284.jpg] Select 'Web' as parent facet: -image:jsf/6b2296be1bb2d8a81952caef0f025a139a39b381.jpg[images/jsf/6b2296be1bb2d8a81952caef0f025a139a39b381.jpg] +image:images/jsf/6b2296be1bb2d8a81952caef0f025a139a39b381.jpg[alt=jsf/6b2296be1bb2d8a81952caef0f025a139a39b381.jpg] Click 'Ok': -image:jsf/9988c572bad281146f405e9287f645a3da201885.jpg[images/jsf/9988c572bad281146f405e9287f645a3da201885.jpg] +image:images/jsf/9988c572bad281146f405e9287f645a3da201885.jpg[alt=jsf/9988c572bad281146f405e9287f645a3da201885.jpg] -Now we have enabled IntelliJ's Jakarta Server Faces support for project. +Now we have enabled IntelliJ's Jakarta Faces support for project. [[add-jboss-as7-to-intellij]] == Add JBoss AS7 to IntelliJ @@ -295,28 +295,28 @@ Now we have enabled IntelliJ's Jakarta Server Faces support for project. Let's add JBoss AS7 into IntelliJ and use it to debug our project. First please choose 'Edit Configuration' in menu tab: -image:jsf/dc0550785aae11f9d3eb439fdc0c51069affd25d.jpg[images/jsf/dc0550785aae11f9d3eb439fdc0c51069affd25d.jpg] +image:images/jsf/dc0550785aae11f9d3eb439fdc0c51069affd25d.jpg[alt=jsf/dc0550785aae11f9d3eb439fdc0c51069affd25d.jpg] Click '+' and choose 'JBoss Server' -> 'Local': -image:jsf/1231420c938f087030cb3dcd37237b5585beb154.jpg[images/jsf/1231420c938f087030cb3dcd37237b5585beb154.jpg] +image:images/jsf/1231420c938f087030cb3dcd37237b5585beb154.jpg[alt=jsf/1231420c938f087030cb3dcd37237b5585beb154.jpg] Click 'configure': -image:jsf/d7e6ab58230b2d31fdcd8fd5f14cd4eb47b05f64.jpg[images/jsf/d7e6ab58230b2d31fdcd8fd5f14cd4eb47b05f64.jpg] +image:images/jsf/d7e6ab58230b2d31fdcd8fd5f14cd4eb47b05f64.jpg[alt=jsf/d7e6ab58230b2d31fdcd8fd5f14cd4eb47b05f64.jpg] and choose your JBoss AS7: -image:jsf/f7b29ac8009f04fc7f209222ced0bcf54f4b8d9a.jpg[images/jsf/f7b29ac8009f04fc7f209222ced0bcf54f4b8d9a.jpg] +image:images/jsf/f7b29ac8009f04fc7f209222ced0bcf54f4b8d9a.jpg[alt=jsf/f7b29ac8009f04fc7f209222ced0bcf54f4b8d9a.jpg] Now we need to add our project into deployment. Click the 'Deployment' tab: -image:jsf/6802fb7e29283d0e064a7cc4466b918995ba5645.jpg[images/jsf/6802fb7e29283d0e064a7cc4466b918995ba5645.jpg] +image:images/jsf/6802fb7e29283d0e064a7cc4466b918995ba5645.jpg[alt=jsf/6802fb7e29283d0e064a7cc4466b918995ba5645.jpg] Choose 'Artifact', and add our project: -image:jsf/359484b8f6f2c655d94132e9cb6f9dbe5a058656.jpg[images/jsf/359484b8f6f2c655d94132e9cb6f9dbe5a058656.jpg] +image:images/jsf/359484b8f6f2c655d94132e9cb6f9dbe5a058656.jpg[alt=jsf/359484b8f6f2c655d94132e9cb6f9dbe5a058656.jpg] Leave everything as default and click 'Ok', now we've added JBoss AS7 into IntelliJ @@ -359,7 +359,7 @@ bin/standalone.sh --debug --server-config=standalone.xml Now we start AS7 in IntelliJ: -image:jsf/52369d67f9117c924213de24dd6642b48e47a436.png[images/jsf/52369d67f9117c924213de24dd6642b48e47a436.png] +image:images/jsf/52369d67f9117c924213de24dd6642b48e47a436.png[alt=jsf/52369d67f9117c924213de24dd6642b48e47a436.png] Please note we should undeploy the existing 'jsfdemo' project in AS7 as we've added by maven jboss deploy plugin before. Or AS7 will tell us @@ -369,46 +369,46 @@ deploy the project anymore. If the project start correctly we can see from the IntelliJ console window, and please check the debug option is enabled: -image:jsf/eaac5cb1a836809ab29513346b527fe051b7c7ac.png[images/jsf/eaac5cb1a836809ab29513346b527fe051b7c7ac.png] +image:images/jsf/eaac5cb1a836809ab29513346b527fe051b7c7ac.png[alt=jsf/eaac5cb1a836809ab29513346b527fe051b7c7ac.png] Now we will setup the debug configuration, click 'debug' option on menu: -image:jsf/b8323caf6980c40c3d635db5e308b03847618d06.jpg[images/jsf/b8323caf6980c40c3d635db5e308b03847618d06.jpg] +image:images/jsf/b8323caf6980c40c3d635db5e308b03847618d06.jpg[alt=jsf/b8323caf6980c40c3d635db5e308b03847618d06.jpg] Choose 'Edit Configurations': -image:jsf/8327bbe0e83cb7170dd84767631c98956e91c42c.jpg[images/jsf/8327bbe0e83cb7170dd84767631c98956e91c42c.jpg] +image:images/jsf/8327bbe0e83cb7170dd84767631c98956e91c42c.jpg[alt=jsf/8327bbe0e83cb7170dd84767631c98956e91c42c.jpg] Then we click 'Add' and choose Remote: -image:jsf/7103da6b6323e515a03a04cafe111aa7c6b3169d.jpg[images/jsf/7103da6b6323e515a03a04cafe111aa7c6b3169d.jpg] +image:images/jsf/7103da6b6323e515a03a04cafe111aa7c6b3169d.jpg[alt=jsf/7103da6b6323e515a03a04cafe111aa7c6b3169d.jpg] Set the 'port' to the one you used in AS7 config file 'standalone.conf': -image:jsf/30bbef45137c7d45ae300ba8d551423d1feefc96.png[images/jsf/30bbef45137c7d45ae300ba8d551423d1feefc96.png] +image:images/jsf/30bbef45137c7d45ae300ba8d551423d1feefc96.png[alt=jsf/30bbef45137c7d45ae300ba8d551423d1feefc96.png] Leave other configurations as default and click 'Ok'. Now we need to set breakpoints in project, let's choose TimeBean.java and set a breakpoint on 'getNow()' method by clicking the left side of that line of code: -image:jsf/a96b7d32e04aa67956bd00a187f09b75a5af241e.jpg[images/jsf/a96b7d32e04aa67956bd00a187f09b75a5af241e.jpg] +image:images/jsf/a96b7d32e04aa67956bd00a187f09b75a5af241e.jpg[alt=jsf/a96b7d32e04aa67956bd00a187f09b75a5af241e.jpg] Now we can use the profile to do debug: -image:jsf/5ea6987d1635c2c58d3ccdb1f5718f29d6a0fac3.png[images/jsf/5ea6987d1635c2c58d3ccdb1f5718f29d6a0fac3.png] +image:images/jsf/5ea6987d1635c2c58d3ccdb1f5718f29d6a0fac3.png[alt=jsf/5ea6987d1635c2c58d3ccdb1f5718f29d6a0fac3.png] If everything goes fine we can see the console output: -image:jsf/1096ebbbf2b29e694e300e02a48d0fa4207cb746.jpg[images/jsf/1096ebbbf2b29e694e300e02a48d0fa4207cb746.jpg] +image:images/jsf/1096ebbbf2b29e694e300e02a48d0fa4207cb746.jpg[alt=jsf/1096ebbbf2b29e694e300e02a48d0fa4207cb746.jpg] Now we go to web browser and see our project's main page, try to click on 'Get current time': -image:jsf/5ad5d0216d3326e9bc29705042db59f11c3c1e70.png[images/jsf/5ad5d0216d3326e9bc29705042db59f11c3c1e70.png] +image:images/jsf/5ad5d0216d3326e9bc29705042db59f11c3c1e70.png[alt=jsf/5ad5d0216d3326e9bc29705042db59f11c3c1e70.png] Then IntelliJ will popup and the code is pausing on break point: -image:jsf/2499d43c0dce2cab72ba472c8452a2b57999ac84.jpg[images/jsf/2499d43c0dce2cab72ba472c8452a2b57999ac84.jpg] +image:images/jsf/2499d43c0dce2cab72ba472c8452a2b57999ac84.jpg[alt=jsf/2499d43c0dce2cab72ba472c8452a2b57999ac84.jpg] And we could inspect our project now. @@ -416,7 +416,7 @@ And we could inspect our project now. == Conclusion In this article I've shown to you how to use maven to create a project -using Jakarta Server Faces and deploy it in JBoss AS7, and I've also talked about the +using Jakarta Faces and deploy it in JBoss AS7, and I've also talked about the usage of IntelliJ during project development phase. Hope the contents are practical and helpful to you icon:smile-o[role="yellow"] diff --git a/docs/src/main/asciidoc/_extras/Getting_Started_Developing_Applications_Presentation_Demo.adoc b/docs/src/main/asciidoc/_extras/Getting_Started_Developing_Applications_Presentation_Demo.adoc index 3fd0cc7b10b2..76a674c49f22 100644 --- a/docs/src/main/asciidoc/_extras/Getting_Started_Developing_Applications_Presentation_Demo.adoc +++ b/docs/src/main/asciidoc/_extras/Getting_Started_Developing_Applications_Presentation_Demo.adoc @@ -295,7 +295,7 @@ bean, CDI will inject that bean === Introduction This quickstart adds in a "complete" view layer into the mix. Jakarta EE -ships with a Jakarta Server Faces. Jakarta Server Faces is a server side rendering, component orientated +ships with a Jakarta Faces. Jakarta Faces is a server side rendering, component orientated framework, where you write markup using an HTML like language, adding in dynamic behavior by binding components to beans in the back end. The quickstart also makes more use of CDI to wire the application together. @@ -321,10 +321,10 @@ No need to open any of them, just point them out . `web.xml` - don't need it! . `beans.xml` - as before, marker file . `faces-config.xml` - nice feature from AS7 - we can just put -`faces-config.xml` into the WEB-INF and it enables Jakarta Server Faces (inspiration from +`faces-config.xml` into the WEB-INF and it enables Jakarta Faces (inspiration from CDI) . `pom.xml` we saw this before, this time it's the same but adds in -Jakarta Server Faces API +Jakarta Faces API [[views]] === Views @@ -348,7 +348,7 @@ calls a method on the game bean persistence etc. .. `@Named` – As we discussed CDI is typesafe, (beans are injected by type) but sometimes need to access in a non-typesafe fashion. @Named -exposes the Bean in EL - and allows us to access it from Jakarta Server Faces +exposes the Bean in EL - and allows us to access it from Jakarta Faces .. `@SessionScoped` – really simple app, we keep the game data in the session - to play two concurrent games, need two sessions. This is not a limitation of CDI, but simply keeps this demo very simple. CDI will @@ -381,7 +381,7 @@ instance at runtime [[introduction-3]] === Introduction -The login quickstart builds on the knowledge of CDI and Jakarta Server Faces we have got +The login quickstart builds on the knowledge of CDI and Jakarta Faces we have got from numberguess. New stuff we will learn about is how to use Jakarta Persistence to store data in a database, how to use Jakarta Transactions to control transactions, and how to use Jakarta Enterprise Beans for declarative TX control. @@ -416,7 +416,7 @@ Jakarta Transactions and Jakarta Enterprise Beans [[views-1]] === Views -. `template.xhtml` One of the updates added to Jakarta Server Faces was templating +. `template.xhtml` One of the updates added to Jakarta Faces was templating ability. We take advantage of that in this app, as we have multiple views .. Actually nothing too major here, we define the app "title" and we @@ -442,14 +442,14 @@ logout, link to add users. . `Credentials.java` Backing bean for the login form field, pretty trivial. It's request scoped (natural for a login field) and named so we -can get it from Jakarta Server Faces. +can get it from Jakarta Faces. . `Login.java` .. Is session scoped (a user is logged in for the length of their session or until they log out}} .. Is accessible from EL .. Injects the current credentials .. Uses the userManager service to load the user, and sends any -messages to Jakarta Server Faces as needed +messages to Jakarta Faces as needed .. Uses a producer method to expose the @LoggedIn user (producer methods used as we don't know which user at development time) . `User.java` Is a pretty straightforward Jakarta Persistence entity. Mapped with @@ -491,7 +491,7 @@ The kitchensink quickstart is generated from an archetype available for JBoss AS (tell people to check the link:/pages/createpage.action?spaceKey=WFLY&title=Getting+Started+Developing+Applications&linkCreation=true&fromPageId=557131[Getting Started Developing Applications] Guide for details). It demonstrates -CDI, Jakarta Server Faces, Jakarta Enterprise Beans, Jakarta Persistence (which we've seen before) and Jakarta RESTful Web Services and Bean +CDI, Jakarta Faces, Jakarta Enterprise Beans, Jakarta Persistence (which we've seen before) and Jakarta RESTful Web Services and Bean Validation as well. We add in Arquillian for testing. [[run-the-app-2]] diff --git a/docs/src/main/asciidoc/_galleon/Galleon_layers.adoc b/docs/src/main/asciidoc/_galleon/Galleon_layers.adoc index 05a8035afdd6..68a56c3f4f28 100644 --- a/docs/src/main/asciidoc/_galleon/Galleon_layers.adoc +++ b/docs/src/main/asciidoc/_galleon/Galleon_layers.adoc @@ -331,7 +331,7 @@ link:#gal.bean-validation[bean-validation] (optional) + link:#gal.datasources[datasources] + |[[gal.jsf]]jsf -|Support for Jakarta Server Faces. +|Support for Jakarta Faces. | link:#gal.bean-validation[bean-validation] (optional) + link:#gal.cdi[cdi] + diff --git a/docs/src/main/asciidoc/_high-availability/Clustering_and_Domain_Setup_Walkthrough.adoc b/docs/src/main/asciidoc/_high-availability/Clustering_and_Domain_Setup_Walkthrough.adoc index 6d7909fe938f..56e4a2f1442e 100644 --- a/docs/src/main/asciidoc/_high-availability/Clustering_and_Domain_Setup_Walkthrough.adoc +++ b/docs/src/main/asciidoc/_high-availability/Clustering_and_Domain_Setup_Walkthrough.adoc @@ -2,7 +2,7 @@ = Clustering and Domain Setup Walkthrough ifdef::env-github[] -:imagesdir: ../images/ +:imagesdir: ../ :tip-caption: :bulb: :note-caption: :information_source: :important-caption: :heavy_exclamation_mark: @@ -47,7 +47,7 @@ will run as a domain controller, the secondary host will under the domain manage mod_cluster module. The WildFly on primary and secondary hosts will form a cluster and discovered by httpd. -image:clustering/Clustering.jpg[images/clustering/Clustering.jpg] +image:images/clustering/Clustering.jpg[alt=clustering/Clustering.jpg] * We will deploy a demo project into the domain, and verify that the project is deployed into both primary and secondary Host Controllers by the domain controller. @@ -68,7 +68,7 @@ the HA is working and sessions are replicated. it. We should see the Domain Controller is registered back into cluster, also we should see the secondary Host Controller sees the primary Host Controller as a domain controller again and connect to it. -image:clustering/test_scenario.jpg[images/clustering/test_scenario.jpg] +image:images/clustering/test_scenario.jpg[alt=clustering/test_scenario.jpg] Please don't worry if you cannot digest so many details currently. Let's move on and you will get the points step by step. @@ -403,7 +403,7 @@ After server-three on both primary and secondary hosts are started, we will add cluster-demo.war for deployment. Click on the 'Manage Deployments' link at the bottom of left menu list. -image:clustering/JBoss_Management.png[images/clustering/JBoss_Management.png] + +image:images/clustering/JBoss_Management.png[alt=clustering/JBoss_Management.png] + (We should ensure the server-three should be started on both primary and secondary hosts) @@ -417,7 +417,7 @@ button and add the war to 'other-server-group' and then click 'save'. Wait a few seconds, management console will tell you that the project is deployed into 'other-server-group'.: -image:clustering/JBoss_Management_2.png[images/clustering/JBoss_Management_2.png] +image:images/clustering/JBoss_Management_2.png[alt=clustering/JBoss_Management_2.png] Please note we have two hosts participate in this server group, so the project should be deployed in both primary and secondary hosts now - that's the @@ -431,14 +431,14 @@ and secondary hosts, and they should all work now: http://10.211.55.7:8330/cluster-demo/ ---- -image:clustering/http---10.211.55.7-8330-cluster-demo-.png[images/clustering/http---10.211.55.7-8330-cluster-demo-.png] +image:images/clustering/http---10.211.55.7-8330-cluster-demo-.png[alt=clustering/http---10.211.55.7-8330-cluster-demo-.png] [source,options="nowrap"] ---- http://10.211.55.2:8330/cluster-demo/ ---- -image:clustering/http---10.211.55.2-8330-cluster-demo-.png[images/clustering/http---10.211.55.2-8330-cluster-demo-.png] +image:images/clustering/http---10.211.55.2-8330-cluster-demo-.png[alt=clustering/http---10.211.55.2-8330-cluster-demo-.png] Now that we have finished the project deployment and see the usages of domain controller, we will then head up for using these two hosts to @@ -651,7 +651,7 @@ Now we access the cluster: http://10.211.55.7/cluster-demo/put.jsp ---- -image:clustering/http---10.211.55.7-cluster-demo-put.jsp.png[images/clustering/http---10.211.55.7-cluster-demo-put.jsp.png] +image:images/clustering/http---10.211.55.7-cluster-demo-put.jsp.png[alt=clustering/http---10.211.55.7-cluster-demo-put.jsp.png] We should see the request is distributed to one of the hosts (primary or secondary) from the WildFly log. For me the request is sent to primary host: @@ -677,7 +677,7 @@ Then wait for a few seconds and access cluster: http://10.211.55.7/cluster-demo/get.jsp ---- -image:clustering/http---10.211.55.7-cluster-demo-get.jsp.png[images/clustering/http---10.211.55.7-cluster-demo-get.jsp.png] +image:images/clustering/http---10.211.55.7-cluster-demo-get.jsp.png[alt=clustering/http---10.211.55.7-cluster-demo-get.jsp.png] Now the request should be served by the secondary host and we should see the log from the secondary Host Controller: diff --git a/docs/src/main/asciidoc/_high-availability/jgroups/AWS-Discovery.adoc b/docs/src/main/asciidoc/_high-availability/jgroups/AWS-Discovery.adoc index 694570af4012..38dee9a9cd5a 100644 --- a/docs/src/main/asciidoc/_high-availability/jgroups/AWS-Discovery.adoc +++ b/docs/src/main/asciidoc/_high-availability/jgroups/AWS-Discovery.adoc @@ -8,11 +8,12 @@ ifdef::env-github[] :warning-caption: :warning: endif::[] -The `org.jgroups.protocols.aws.S3_PING` is a discovery protocol for AWS EC2. +The `org.jgroups.protocols.aws.S3_PING` is a discovery protocol using AWS S3 buckets as cluster information store. -For provisioning using Galleon, use the `jgroups-aws` layer. +To provision using Galleon, use the `jgroups-aws` layer. +Note that the layer does not update configuration, only provisions necessary modules. -The following example updates the `tcp` stack to use this discovery protocol instead of `MPING`: +The following minimal example updates the existing `tcp` stack to use this discovery protocol instead of `MPING`: [source,options="nowrap"] ---- @@ -22,4 +23,9 @@ batch run-batch ---- +The S3 client used by the protocol uses the default credential store provider. +Refer to AWS documentation how to generate and supply appropriate credentials. +For instance, credentials can be provided by Java system properties (`aws.accessKeyId` and `aws.secretAccessKey`), +environmental properties (`AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`), etc. + For advanced configuration options, please visit protocol's documentation https://github.com/jgroups-extras/jgroups-aws#readme[here]. diff --git a/docs/src/main/asciidoc/index.adoc b/docs/src/main/asciidoc/index.adoc index 5e734005c3a6..addbcb5215ad 100644 --- a/docs/src/main/asciidoc/index.adoc +++ b/docs/src/main/asciidoc/index.adoc @@ -3,7 +3,6 @@ :ext-relative: {outfilesuffix} ifdef::env-github[] -:imagesdir: images/ :tip-caption: :bulb: :note-caption: :information_source: :important-caption: :heavy_exclamation_mark: @@ -13,7 +12,7 @@ endif::[] :toc!: -image:splash_wildflylogo_small.png[WildFly, align="center"] +image:images/splash_wildflylogo_small.png[WildFly, align="center"] Welcome to the WildFly documentation. The documentation for WildFly is split into multiple categories: @@ -80,13 +79,13 @@ and failover. Started Developing Applications Guide] shows you how to build Jakarta EE applications and deploy them to WildFly. The guide starts by showing you the simplest _helloworld_ application using just Servlet and Jakarta Contexts and Dependency Injection, and -then adds in Jakarta Server Faces, persistence and transactions, Jakarta Enterprise Beans, Bean Validation, +then adds in Jakarta Faces, persistence and transactions, Jakarta Enterprise Beans, Bean Validation, RESTful web services and more. Finally, you'll get the opportunity to create your own skeleton project. Each tutorial is accompanied by a quickstart, which contains the source code, deployment descriptors and a Maven based build. -* The link:Developer_Guide{outfilesuffix}[Developer Guide] ( _in progress_) takes +* The link:Developer_Guide{outfilesuffix}[Developer Guide] takes you through every deployment descriptor and every annotation offered by WildFly. diff --git a/ee-build/pom.xml b/ee-build/pom.xml index 6ac6518d0a48..d2367c85c490 100644 --- a/ee-build/pom.xml +++ b/ee-build/pom.xml @@ -34,7 +34,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-ee-build diff --git a/ee-dist/pom.xml b/ee-dist/pom.xml index eb313060c882..bf47d9e8cd25 100644 --- a/ee-dist/pom.xml +++ b/ee-dist/pom.xml @@ -34,7 +34,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-ee-dist @@ -121,7 +121,7 @@ compile ${basedir}/target/${project.build.finalName} - tree + true ${galleon.log.time} ${galleon.offline} diff --git a/ee-feature-pack/galleon-feature-pack/pom.xml b/ee-feature-pack/galleon-feature-pack/pom.xml index e6f4fa62d18d..bc22dee648b6 100644 --- a/ee-feature-pack/galleon-feature-pack/pom.xml +++ b/ee-feature-pack/galleon-feature-pack/pom.xml @@ -32,7 +32,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-ee-galleon-pack diff --git a/ee-feature-pack/galleon-local/pom.xml b/ee-feature-pack/galleon-local/pom.xml index 42901ac3a106..ceb8f9c482f8 100644 --- a/ee-feature-pack/galleon-local/pom.xml +++ b/ee-feature-pack/galleon-local/pom.xml @@ -31,7 +31,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-ee-feature-pack-galleon-local diff --git a/ee-feature-pack/galleon-local/src/main/resources/layers/standalone/hibernate-search/layer-spec.xml b/ee-feature-pack/galleon-local/src/main/resources/layers/standalone/hibernate-search/layer-spec.xml index 396266bc41ae..848449346603 100644 --- a/ee-feature-pack/galleon-local/src/main/resources/layers/standalone/hibernate-search/layer-spec.xml +++ b/ee-feature-pack/galleon-local/src/main/resources/layers/standalone/hibernate-search/layer-spec.xml @@ -1,5 +1,8 @@ - + + + + diff --git a/ee-feature-pack/galleon-local/src/main/resources/packages/docs.licenses/pm/wildfly/tasks.xml b/ee-feature-pack/galleon-local/src/main/resources/packages/docs.licenses/pm/wildfly/tasks.xml index 5572eed09799..e262fd831700 100644 --- a/ee-feature-pack/galleon-local/src/main/resources/packages/docs.licenses/pm/wildfly/tasks.xml +++ b/ee-feature-pack/galleon-local/src/main/resources/packages/docs.licenses/pm/wildfly/tasks.xml @@ -4,9 +4,9 @@ - + - + diff --git a/ee-feature-pack/galleon-shared/pom.xml b/ee-feature-pack/galleon-shared/pom.xml index a8fe306d6a76..b3b82a2906cd 100644 --- a/ee-feature-pack/galleon-shared/pom.xml +++ b/ee-feature-pack/galleon-shared/pom.xml @@ -31,7 +31,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-ee-feature-pack-galleon-shared @@ -106,27 +106,6 @@ * - - - - - com.amazonaws - aws-java-sdk-core - - - - com.amazonaws - aws-java-sdk-s3 - - - - com.amazonaws - aws-java-sdk-kms - - - - com.amazonaws - jmespath-java @@ -161,11 +140,6 @@ jackson-datatype-jdk8 - - com.fasterxml.jackson.dataformat - jackson-dataformat-cbor - - com.fasterxml.jackson.jakarta.rs jackson-jakarta-rs-base @@ -902,17 +876,6 @@ - - org.apache.avro - avro - - - * - * - - - - org.apache.cxf cxf-rt-bindings-coloc @@ -2995,8 +2958,103 @@ - software.amazon.ion - ion-java + software.amazon.awssdk + annotations + + + + software.amazon.awssdk + apache-client + + + + software.amazon.awssdk + arns + + + + software.amazon.awssdk + auth + + + + software.amazon.awssdk + aws-core + + + + software.amazon.awssdk + aws-query-protocol + + + + software.amazon.awssdk + aws-xml-protocol + + + + software.amazon.awssdk + crt-core + + + + software.amazon.awssdk + endpoints-spi + + + + software.amazon.awssdk + http-client-spi + + + + software.amazon.awssdk + json-utils + + + + software.amazon.awssdk + metrics-spi + + + + software.amazon.awssdk + profiles + + + + software.amazon.awssdk + protocol-core + + + + software.amazon.awssdk + regions + + + + software.amazon.awssdk + s3 + + + + software.amazon.awssdk + sdk-core + + + + software.amazon.awssdk + third-party-jackson-core + + + + software.amazon.awssdk + utils + + + + software.amazon.eventstream + eventstream @@ -3047,6 +3105,17 @@ + + ${ee.maven.groupId} + jipijapa-hibernatesearch + + + * + * + + + + ${ee.maven.groupId} wildfly-appclient diff --git a/ee-feature-pack/galleon-shared/src/main/resources/content/appclient/configuration/appclient.xml b/ee-feature-pack/galleon-shared/src/main/resources/content/appclient/configuration/appclient.xml index 2c38e1fe0dd3..e70e47bed738 100644 --- a/ee-feature-pack/galleon-shared/src/main/resources/content/appclient/configuration/appclient.xml +++ b/ee-feature-pack/galleon-shared/src/main/resources/content/appclient/configuration/appclient.xml @@ -82,10 +82,7 @@ jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE h2 - - sa - sa - + diff --git a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/batch-jberet/layer-spec.xml b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/batch-jberet/layer-spec.xml index 951b071152d7..07f78676bd6c 100644 --- a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/batch-jberet/layer-spec.xml +++ b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/batch-jberet/layer-spec.xml @@ -1,5 +1,9 @@ - + + + + + - + + + + diff --git a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/ee-integration/layer-spec.xml b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/ee-integration/layer-spec.xml index 90aaaeba49e3..9932791c319b 100644 --- a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/ee-integration/layer-spec.xml +++ b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/ee-integration/layer-spec.xml @@ -1,5 +1,9 @@ - + + + + + diff --git a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/ee-security/layer-spec.xml b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/ee-security/layer-spec.xml index 9378308be5af..faafc5cf8414 100644 --- a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/ee-security/layer-spec.xml +++ b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/ee-security/layer-spec.xml @@ -1,5 +1,9 @@ - + + + + + diff --git a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/ejb-dist-cache/layer-spec.xml b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/ejb-dist-cache/layer-spec.xml index 0fac44fa6bb8..17f1cdd1ca7f 100644 --- a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/ejb-dist-cache/layer-spec.xml +++ b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/ejb-dist-cache/layer-spec.xml @@ -1,8 +1,10 @@ - + - + + + diff --git a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/ejb-http-invoker/layer-spec.xml b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/ejb-http-invoker/layer-spec.xml index f740dc3b6993..b5055fed620d 100644 --- a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/ejb-http-invoker/layer-spec.xml +++ b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/ejb-http-invoker/layer-spec.xml @@ -1,6 +1,9 @@ - - + + + + + diff --git a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/ejb-lite/layer-spec.xml b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/ejb-lite/layer-spec.xml index f4ae1852b713..fc0971b4370a 100644 --- a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/ejb-lite/layer-spec.xml +++ b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/ejb-lite/layer-spec.xml @@ -1,7 +1,11 @@ - + + + + + + + + + diff --git a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/elytron-oidc-client/layer-spec.xml b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/elytron-oidc-client/layer-spec.xml index 61d878b155fb..3ad8539e93e0 100644 --- a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/elytron-oidc-client/layer-spec.xml +++ b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/elytron-oidc-client/layer-spec.xml @@ -1,5 +1,8 @@ - + + + + diff --git a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/embedded-activemq/layer-spec.xml b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/embedded-activemq/layer-spec.xml index 3c9f0a6a9f82..8e38aac5904c 100644 --- a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/embedded-activemq/layer-spec.xml +++ b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/embedded-activemq/layer-spec.xml @@ -1,5 +1,11 @@ - + + + + + + + diff --git a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/h2-datasource/layer-spec.xml b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/h2-datasource/layer-spec.xml index 1923d7af6595..8f623817f2de 100644 --- a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/h2-datasource/layer-spec.xml +++ b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/h2-datasource/layer-spec.xml @@ -1,6 +1,13 @@ - + + + + + + + + diff --git a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/h2-default-datasource/layer-spec.xml b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/h2-default-datasource/layer-spec.xml index 0b576d946809..19d0a59a3bf5 100644 --- a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/h2-default-datasource/layer-spec.xml +++ b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/h2-default-datasource/layer-spec.xml @@ -1,6 +1,12 @@ - + + + + + + + diff --git a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/h2-driver/layer-spec.xml b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/h2-driver/layer-spec.xml index 2164be6dd2c5..c1b3d3f2a7e5 100644 --- a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/h2-driver/layer-spec.xml +++ b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/h2-driver/layer-spec.xml @@ -1,6 +1,11 @@ - + + + + + + diff --git a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/health/layer-spec.xml b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/health/layer-spec.xml index 3c2bea19871f..343336b6c2a8 100644 --- a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/health/layer-spec.xml +++ b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/health/layer-spec.xml @@ -22,7 +22,11 @@ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. --> - + + + + + diff --git a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/iiop-openjdk/layer-spec.xml b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/iiop-openjdk/layer-spec.xml index d68c6a8f6496..f9cd1b2678d1 100644 --- a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/iiop-openjdk/layer-spec.xml +++ b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/iiop-openjdk/layer-spec.xml @@ -1,5 +1,9 @@ - + + + + + diff --git a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/infinispan/layer-spec.xml b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/infinispan/layer-spec.xml index 6531372d7947..a7ab5261bd81 100644 --- a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/infinispan/layer-spec.xml +++ b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/infinispan/layer-spec.xml @@ -21,8 +21,12 @@ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. --> - - + + + + + + diff --git a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/internal-standalone-full-profile/layer-spec.xml b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/internal-standalone-full-profile/layer-spec.xml index 02285227ff94..10f124d582fc 100644 --- a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/internal-standalone-full-profile/layer-spec.xml +++ b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/internal-standalone-full-profile/layer-spec.xml @@ -1,7 +1,10 @@ - + + + + diff --git a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/internal-standalone-profile/layer-spec.xml b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/internal-standalone-profile/layer-spec.xml index 60364e2d18d1..bc2600492542 100644 --- a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/internal-standalone-profile/layer-spec.xml +++ b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/internal-standalone-profile/layer-spec.xml @@ -1,7 +1,10 @@ - + + + + diff --git a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/jaxrs-server/layer-spec.xml b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/jaxrs-server/layer-spec.xml index f3f9c48c4417..5d1274357e4f 100644 --- a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/jaxrs-server/layer-spec.xml +++ b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/jaxrs-server/layer-spec.xml @@ -1,9 +1,12 @@ - + + + + + this is why jaxrs is an optional dependency --> diff --git a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/jaxrs/layer-spec.xml b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/jaxrs/layer-spec.xml index 49644d42479c..60b12757d8fb 100644 --- a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/jaxrs/layer-spec.xml +++ b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/jaxrs/layer-spec.xml @@ -1,5 +1,9 @@ - + + + + + diff --git a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/jdr/layer-spec.xml b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/jdr/layer-spec.xml index 42d5f837ad46..bf4141d0fb64 100644 --- a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/jdr/layer-spec.xml +++ b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/jdr/layer-spec.xml @@ -1,5 +1,9 @@ - + + + + + diff --git a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/jgroups-aws/layer-spec.xml b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/jgroups-aws/layer-spec.xml index 3a98cb623eb6..0bc0c4633028 100644 --- a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/jgroups-aws/layer-spec.xml +++ b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/jgroups-aws/layer-spec.xml @@ -21,8 +21,11 @@ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. --> - - + + + + + - + + + + + diff --git a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/mod_cluster/layer-spec.xml b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/mod_cluster/layer-spec.xml index 2ba82ac6d22a..452ea619e097 100644 --- a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/mod_cluster/layer-spec.xml +++ b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/mod_cluster/layer-spec.xml @@ -20,8 +20,11 @@ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. --> - - + + + + + diff --git a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/naming/layer-spec.xml b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/naming/layer-spec.xml index af9f5b00bdf0..aac6e659a524 100644 --- a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/naming/layer-spec.xml +++ b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/naming/layer-spec.xml @@ -1,5 +1,8 @@ - + + + + diff --git a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/pojo/layer-spec.xml b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/pojo/layer-spec.xml index 20f17b899c61..7372cdc72d0e 100644 --- a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/pojo/layer-spec.xml +++ b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/pojo/layer-spec.xml @@ -1,5 +1,8 @@ - + + + + diff --git a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/remote-activemq/layer-spec.xml b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/remote-activemq/layer-spec.xml index 4a08b21f5108..98c9d1f52bef 100644 --- a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/remote-activemq/layer-spec.xml +++ b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/remote-activemq/layer-spec.xml @@ -1,5 +1,9 @@ - + + + + + diff --git a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/resource-adapters/layer-spec.xml b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/resource-adapters/layer-spec.xml index d72f6eeb999e..3ef77953f3fc 100644 --- a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/resource-adapters/layer-spec.xml +++ b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/resource-adapters/layer-spec.xml @@ -1,5 +1,8 @@ - + + + + diff --git a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/sar/layer-spec.xml b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/sar/layer-spec.xml index 2cf22abddc05..3d497b2e0dfe 100644 --- a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/sar/layer-spec.xml +++ b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/sar/layer-spec.xml @@ -1,5 +1,8 @@ - + + + + diff --git a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/servlet/layer-spec.xml b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/servlet/layer-spec.xml index 87d5269b7653..e535af4ece4e 100644 --- a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/servlet/layer-spec.xml +++ b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/servlet/layer-spec.xml @@ -1,9 +1,15 @@ - + + + + + + + \ No newline at end of file diff --git a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/singleton-ha/layer-spec.xml b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/singleton-ha/layer-spec.xml index 89026c608ae7..f39a7b6fa62f 100644 --- a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/singleton-ha/layer-spec.xml +++ b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/singleton-ha/layer-spec.xml @@ -20,8 +20,10 @@ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. --> - - + + + + diff --git a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/singleton-local/layer-spec.xml b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/singleton-local/layer-spec.xml index 0ec1ec8f330d..e098933df2de 100644 --- a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/singleton-local/layer-spec.xml +++ b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/singleton-local/layer-spec.xml @@ -20,7 +20,11 @@ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. --> - + + + + + diff --git a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/transactions/layer-spec.xml b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/transactions/layer-spec.xml index 733e65eaff2f..c3d98bba8bdf 100644 --- a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/transactions/layer-spec.xml +++ b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/transactions/layer-spec.xml @@ -1,5 +1,9 @@ - + + + + + diff --git a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/undertow-https/layer-spec.xml b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/undertow-https/layer-spec.xml index 8f832bcee80a..76dfb0888287 100644 --- a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/undertow-https/layer-spec.xml +++ b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/undertow-https/layer-spec.xml @@ -1,5 +1,9 @@ - + + + + + diff --git a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/undertow-load-balancer/layer-spec.xml b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/undertow-load-balancer/layer-spec.xml index 775a132fbb0c..191d39b0dac2 100644 --- a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/undertow-load-balancer/layer-spec.xml +++ b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/undertow-load-balancer/layer-spec.xml @@ -1,5 +1,10 @@ - + + + + + + diff --git a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/web-clustering/layer-spec.xml b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/web-clustering/layer-spec.xml index d15d43a25bb6..171b9c9fcbf8 100644 --- a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/web-clustering/layer-spec.xml +++ b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/web-clustering/layer-spec.xml @@ -1,5 +1,8 @@ - + + + + diff --git a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/web-console/layer-spec.xml b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/web-console/layer-spec.xml index 7a38c8ca48e9..2935ba17db39 100644 --- a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/web-console/layer-spec.xml +++ b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/web-console/layer-spec.xml @@ -1,5 +1,10 @@ - + + + + + + diff --git a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/web-passivation/layer-spec.xml b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/web-passivation/layer-spec.xml index fd5e8a29de7e..09c7716ae148 100644 --- a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/web-passivation/layer-spec.xml +++ b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/web-passivation/layer-spec.xml @@ -1,5 +1,8 @@ - + + + + diff --git a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/webservices/layer-spec.xml b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/webservices/layer-spec.xml index 79124e846c46..65d6c26c8446 100644 --- a/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/webservices/layer-spec.xml +++ b/ee-feature-pack/galleon-shared/src/main/resources/layers/standalone/webservices/layer-spec.xml @@ -1,5 +1,9 @@ - + + + + + diff --git a/ee-feature-pack/galleon-shared/src/main/resources/license/licenses.xml b/ee-feature-pack/galleon-shared/src/main/resources/license/licenses.xml index da70e3eed2d7..8db395c55ecd 100644 --- a/ee-feature-pack/galleon-shared/src/main/resources/license/licenses.xml +++ b/ee-feature-pack/galleon-shared/src/main/resources/license/licenses.xml @@ -1,50 +1,6 @@ - - com.amazonaws - aws-java-sdk-core - - - Apache License 2.0 - http://www.apache.org/licenses/LICENSE-2.0 - repo - - - - - com.amazonaws - aws-java-sdk-kms - - - Apache License 2.0 - http://www.apache.org/licenses/LICENSE-2.0 - repo - - - - - com.amazonaws - aws-java-sdk-s3 - - - Apache License 2.0 - http://www.apache.org/licenses/LICENSE-2.0 - repo - - - - - com.amazonaws - jmespath-java - - - Apache License 2.0 - http://www.apache.org/licenses/LICENSE-2.0 - repo - - - com.carrotsearch hppc @@ -100,17 +56,6 @@ - - com.fasterxml.jackson.dataformat - jackson-dataformat-cbor - - - Apache License 2.0 - http://www.apache.org/licenses/LICENSE-2.0 - repo - - - com.fasterxml.jackson.datatype jackson-datatype-jdk8 @@ -137,11 +82,11 @@ com.fasterxml.jackson.jakarta.rs jackson-jakarta-rs-base - - Apache License 2.0 - http://www.apache.org/licenses/LICENSE-2.0 - repo - + + Apache License 2.0 + http://www.apache.org/licenses/LICENSE-2.0 + repo + @@ -1381,32 +1326,6 @@ - - org.apache.avro - avro - - - Apache License 2.0 - http://www.apache.org/licenses/LICENSE-2.0 - repo - - - BSD 3-Clause "New" or "Revised" License - http://www.opensource.org/licenses/BSD-3-Clause - repo - - - FSF All Permissive License - http://www.gnu.org/prep/maintain/html_node/License-Notices-for-Other-Files.html - repo - - - MIT License - http://www.opensource.org/licenses/MIT - repo - - - org.apache.cxf cxf-core @@ -2225,8 +2144,8 @@ - org.glassfish.expressly - expressly + org.glassfish + jakarta.faces Eclipse Public License 2.0 @@ -2241,8 +2160,8 @@ - org.glassfish - jakarta.faces + org.glassfish.expressly + expressly Eclipse Public License 2.0 @@ -2803,6 +2722,17 @@ + + ${project.groupId} + jipijapa-hibernatesearch + + + GNU Lesser General Public License v2.1 or later + http://www.gnu.org/licenses/old-licenses/lgpl-2.1-standalone.html + repo + + + ${project.groupId} jipijapa-spi @@ -5083,8 +5013,217 @@ - software.amazon.ion - ion-java + software.amazon.awssdk + annotations + + + Apache License 2.0 + http://www.apache.org/licenses/LICENSE-2.0 + repo + + + + + software.amazon.awssdk + apache-client + + + Apache License 2.0 + http://www.apache.org/licenses/LICENSE-2.0 + repo + + + + + software.amazon.awssdk + arns + + + Apache License 2.0 + http://www.apache.org/licenses/LICENSE-2.0 + repo + + + + + software.amazon.awssdk + auth + + + Apache License 2.0 + http://www.apache.org/licenses/LICENSE-2.0 + repo + + + + + software.amazon.awssdk + aws-core + + + Apache License 2.0 + http://www.apache.org/licenses/LICENSE-2.0 + repo + + + + + software.amazon.awssdk + aws-query-protocol + + + Apache License 2.0 + http://www.apache.org/licenses/LICENSE-2.0 + repo + + + + + software.amazon.awssdk + aws-xml-protocol + + + Apache License 2.0 + http://www.apache.org/licenses/LICENSE-2.0 + repo + + + + + software.amazon.awssdk + crt-core + + + Apache License 2.0 + http://www.apache.org/licenses/LICENSE-2.0 + repo + + + + + software.amazon.awssdk + endpoints-spi + + + Apache License 2.0 + http://www.apache.org/licenses/LICENSE-2.0 + repo + + + + + software.amazon.awssdk + http-client-spi + + + Apache License 2.0 + http://www.apache.org/licenses/LICENSE-2.0 + repo + + + + + software.amazon.awssdk + json-utils + + + Apache License 2.0 + http://www.apache.org/licenses/LICENSE-2.0 + repo + + + + + software.amazon.awssdk + metrics-spi + + + Apache License 2.0 + http://www.apache.org/licenses/LICENSE-2.0 + repo + + + + + software.amazon.awssdk + profiles + + + Apache License 2.0 + http://www.apache.org/licenses/LICENSE-2.0 + repo + + + + + software.amazon.awssdk + protocol-core + + + Apache License 2.0 + http://www.apache.org/licenses/LICENSE-2.0 + repo + + + + + software.amazon.awssdk + regions + + + Apache License 2.0 + http://www.apache.org/licenses/LICENSE-2.0 + repo + + + + + software.amazon.awssdk + s3 + + + Apache License 2.0 + http://www.apache.org/licenses/LICENSE-2.0 + repo + + + + + software.amazon.awssdk + sdk-core + + + Apache License 2.0 + http://www.apache.org/licenses/LICENSE-2.0 + repo + + + + + software.amazon.awssdk + third-party-jackson-core + + + Apache License 2.0 + http://www.apache.org/licenses/LICENSE-2.0 + repo + + + + + software.amazon.awssdk + utils + + + Apache License 2.0 + http://www.apache.org/licenses/LICENSE-2.0 + repo + + + + + software.amazon.eventstream + eventstream Apache License 2.0 diff --git a/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/com/amazon/aws/core/main/module.xml b/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/com/amazon/aws/core/main/module.xml deleted file mode 100644 index 339d8359bc17..000000000000 --- a/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/com/amazon/aws/core/main/module.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/com/amazon/aws/s3/main/module.xml b/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/com/amazon/aws/s3/main/module.xml deleted file mode 100644 index bdb5dad0a835..000000000000 --- a/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/com/amazon/aws/s3/main/module.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/com/amazon/ion/main/module.xml b/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/com/amazon/ion/main/module.xml deleted file mode 100644 index 52e670fa4fae..000000000000 --- a/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/com/amazon/ion/main/module.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/com/fasterxml/jackson/dataformat/jackson-dataformat-cbor/main/module.xml b/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/com/fasterxml/jackson/dataformat/jackson-dataformat-cbor/main/module.xml deleted file mode 100644 index 1cc3c3164106..000000000000 --- a/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/com/fasterxml/jackson/dataformat/jackson-dataformat-cbor/main/module.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/com/sun/xml/messaging/saaj/main/module.xml b/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/com/sun/xml/messaging/saaj/main/module.xml index ea51458fc062..8de8e07935e4 100644 --- a/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/com/sun/xml/messaging/saaj/main/module.xml +++ b/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/com/sun/xml/messaging/saaj/main/module.xml @@ -40,7 +40,6 @@ - diff --git a/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/apache/activemq/artemis/main/module.xml b/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/apache/activemq/artemis/main/module.xml index 9b6054d5bd86..e727b3ed43ae 100644 --- a/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/apache/activemq/artemis/main/module.xml +++ b/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/apache/activemq/artemis/main/module.xml @@ -40,7 +40,16 @@ This module should not be directly depended upon by deployments. --> - + + diff --git a/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/apache/ws/security/main/module.xml b/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/apache/ws/security/main/module.xml index ef0d33049a3a..6aa83e791403 100644 --- a/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/apache/ws/security/main/module.xml +++ b/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/apache/ws/security/main/module.xml @@ -34,6 +34,7 @@ + diff --git a/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/glassfish/jaxb/main/module.xml b/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/glassfish/jaxb/main/module.xml index 57b40803ffe2..587b96b616de 100644 --- a/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/glassfish/jaxb/main/module.xml +++ b/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/glassfish/jaxb/main/module.xml @@ -42,7 +42,7 @@ - + diff --git a/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/hibernate/search/engine/main/module.xml b/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/hibernate/search/engine/main/module.xml index 9477e80cc250..4581c986cd8d 100644 --- a/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/hibernate/search/engine/main/module.xml +++ b/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/hibernate/search/engine/main/module.xml @@ -33,6 +33,7 @@ + diff --git a/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/com/amazon/aws/jmespath/main/module.xml b/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/hibernate/search/jipijapa-hibernatesearch/main/module.xml similarity index 74% rename from ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/com/amazon/aws/jmespath/main/module.xml rename to ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/hibernate/search/jipijapa-hibernatesearch/main/module.xml index 748ef0a7a198..f1579cf92b29 100644 --- a/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/com/amazon/aws/jmespath/main/module.xml +++ b/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/hibernate/search/jipijapa-hibernatesearch/main/module.xml @@ -2,7 +2,7 @@ - + - + - + + + + - diff --git a/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/hibernate/search/mapper/orm/main/module.xml b/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/hibernate/search/mapper/orm/main/module.xml index 81d95c3497ab..d99085ecb9f7 100644 --- a/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/hibernate/search/mapper/orm/main/module.xml +++ b/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/hibernate/search/mapper/orm/main/module.xml @@ -35,8 +35,10 @@ + + diff --git a/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/hibernate/search/mapper/pojo/main/module.xml b/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/hibernate/search/mapper/pojo/main/module.xml index a4dcc83841be..55278bc7bb64 100644 --- a/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/hibernate/search/mapper/pojo/main/module.xml +++ b/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/hibernate/search/mapper/pojo/main/module.xml @@ -30,6 +30,7 @@ + diff --git a/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/hibernate/validator/main/module.xml b/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/hibernate/validator/main/module.xml index a2dbf24ee4a2..32e32da711f3 100644 --- a/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/hibernate/validator/main/module.xml +++ b/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/hibernate/validator/main/module.xml @@ -41,6 +41,5 @@ - diff --git a/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/jboss/as/webservices/server/integration/main/module.xml b/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/jboss/as/webservices/server/integration/main/module.xml index e70f5fabf449..56ee732c77ec 100644 --- a/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/jboss/as/webservices/server/integration/main/module.xml +++ b/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/jboss/as/webservices/server/integration/main/module.xml @@ -80,7 +80,6 @@ - diff --git a/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/jboss/jts/main/module.xml b/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/jboss/jts/main/module.xml index 0ded1d628d9f..a8529b02df15 100644 --- a/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/jboss/jts/main/module.xml +++ b/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/jboss/jts/main/module.xml @@ -41,7 +41,20 @@ + diff --git a/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/jboss/resteasy/resteasy-jaxb-provider/main/module.xml b/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/jboss/resteasy/resteasy-jaxb-provider/main/module.xml index debe1b8f9d97..ae6c3eccfd3a 100644 --- a/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/jboss/resteasy/resteasy-jaxb-provider/main/module.xml +++ b/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/jboss/resteasy/resteasy-jaxb-provider/main/module.xml @@ -34,8 +34,6 @@ - - diff --git a/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/jboss/ws/common/main/module.xml b/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/jboss/ws/common/main/module.xml index 6896b77dfa3d..100054fa9997 100644 --- a/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/jboss/ws/common/main/module.xml +++ b/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/jboss/ws/common/main/module.xml @@ -43,7 +43,6 @@ - diff --git a/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/jgroups/aws/main/module.xml b/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/jgroups/aws/main/module.xml index eba0fd142189..b5951fecda8b 100644 --- a/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/jgroups/aws/main/module.xml +++ b/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/jgroups/aws/main/module.xml @@ -2,7 +2,7 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ee-feature-pack/pom.xml b/ee-feature-pack/pom.xml index a9c52b99e978..448342da5eac 100644 --- a/ee-feature-pack/pom.xml +++ b/ee-feature-pack/pom.xml @@ -34,7 +34,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-ee-feature-pack-parent diff --git a/ee-security/pom.xml b/ee-security/pom.xml index b0c6ccf065f3..dd34a2705577 100644 --- a/ee-security/pom.xml +++ b/ee-security/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-ee-security diff --git a/ee-security/src/main/java/org/wildfly/extension/eesecurity/EESecuritySubsystemSchema.java b/ee-security/src/main/java/org/wildfly/extension/eesecurity/EESecuritySubsystemSchema.java index fafe5bb20bde..68f5f51dcf7c 100644 --- a/ee-security/src/main/java/org/wildfly/extension/eesecurity/EESecuritySubsystemSchema.java +++ b/ee-security/src/main/java/org/wildfly/extension/eesecurity/EESecuritySubsystemSchema.java @@ -24,9 +24,9 @@ import static org.jboss.as.controller.PersistentResourceXMLDescription.builder; -import org.jboss.as.controller.LegacySubsystemURN; import org.jboss.as.controller.PersistentResourceXMLDescription; import org.jboss.as.controller.PersistentSubsystemSchema; +import org.jboss.as.controller.SubsystemSchema; import org.jboss.as.controller.xml.VersionedNamespace; import org.jboss.staxmapper.IntVersion; @@ -43,7 +43,7 @@ public enum EESecuritySubsystemSchema implements PersistentSubsystemSchema namespace; EESecuritySubsystemSchema(int major) { - this.namespace = new LegacySubsystemURN<>(EESecurityExtension.SUBSYSTEM_NAME, new IntVersion(major)); + this.namespace = SubsystemSchema.createLegacySubsystemURN(EESecurityExtension.SUBSYSTEM_NAME, new IntVersion(major)); } @Override diff --git a/ee/pom.xml b/ee/pom.xml index bf91812c8ad7..3e6eb4e2a89f 100644 --- a/ee/pom.xml +++ b/ee/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT ../pom.xml diff --git a/ee/src/main/java/org/jboss/as/ee/subsystem/GlobalDirectoryResourceDefinition.java b/ee/src/main/java/org/jboss/as/ee/subsystem/GlobalDirectoryResourceDefinition.java index 8bae5fe8ad21..64a66887f6b4 100644 --- a/ee/src/main/java/org/jboss/as/ee/subsystem/GlobalDirectoryResourceDefinition.java +++ b/ee/src/main/java/org/jboss/as/ee/subsystem/GlobalDirectoryResourceDefinition.java @@ -73,7 +73,7 @@ public class GlobalDirectoryResourceDefinition extends PersistentResourceDefinit static final SimpleAttributeDefinition[] ATTRIBUTES = new SimpleAttributeDefinition[]{PATH, RELATIVE_TO}; private static final AbstractAddStepHandler ADD = new GlobalDirectoryAddHandler(); - private static final AbstractRemoveStepHandler REMOVE = new ReloadRequiredRemoveStepHandler(); + private static final AbstractRemoveStepHandler REMOVE = ReloadRequiredRemoveStepHandler.INSTANCE; GlobalDirectoryResourceDefinition() { super(new SimpleResourceDefinition.Parameters(PathElement.pathElement(EESubsystemModel.GLOBAL_DIRECTORY), EeExtension.getResourceDescriptionResolver(EESubsystemModel.GLOBAL_DIRECTORY)) diff --git a/ee/src/test/java/org/jboss/as/ee/subsystem/EeLegacySubsystemTestCase.java b/ee/src/test/java/org/jboss/as/ee/subsystem/EeLegacySubsystemTestCase.java index 56752ce6ddef..8ca32bb5386f 100644 --- a/ee/src/test/java/org/jboss/as/ee/subsystem/EeLegacySubsystemTestCase.java +++ b/ee/src/test/java/org/jboss/as/ee/subsystem/EeLegacySubsystemTestCase.java @@ -182,7 +182,7 @@ protected void initializeExtraSubystemsAndModel(ExtensionRegistry extensionRegis PathElement bvExtension = PathElement.pathElement(EXTENSION, "org.wildfly.extension.bean-validation"); ManagementResourceRegistration extensionRegistration = rootRegistration.registerSubModel(new SimpleResourceDefinition(bvExtension, NonResolvingResourceDescriptionResolver.INSTANCE)); extensionRegistration.registerReadOnlyAttribute(new SimpleAttributeDefinitionBuilder("module", ModelType.STRING).setRequired(true).build(), null); - extensionRegistration.registerOperationHandler(removeExtension, new ReloadRequiredRemoveStepHandler()); + extensionRegistration.registerOperationHandler(removeExtension, ReloadRequiredRemoveStepHandler.INSTANCE); extensionRegistration.registerOperationHandler(addExtension, new ReloadRequiredAddStepHandler( new SimpleAttributeDefinitionBuilder("module", ModelType.STRING).setRequired(true).build())); @@ -195,7 +195,7 @@ protected void initializeExtraSubystemsAndModel(ExtensionRegistry extensionRegis PathElement bvSubsystem = PathElement.pathElement(SUBSYSTEM, "bean-validation"); ManagementResourceRegistration subsystemRegistration = rootRegistration.registerSubModel(new SimpleResourceDefinition(bvSubsystem, NonResolvingResourceDescriptionResolver.INSTANCE)); - subsystemRegistration.registerOperationHandler(removeSubsystem, new ReloadRequiredRemoveStepHandler()); + subsystemRegistration.registerOperationHandler(removeSubsystem, ReloadRequiredRemoveStepHandler.INSTANCE); subsystemRegistration.registerOperationHandler(addSubsystem, new ReloadRequiredAddStepHandler()); } diff --git a/ejb3/pom.xml b/ejb3/pom.xml index de7ae15ecfc7..721f88522870 100644 --- a/ejb3/pom.xml +++ b/ejb3/pom.xml @@ -35,7 +35,7 @@ vi:ts=4:sw=4:expandtab Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT ../pom.xml diff --git a/ejb3/src/main/java/org/jboss/as/ejb3/clustering/ClusteringSchema.java b/ejb3/src/main/java/org/jboss/as/ejb3/clustering/ClusteringSchema.java index 6fe4e18c1f04..e376175151d8 100644 --- a/ejb3/src/main/java/org/jboss/as/ejb3/clustering/ClusteringSchema.java +++ b/ejb3/src/main/java/org/jboss/as/ejb3/clustering/ClusteringSchema.java @@ -22,15 +22,16 @@ package org.jboss.as.ejb3.clustering; +import java.util.List; + +import org.jboss.as.controller.xml.IntVersionSchema; import org.jboss.as.controller.xml.VersionedNamespace; -import org.jboss.as.controller.xml.VersionedSchema; -import org.jboss.as.controller.xml.VersionedURN; import org.jboss.staxmapper.IntVersion; /** * @author Paul Ferraro */ -public enum ClusteringSchema implements VersionedSchema { +public enum ClusteringSchema implements IntVersionSchema { VERSION_1_0(1, 0), VERSION_1_1(1, 1), @@ -40,7 +41,7 @@ public enum ClusteringSchema implements VersionedSchema namespace; ClusteringSchema(int major, int minor) { - this.namespace = new VersionedURN<>(this.getLocalName(), new IntVersion(major, minor)); + this.namespace = IntVersionSchema.createURN(List.of(this.getLocalName()), new IntVersion(major, minor)); } @Override diff --git a/ejb3/src/main/java/org/jboss/as/ejb3/deployment/processors/MessageDrivenComponentDescriptionFactory.java b/ejb3/src/main/java/org/jboss/as/ejb3/deployment/processors/MessageDrivenComponentDescriptionFactory.java index becb44e51ba0..b4e27b2fcc7c 100644 --- a/ejb3/src/main/java/org/jboss/as/ejb3/deployment/processors/MessageDrivenComponentDescriptionFactory.java +++ b/ejb3/src/main/java/org/jboss/as/ejb3/deployment/processors/MessageDrivenComponentDescriptionFactory.java @@ -118,16 +118,7 @@ private void processMessageBeans(final DeploymentUnit deploymentUnit, final Coll deploymentDescriptorEnvironment = new DeploymentDescriptorEnvironment("java:comp/env/", beanMetaData); messagingType = beanMetaData.getMessagingType(); - final ActivationConfigMetaData activationConfigMetaData = beanMetaData.getActivationConfig(); - if (activationConfigMetaData != null) { - final ActivationConfigPropertiesMetaData propertiesMetaData = activationConfigMetaData - .getActivationConfigProperties(); - if (propertiesMetaData != null) { - for (final ActivationConfigPropertyMetaData propertyMetaData : propertiesMetaData) { - activationConfigProperties.put(propertyMetaData.getKey(), propertyMetaData.getValue()); - } - } - } + activationConfigProperties.putAll(getActivationConfigProperties(beanMetaData)); messageListenerInterfaceName = messagingType != null ? messagingType : getMessageListenerInterface(compositeIndex, messageBeanAnnotation, deploymentUnit); } else { @@ -181,22 +172,34 @@ private String getMessageListenerInterface(final CompositeIndex compositeIndex, return interfaces.iterator().next().toString(); } - private Properties getActivationConfigProperties(final ActivationConfigMetaData activationConfig) { + private Properties getActivationConfigProperties(final MessageDrivenBeanMetaData mdb) { final Properties activationConfigProps = new Properties(); - if (activationConfig == null || activationConfig.getActivationConfigProperties() == null) { - return activationConfigProps; - } - final ActivationConfigPropertiesMetaData activationConfigPropertiesMetaData = activationConfig.getActivationConfigProperties(); - for (ActivationConfigPropertyMetaData activationConfigProp : activationConfigPropertiesMetaData) { - if (activationConfigProp == null) { - continue; - } - final String propName = activationConfigProp.getActivationConfigPropertyName(); - final String propValue = activationConfigProp.getValue(); - if (propName != null) { - activationConfigProps.put(propName, propValue); + final ActivationConfigMetaData activationConfig = mdb.getActivationConfig(); + if (activationConfig != null && activationConfig.getActivationConfigProperties() != null) { + final ActivationConfigPropertiesMetaData activationConfigPropertiesMetaData = activationConfig.getActivationConfigProperties(); + for (ActivationConfigPropertyMetaData activationConfigProp : activationConfigPropertiesMetaData) { + if (activationConfigProp == null) { + continue; + } + final String propName = activationConfigProp.getActivationConfigPropertyName(); + final String propValue = activationConfigProp.getValue(); + if (propName != null) { + activationConfigProps.put(propName, propValue); + } } } + if (mdb.getAcknowledgeMode() != null && !mdb.getAcknowledgeMode().isBlank()) { + activationConfigProps.put("acknowledgeMode", mdb.getAcknowledgeMode()); + } + if (mdb.getMessageDestinationType() != null && !mdb.getMessageDestinationType().isBlank()) { + activationConfigProps.put("destinationType", mdb.getMessageDestinationType()); + } + if (mdb.getMessageSelector() != null && !mdb.getMessageSelector().isBlank()) { + activationConfigProps.put("messageSelector", mdb.getMessageSelector()); + } + if (mdb.getSubscriptionDurability() != null) { + activationConfigProps.put("subscriptionDurability", mdb.getSubscriptionDurability().toString()); + } return activationConfigProps; } @@ -209,7 +212,7 @@ private void processMessageDrivenBeanMetaData(final DeploymentUnit deploymentUni // TODO: This isn't really correct to default to MessageListener messageListenerInterface = MessageListener.class.getName(); } - final Properties activationConfigProps = getActivationConfigProperties(mdb.getActivationConfig()); + final Properties activationConfigProps = getActivationConfigProperties(mdb); final String defaultResourceAdapterName = this.getDefaultResourceAdapterName(deploymentUnit.getServiceRegistry()); final MessageDrivenComponentDescription mdbComponentDescription = new MessageDrivenComponentDescription(beanName, beanClassName, ejbJarDescription, deploymentUnit, messageListenerInterface, activationConfigProps, defaultResourceAdapterName, mdb, defaultMdbPoolAvailable); mdbComponentDescription.setDeploymentDescriptorEnvironment(new DeploymentDescriptorEnvironment("java:comp/env/", mdb)); diff --git a/ejb3/src/main/java/org/jboss/as/ejb3/logging/EjbLogger.java b/ejb3/src/main/java/org/jboss/as/ejb3/logging/EjbLogger.java index ceac91887c87..1fb28694deaf 100644 --- a/ejb3/src/main/java/org/jboss/as/ejb3/logging/EjbLogger.java +++ b/ejb3/src/main/java/org/jboss/as/ejb3/logging/EjbLogger.java @@ -325,7 +325,7 @@ public interface EjbLogger extends BasicLogger { */ @LogMessage(level = WARN) @Message(id = 26, value = "Could not read timer information for Jakarta Enterprise Beans component %s") - void failToReadTimerInformation(String componentName); + void failToReadTimerInformation(String componentName, @Cause Throwable cause); // /** // * Logs an error message indicating it could not remove persistent timer diff --git a/ejb3/src/main/java/org/jboss/as/ejb3/subsystem/MdbDeliveryGroupResourceDefinition.java b/ejb3/src/main/java/org/jboss/as/ejb3/subsystem/MdbDeliveryGroupResourceDefinition.java index 2ad61865a8e0..2774ac6e59c4 100644 --- a/ejb3/src/main/java/org/jboss/as/ejb3/subsystem/MdbDeliveryGroupResourceDefinition.java +++ b/ejb3/src/main/java/org/jboss/as/ejb3/subsystem/MdbDeliveryGroupResourceDefinition.java @@ -56,7 +56,7 @@ public class MdbDeliveryGroupResourceDefinition extends SimpleResourceDefinition MdbDeliveryGroupResourceDefinition() { super(new SimpleResourceDefinition.Parameters(EJB3SubsystemModel.MDB_DELIVERY_GROUP_PATH, EJB3Extension.getResourceDescriptionResolver(EJB3SubsystemModel.MDB_DELIVERY_GROUP)) .setAddHandler(MdbDeliveryGroupAdd.INSTANCE) - .setRemoveHandler(new ReloadRequiredRemoveStepHandler()) + .setRemoveHandler(ReloadRequiredRemoveStepHandler.INSTANCE) .setCapabilities(MDB_DELIVERY_GROUP_CAPABILITY)); } diff --git a/ejb3/src/main/java/org/jboss/as/ejb3/subsystem/deployment/AbstractEJBComponentResourceDefinition.java b/ejb3/src/main/java/org/jboss/as/ejb3/subsystem/deployment/AbstractEJBComponentResourceDefinition.java index e55cae631195..cc4fff757443 100644 --- a/ejb3/src/main/java/org/jboss/as/ejb3/subsystem/deployment/AbstractEJBComponentResourceDefinition.java +++ b/ejb3/src/main/java/org/jboss/as/ejb3/subsystem/deployment/AbstractEJBComponentResourceDefinition.java @@ -22,9 +22,17 @@ package org.jboss.as.ejb3.subsystem.deployment; +import static org.jboss.as.ejb3.subsystem.deployment.TimerResourceDefinition.CALENDAR_TIMER; +import static org.jboss.as.ejb3.subsystem.deployment.TimerResourceDefinition.INFO; +import static org.jboss.as.ejb3.subsystem.deployment.TimerResourceDefinition.NEXT_TIMEOUT; +import static org.jboss.as.ejb3.subsystem.deployment.TimerResourceDefinition.PERSISTENT; +import static org.jboss.as.ejb3.subsystem.deployment.TimerResourceDefinition.SCHEDULE; +import static org.jboss.as.ejb3.subsystem.deployment.TimerResourceDefinition.TIME_REMAINING; + import java.util.Map; import org.jboss.as.controller.AttributeDefinition; +import org.jboss.as.controller.ObjectListAttributeDefinition; import org.jboss.as.controller.ObjectMapAttributeDefinition; import org.jboss.as.controller.ObjectTypeAttributeDefinition; import org.jboss.as.controller.OperationContext; @@ -157,6 +165,15 @@ public abstract class AbstractEJBComponentResourceDefinition extends SimpleResou public static final SimpleAttributeDefinition POOL_MAX_SIZE = new SimpleAttributeDefinitionBuilder("pool-max-size", ModelType.INT, false) .setFlags(AttributeAccess.Flag.STORAGE_RUNTIME).build(); + static final ObjectTypeAttributeDefinition TIMER = new ObjectTypeAttributeDefinition.Builder("timer", + TIME_REMAINING, NEXT_TIMEOUT, CALENDAR_TIMER, PERSISTENT, INFO, new ObjectTypeAttributeDefinition.Builder(SCHEDULE.getName(), SCHEDULE.getValueTypes()).setSuffix("schedule").build()) + .setStorageRuntime() + .build(); + + static final ObjectListAttributeDefinition TIMERS = new ObjectListAttributeDefinition.Builder("timers", TIMER) + .setStorageRuntime() + .build(); + final EJBComponentType componentType; public AbstractEJBComponentResourceDefinition(final EJBComponentType componentType) { @@ -182,7 +199,7 @@ public void registerAttributes(ManagementResourceRegistration resourceRegistrati } if (componentType.hasTimer()) { - resourceRegistration.registerReadOnlyAttribute(TimerAttributeDefinition.INSTANCE, handler); + resourceRegistration.registerReadOnlyAttribute(TIMERS, handler); resourceRegistration.registerReadOnlyAttribute(TIMEOUT_METHOD, handler); } diff --git a/ejb3/src/main/java/org/jboss/as/ejb3/subsystem/deployment/AbstractEJBComponentRuntimeHandler.java b/ejb3/src/main/java/org/jboss/as/ejb3/subsystem/deployment/AbstractEJBComponentRuntimeHandler.java index f46ef12fdc2c..c9c7287f0112 100644 --- a/ejb3/src/main/java/org/jboss/as/ejb3/subsystem/deployment/AbstractEJBComponentRuntimeHandler.java +++ b/ejb3/src/main/java/org/jboss/as/ejb3/subsystem/deployment/AbstractEJBComponentRuntimeHandler.java @@ -23,6 +23,7 @@ package org.jboss.as.ejb3.subsystem.deployment; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.VALUE; +import static org.jboss.as.ejb3.logging.EjbLogger.ROOT_LOGGER; import static org.jboss.as.ejb3.subsystem.deployment.AbstractEJBComponentResourceDefinition.ASYNC_METHODS; import static org.jboss.as.ejb3.subsystem.deployment.AbstractEJBComponentResourceDefinition.BUSINESS_LOCAL; import static org.jboss.as.ejb3.subsystem.deployment.AbstractEJBComponentResourceDefinition.BUSINESS_REMOTE; @@ -38,15 +39,40 @@ import static org.jboss.as.ejb3.subsystem.deployment.AbstractEJBComponentResourceDefinition.RUN_AS_ROLE; import static org.jboss.as.ejb3.subsystem.deployment.AbstractEJBComponentResourceDefinition.SECURITY_DOMAIN; import static org.jboss.as.ejb3.subsystem.deployment.AbstractEJBComponentResourceDefinition.TIMEOUT_METHOD; +import static org.jboss.as.ejb3.subsystem.deployment.AbstractEJBComponentResourceDefinition.TIMERS; import static org.jboss.as.ejb3.subsystem.deployment.AbstractEJBComponentResourceDefinition.TRANSACTION_TYPE; +import static org.jboss.as.ejb3.subsystem.deployment.TimerResourceDefinition.CALENDAR_TIMER; +import static org.jboss.as.ejb3.subsystem.deployment.TimerResourceDefinition.DAY_OF_MONTH; +import static org.jboss.as.ejb3.subsystem.deployment.TimerResourceDefinition.DAY_OF_WEEK; +import static org.jboss.as.ejb3.subsystem.deployment.TimerResourceDefinition.END; +import static org.jboss.as.ejb3.subsystem.deployment.TimerResourceDefinition.HOUR; +import static org.jboss.as.ejb3.subsystem.deployment.TimerResourceDefinition.INFO; +import static org.jboss.as.ejb3.subsystem.deployment.TimerResourceDefinition.MINUTE; +import static org.jboss.as.ejb3.subsystem.deployment.TimerResourceDefinition.MONTH; +import static org.jboss.as.ejb3.subsystem.deployment.TimerResourceDefinition.NEXT_TIMEOUT; +import static org.jboss.as.ejb3.subsystem.deployment.TimerResourceDefinition.PERSISTENT; +import static org.jboss.as.ejb3.subsystem.deployment.TimerResourceDefinition.SCHEDULE; +import static org.jboss.as.ejb3.subsystem.deployment.TimerResourceDefinition.SECOND; +import static org.jboss.as.ejb3.subsystem.deployment.TimerResourceDefinition.START; +import static org.jboss.as.ejb3.subsystem.deployment.TimerResourceDefinition.TIMEZONE; +import static org.jboss.as.ejb3.subsystem.deployment.TimerResourceDefinition.TIME_REMAINING; +import static org.jboss.as.ejb3.subsystem.deployment.TimerResourceDefinition.YEAR; +import java.io.Serializable; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.Collections; +import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; + +import jakarta.ejb.EJBException; +import jakarta.ejb.NoSuchObjectLocalException; +import jakarta.ejb.ScheduleExpression; +import jakarta.ejb.Timer; +import jakarta.ejb.TimerService; import jakarta.ejb.TransactionManagementType; import org.jboss.as.controller.AbstractRuntimeOnlyHandler; @@ -63,6 +89,7 @@ import org.jboss.as.ejb3.logging.EjbLogger; import org.jboss.as.ejb3.pool.Pool; import org.jboss.as.ejb3.security.EJBSecurityMetaData; +import org.jboss.as.ejb3.timerservice.TimerImpl; import org.jboss.dmr.ModelNode; import org.jboss.invocation.proxy.MethodIdentifier; import org.jboss.metadata.ejb.spec.MethodInterfaceType; @@ -174,8 +201,8 @@ protected void executeReadAttribute(final String attributeName, final OperationC } } } - } else if (componentType.hasTimer() && TimerAttributeDefinition.INSTANCE.getName().equals(attributeName)) { - TimerAttributeDefinition.addTimers(component, result); + } else if (componentType.hasTimer() && TIMERS.getName().equals(attributeName)) { + addTimers(component, result); } else if (hasPool && POOL_AVAILABLE_COUNT.getName().equals(attributeName)) { final Pool pool = componentType.getPool(component); if (pool != null) { @@ -321,4 +348,136 @@ protected String resolveRuntimeName(final OperationContext context, final PathEl .get(ModelDescriptionConstants.RUNTIME_NAME); return runtimeName.asString(); } + + private static void addTimers(final EJBComponent ejb, final ModelNode response) { + response.setEmptyList(); + final String name = ejb.getComponentName(); + TimerService ts = ejb.getTimerService(); + if (ts != null) { + for (Timer timer : ts.getTimers()) { + ModelNode timerNode = response.add(); + addTimeRemaining(timer, timerNode, name); + addNextTimeout(timer, timerNode, name); + addCalendarTimer(timer, timerNode, name); + addPersistent(timer, timerNode, name); + addInfo(timer, timerNode, name); + addSchedule(timer, timerNode, name); + } + } + } + + private static void addTimeRemaining(Timer timer, ModelNode timerNode, final String componentName) { + try { + final ModelNode detailNode = timerNode.get(TIME_REMAINING.getName()); + long time = timer.getTimeRemaining(); + detailNode.set(time); + } catch (IllegalStateException e) { + // ignore + } catch (NoSuchObjectLocalException e) { + // ignore + } catch (EJBException e) { + logTimerFailure(componentName, e); + } + } + + private static void addNextTimeout(Timer timer, ModelNode timerNode, final String componentName) { + try { + final ModelNode detailNode = timerNode.get(NEXT_TIMEOUT.getName()); + Date d = timer.getNextTimeout(); + if (d != null) { + detailNode.set(d.getTime()); + } + } catch (IllegalStateException e) { + // ignore + } catch (NoSuchObjectLocalException e) { + // ignore + } catch (EJBException e) { + logTimerFailure(componentName, e); + } + } + + private static void addSchedule(Timer timer, ModelNode timerNode, final String componentName) { + try { + final ModelNode schedNode = timerNode.get(SCHEDULE.getName()); + ScheduleExpression sched = timer.getSchedule(); + addScheduleDetailString(schedNode, sched.getYear(), YEAR.getName()); + addScheduleDetailString(schedNode, sched.getMonth(), MONTH.getName()); + addScheduleDetailString(schedNode, sched.getDayOfMonth(), DAY_OF_MONTH.getName()); + addScheduleDetailString(schedNode, sched.getDayOfWeek(), DAY_OF_WEEK.getName()); + addScheduleDetailString(schedNode, sched.getHour(), HOUR.getName()); + addScheduleDetailString(schedNode, sched.getMinute(), MINUTE.getName()); + addScheduleDetailString(schedNode, sched.getSecond(), SECOND.getName()); + addScheduleDetailString(schedNode, sched.getTimezone(), TIMEZONE.getName()); + addScheduleDetailDate(schedNode, sched.getStart(), START.getName()); + addScheduleDetailDate(schedNode, sched.getEnd(), END.getName()); + } catch (IllegalStateException e) { + // ignore + } catch (NoSuchObjectLocalException e) { + // ignore + } catch (EJBException e) { + logTimerFailure(componentName, e); + } + } + + private static void addCalendarTimer(Timer timer, ModelNode timerNode, final String componentName) { + try { + final ModelNode detailNode = timerNode.get(CALENDAR_TIMER.getName()); + boolean b = timer.isCalendarTimer(); + detailNode.set(b); + } catch (IllegalStateException e) { + // ignore + } catch (NoSuchObjectLocalException e) { + // ignore + } catch (EJBException e) { + logTimerFailure(componentName, e); + } + } + + private static void addPersistent(Timer timer, ModelNode timerNode, final String componentName) { + try { + final ModelNode detailNode = timerNode.get(PERSISTENT.getName()); + boolean b = timer.isPersistent(); + detailNode.set(b); + } catch (IllegalStateException e) { + // ignore + } catch (NoSuchObjectLocalException e) { + // ignore + } catch (EJBException e) { + logTimerFailure(componentName, e); + } + } + + private static void addInfo(Timer timer, ModelNode timerNode, final String componentName) { + try { + final Serializable info = (timer instanceof TimerImpl) ? ((TimerImpl) timer).getCachedTimerInfo() : timer.getInfo(); + if (info != null) { + final ModelNode detailNode = timerNode.get(INFO.getName()); + detailNode.set(info.toString()); + } + } catch (IllegalStateException e) { + // ignore + } catch (NoSuchObjectLocalException e) { + // ignore + } catch (EJBException e) { + logTimerFailure(componentName, e); + } + } + + private static void addScheduleDetailString(ModelNode schedNode, String value, String detailName) { + final ModelNode node = schedNode.get(detailName); + if (value != null) { + node.set(value); + } + } + + private static void addScheduleDetailDate(ModelNode schedNode, Date value, String detailName) { + final ModelNode node = schedNode.get(detailName); + if (value != null) { + node.set(value.getTime()); + } + } + + private static void logTimerFailure(final String componentName, final EJBException e) { + ROOT_LOGGER.failToReadTimerInformation(componentName, e); + } } diff --git a/ejb3/src/main/java/org/jboss/as/ejb3/subsystem/deployment/TimerAttributeDefinition.java b/ejb3/src/main/java/org/jboss/as/ejb3/subsystem/deployment/TimerAttributeDefinition.java deleted file mode 100644 index 07828367dec1..000000000000 --- a/ejb3/src/main/java/org/jboss/as/ejb3/subsystem/deployment/TimerAttributeDefinition.java +++ /dev/null @@ -1,286 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2011, Red Hat, Inc., and individual contributors - * as indicated by the @author tags. See the copyright.txt file in the - * distribution for a full listing of individual contributors. - * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ - -package org.jboss.as.ejb3.subsystem.deployment; - - -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.DESCRIPTION; -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.NILLABLE; -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.TYPE; -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.UNIT; -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.VALUE_TYPE; -import static org.jboss.as.ejb3.logging.EjbLogger.ROOT_LOGGER; - -import java.io.Serializable; -import java.util.Date; -import java.util.Locale; -import java.util.ResourceBundle; -import jakarta.ejb.EJBException; -import jakarta.ejb.NoSuchObjectLocalException; -import jakarta.ejb.ScheduleExpression; -import jakarta.ejb.Timer; -import jakarta.ejb.TimerService; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamWriter; - -import org.jboss.as.controller.ListAttributeDefinition; -import org.jboss.as.controller.ObjectListAttributeDefinition; -import org.jboss.as.controller.client.helpers.MeasurementUnit; -import org.jboss.as.controller.descriptions.ModelDescriptionConstants; -import org.jboss.as.controller.descriptions.ResourceDescriptionResolver; -import org.jboss.as.controller.operations.validation.ModelTypeValidator; -import org.jboss.as.ejb3.component.EJBComponent; -import org.jboss.as.ejb3.logging.EjbLogger; -import org.jboss.as.ejb3.timerservice.TimerImpl; -import org.jboss.dmr.ModelNode; -import org.jboss.dmr.ModelType; -/** - * Attribute definition for the list of timers associated with an Jakarta Enterprise Beans. - * - * @author Brian Stansberry (c) 2011 Red Hat Inc. - */ -// TODO Convert to ObjectListAttributeDefinition -public class TimerAttributeDefinition extends ListAttributeDefinition { - - public static final TimerAttributeDefinition INSTANCE = new TimerAttributeDefinition.Builder().build(); - - public static final String TIME_REMAINING = "time-remaining"; - public static final String NEXT_TIMEOUT = "next-timeout"; - public static final String CALENDAR_TIMER = "calendar-timer"; - public static final String PERSISTENT = "persistent"; - public static final String INFO = "info"; - public static final String SCHEDULE = "schedule"; - public static final String DAY_OF_MONTH = "day-of-month"; - public static final String DAY_OF_WEEK = "day-of-week"; - public static final String HOUR = "hour"; - public static final String MINUTE = "minute"; - public static final String SECOND = "second"; - public static final String MONTH = "month"; - public static final String YEAR = "year"; - public static final String TIMEZONE = "timezone"; - public static final String START = "start"; - public static final String END = "end"; - - private TimerAttributeDefinition(Builder builder) { - super(builder); - } - public static final class Builder extends ListAttributeDefinition.Builder{ - public Builder() { - super("timers", false); - } - - @Override - public TimerAttributeDefinition build() { - setValidator(new ModelTypeValidator(ModelType.OBJECT)); - setStorageRuntime(); - - return new TimerAttributeDefinition(this); - } - } - - - @Override - protected void addValueTypeDescription(ModelNode node, ResourceBundle bundle) { - throw EjbLogger.ROOT_LOGGER.resourceBundleDescriptionsNotSupported(getName()); - } - - @Override - protected void addAttributeValueTypeDescription(ModelNode node, ResourceDescriptionResolver resolver, Locale locale, ResourceBundle bundle) { - addValueTypeDescription(node, resolver, locale, bundle); - } - - @Override - protected void addOperationParameterValueTypeDescription(ModelNode node, String operationName, ResourceDescriptionResolver resolver, Locale locale, ResourceBundle bundle) { - addValueTypeDescription(node, resolver, locale, bundle); - } - - @Override - public void marshallAsElement(ModelNode resourceModel, final boolean marshalDefault, XMLStreamWriter writer) throws XMLStreamException { - throw EjbLogger.ROOT_LOGGER.runtimeAttributeNotMarshallable(getName()); - } - - private void addValueTypeDescription(ModelNode node, ResourceDescriptionResolver resolver, Locale locale, ResourceBundle bundle) { - final ModelNode valueTypeNode = node.get(ModelDescriptionConstants.VALUE_TYPE); - addAttributeDescription(resolver, locale, bundle, valueTypeNode, ModelType.LONG, true, MeasurementUnit.MILLISECONDS, TIME_REMAINING); - addAttributeDescription(resolver, locale, bundle, valueTypeNode, ModelType.LONG, true, MeasurementUnit.EPOCH_MILLISECONDS, NEXT_TIMEOUT); - addAttributeDescription(resolver, locale, bundle, valueTypeNode, ModelType.BOOLEAN, true, null, CALENDAR_TIMER); - addAttributeDescription(resolver, locale, bundle, valueTypeNode, ModelType.BOOLEAN, true, null, PERSISTENT); - addAttributeDescription(resolver, locale, bundle, valueTypeNode, ModelType.STRING, true, null, INFO); - final ModelNode sched = addAttributeDescription(resolver, locale, bundle, valueTypeNode, ModelType.OBJECT, true, null, SCHEDULE); - final ModelNode schedValType = sched.get(VALUE_TYPE); - addAttributeDescription(resolver, locale, bundle, schedValType, ModelType.STRING, true, null, SCHEDULE, YEAR); - addAttributeDescription(resolver, locale, bundle, schedValType, ModelType.STRING, true, null, SCHEDULE, MONTH); - addAttributeDescription(resolver, locale, bundle, schedValType, ModelType.STRING, true, null, SCHEDULE, DAY_OF_MONTH); - addAttributeDescription(resolver, locale, bundle, schedValType, ModelType.STRING, true, null, SCHEDULE, DAY_OF_WEEK); - addAttributeDescription(resolver, locale, bundle, schedValType, ModelType.STRING, true, null, SCHEDULE, HOUR); - addAttributeDescription(resolver, locale, bundle, schedValType, ModelType.STRING, true, null, SCHEDULE, MINUTE); - addAttributeDescription(resolver, locale, bundle, schedValType, ModelType.STRING, true, null, SCHEDULE, SECOND); - addAttributeDescription(resolver, locale, bundle, schedValType, ModelType.STRING, true, null, SCHEDULE, TIMEZONE); - addAttributeDescription(resolver, locale, bundle, schedValType, ModelType.LONG, true, MeasurementUnit.EPOCH_MILLISECONDS, SCHEDULE, START); - addAttributeDescription(resolver, locale, bundle, schedValType, ModelType.LONG, true, MeasurementUnit.EPOCH_MILLISECONDS, SCHEDULE, END); - } - - private ModelNode addAttributeDescription(final ResourceDescriptionResolver resolver, final Locale locale, final ResourceBundle bundle, - final ModelNode node, final ModelType type, final boolean nillable, - final MeasurementUnit measurementUnit, final String... suffixes) { - final ModelNode valNode = node.get(suffixes[suffixes.length -1]); - valNode.get(DESCRIPTION).set(resolver.getResourceAttributeValueTypeDescription(getName(), locale, bundle, suffixes)); - valNode.get(TYPE).set(type); - valNode.get(NILLABLE).set(nillable); - if (measurementUnit != null) { - valNode.get(UNIT).set(measurementUnit.getName()); - } - return valNode; - } - - public static void addTimers(final EJBComponent ejb, final ModelNode response) { - response.setEmptyList(); - final String name = ejb.getComponentName(); - TimerService ts = ejb.getTimerService(); - if (ts != null) { - for (Timer timer : ts.getTimers()) { - ModelNode timerNode = response.add(); - addTimeRemaining(timer, timerNode, name); - addNextTimeout(timer, timerNode, name); - addCalendarTimer(timer, timerNode, name); - addPersistent(timer, timerNode, name); - addInfo(timer, timerNode, name); - addSchedule(timer, timerNode, name); - } - } - } - - private static void addTimeRemaining(Timer timer, ModelNode timerNode, final String componentName) { - try { - final ModelNode detailNode = timerNode.get(TIME_REMAINING); - long time = timer.getTimeRemaining(); - detailNode.set(time); - } catch (IllegalStateException e) { - // ignore - } catch (NoSuchObjectLocalException e) { - // ignore - } catch (EJBException e) { - logTimerFailure(componentName, e); - } - } - - private static void addNextTimeout(Timer timer, ModelNode timerNode, final String componentName) { - try { - final ModelNode detailNode = timerNode.get(NEXT_TIMEOUT); - Date d = timer.getNextTimeout(); - if (d != null) { - detailNode.set(d.getTime()); - } - } catch (IllegalStateException e) { - // ignore - } catch (NoSuchObjectLocalException e) { - // ignore - } catch (EJBException e) { - logTimerFailure(componentName, e); - } - } - - private static void addSchedule(Timer timer, ModelNode timerNode, final String componentName) { - try { - final ModelNode schedNode = timerNode.get(SCHEDULE); - ScheduleExpression sched = timer.getSchedule(); - addScheduleDetailString(schedNode, sched.getYear(), YEAR); - addScheduleDetailString(schedNode, sched.getMonth(), MONTH); - addScheduleDetailString(schedNode, sched.getDayOfMonth(), DAY_OF_MONTH); - addScheduleDetailString(schedNode, sched.getDayOfWeek(), DAY_OF_WEEK); - addScheduleDetailString(schedNode, sched.getHour(), HOUR); - addScheduleDetailString(schedNode, sched.getMinute(), MINUTE); - addScheduleDetailString(schedNode, sched.getSecond(), SECOND); - addScheduleDetailString(schedNode, sched.getTimezone(), TIMEZONE); - addScheduleDetailDate(schedNode, sched.getStart(), START); - addScheduleDetailDate(schedNode, sched.getEnd(), END); - } catch (IllegalStateException e) { - // ignore - } catch (NoSuchObjectLocalException e) { - // ignore - } catch (EJBException e) { - logTimerFailure(componentName, e); - } - } - - private static void addCalendarTimer(Timer timer, ModelNode timerNode, final String componentName) { - try { - final ModelNode detailNode = timerNode.get(CALENDAR_TIMER); - boolean b = timer.isCalendarTimer(); - detailNode.set(b); - } catch (IllegalStateException e) { - // ignore - } catch (NoSuchObjectLocalException e) { - // ignore - } catch (EJBException e) { - logTimerFailure(componentName, e); - } - } - - private static void addPersistent(Timer timer, ModelNode timerNode, final String componentName) { - try { - final ModelNode detailNode = timerNode.get(PERSISTENT); - boolean b = timer.isPersistent(); - detailNode.set(b); - } catch (IllegalStateException e) { - // ignore - } catch (NoSuchObjectLocalException e) { - // ignore - } catch (EJBException e) { - logTimerFailure(componentName, e); - } - } - - private static void addInfo(Timer timer, ModelNode timerNode, final String componentName) { - try { - final Serializable info = (timer instanceof TimerImpl) ? ((TimerImpl) timer).getCachedTimerInfo() : timer.getInfo(); - if (info != null) { - final ModelNode detailNode = timerNode.get(INFO); - detailNode.set(info.toString()); - } - } catch (IllegalStateException e) { - // ignore - } catch (NoSuchObjectLocalException e) { - // ignore - } catch (EJBException e) { - logTimerFailure(componentName, e); - } - } - - private static void addScheduleDetailString(ModelNode schedNode, String value, String detailName) { - final ModelNode node = schedNode.get(detailName); - if (value != null) { - node.set(value); - } - } - - private static void addScheduleDetailDate(ModelNode schedNode, Date value, String detailName) { - final ModelNode node = schedNode.get(detailName); - if (value != null) { - node.set(value.getTime()); - } - } - - private static void logTimerFailure(final String componentName, final EJBException e) { - ROOT_LOGGER.failToReadTimerInformation(componentName); - } -} diff --git a/ejb3/src/main/java/org/jboss/as/ejb3/subsystem/deployment/TimerResourceDefinition.java b/ejb3/src/main/java/org/jboss/as/ejb3/subsystem/deployment/TimerResourceDefinition.java index 97530c452a2a..fa65cdcccb73 100644 --- a/ejb3/src/main/java/org/jboss/as/ejb3/subsystem/deployment/TimerResourceDefinition.java +++ b/ejb3/src/main/java/org/jboss/as/ejb3/subsystem/deployment/TimerResourceDefinition.java @@ -29,7 +29,6 @@ import jakarta.ejb.ScheduleExpression; import org.jboss.as.controller.ModelVersion; -import org.jboss.as.controller.ObjectListAttributeDefinition; import org.jboss.as.controller.ObjectTypeAttributeDefinition; import org.jboss.as.controller.OperationContext; import org.jboss.as.controller.OperationDefinition; @@ -63,20 +62,20 @@ public class TimerResourceDefinition extends SimpleResou private static final ResourceDescriptionResolver RESOURCE_DESCRIPTION_RESOLVER = EJB3Extension .getResourceDescriptionResolver(EJB3SubsystemModel.TIMER); - // attributes, copy of TimerAttributeDefinition - private static final SimpleAttributeDefinition TIME_REMAINING = new SimpleAttributeDefinitionBuilder("time-remaining", + + static final SimpleAttributeDefinition TIME_REMAINING = new SimpleAttributeDefinitionBuilder("time-remaining", ModelType.LONG, true).setStorageRuntime().build(); - private static final SimpleAttributeDefinition NEXT_TIMEOUT = new SimpleAttributeDefinitionBuilder("next-timeout", + static final SimpleAttributeDefinition NEXT_TIMEOUT = new SimpleAttributeDefinitionBuilder("next-timeout", ModelType.LONG, true).setStorageRuntime().build(); - private static final SimpleAttributeDefinition CALENDAR_TIMER = new SimpleAttributeDefinitionBuilder("calendar-timer", + static final SimpleAttributeDefinition CALENDAR_TIMER = new SimpleAttributeDefinitionBuilder("calendar-timer", ModelType.BOOLEAN, true).setStorageRuntime().build(); - private static final SimpleAttributeDefinition PERSISTENT = new SimpleAttributeDefinitionBuilder("persistent", + static final SimpleAttributeDefinition PERSISTENT = new SimpleAttributeDefinitionBuilder("persistent", ModelType.BOOLEAN, true).setStorageRuntime().build(); - private static final SimpleAttributeDefinition ACTIVE = new SimpleAttributeDefinitionBuilder("active", ModelType.BOOLEAN, + static final SimpleAttributeDefinition ACTIVE = new SimpleAttributeDefinitionBuilder("active", ModelType.BOOLEAN, true).setStorageRuntime().build(); // schedule and its children @@ -110,13 +109,12 @@ public class TimerResourceDefinition extends SimpleResou static final SimpleAttributeDefinition END = new SimpleAttributeDefinitionBuilder("end", ModelType.LONG, true) .setStorageRuntime().build(); - public static final ObjectListAttributeDefinition SCHEDULE = ObjectListAttributeDefinition.Builder.of( - "schedule", - ObjectTypeAttributeDefinition.Builder.of("schedule", YEAR, MONTH, DAY_OF_MONTH, DAY_OF_WEEK, HOUR, MINUTE, SECOND, - TIMEZONE, START, END).build()).build(); + static final ObjectTypeAttributeDefinition SCHEDULE = ObjectTypeAttributeDefinition.Builder.of("schedule", + YEAR, MONTH, DAY_OF_MONTH, DAY_OF_WEEK, HOUR, MINUTE, SECOND, TIMEZONE, START, END) + .build(); // TimerConfig.info - private static final SimpleAttributeDefinition INFO = new SimpleAttributeDefinitionBuilder("info", ModelType.STRING, true) + static final SimpleAttributeDefinition INFO = new SimpleAttributeDefinitionBuilder("info", ModelType.STRING, true) .setStorageRuntime().build(); @Deprecated diff --git a/ejb3/src/main/java/org/jboss/as/ejb3/timerservice/TimerServiceMetaDataSchema.java b/ejb3/src/main/java/org/jboss/as/ejb3/timerservice/TimerServiceMetaDataSchema.java index 85d8ef0ac081..2352e8e153b7 100644 --- a/ejb3/src/main/java/org/jboss/as/ejb3/timerservice/TimerServiceMetaDataSchema.java +++ b/ejb3/src/main/java/org/jboss/as/ejb3/timerservice/TimerServiceMetaDataSchema.java @@ -22,15 +22,16 @@ package org.jboss.as.ejb3.timerservice; +import java.util.List; + +import org.jboss.as.controller.xml.IntVersionSchema; import org.jboss.as.controller.xml.VersionedNamespace; -import org.jboss.as.controller.xml.VersionedSchema; -import org.jboss.as.controller.xml.VersionedURN; import org.jboss.staxmapper.IntVersion; /** * @author Paul Ferraro */ -public enum TimerServiceMetaDataSchema implements VersionedSchema { +public enum TimerServiceMetaDataSchema implements IntVersionSchema { VERSION_1_0(1, 0), VERSION_2_0(2, 0), ; @@ -39,7 +40,7 @@ public enum TimerServiceMetaDataSchema implements VersionedSchema namespace; TimerServiceMetaDataSchema(int major, int minor) { - this.namespace = new VersionedURN<>(this.getLocalName(), new IntVersion(major, minor)); + this.namespace = IntVersionSchema.createURN(List.of(this.getLocalName()), new IntVersion(major, minor)); } @Override diff --git a/ejb3/src/main/java/org/jboss/as/ejb3/timerservice/distributable/DistributableTimerService.java b/ejb3/src/main/java/org/jboss/as/ejb3/timerservice/distributable/DistributableTimerService.java index e293fff663a7..776c67cf37a5 100644 --- a/ejb3/src/main/java/org/jboss/as/ejb3/timerservice/distributable/DistributableTimerService.java +++ b/ejb3/src/main/java/org/jboss/as/ejb3/timerservice/distributable/DistributableTimerService.java @@ -29,6 +29,7 @@ import java.util.Collection; import java.util.Collections; import java.util.Date; +import java.util.LinkedList; import java.util.List; import java.util.ListIterator; import java.util.Map; @@ -38,7 +39,6 @@ import java.util.function.Function; import java.util.function.Predicate; import java.util.function.Supplier; -import java.util.stream.Collectors; import java.util.stream.Stream; import jakarta.ejb.EJBException; @@ -70,7 +70,7 @@ * @author Paul Ferraro * @param the timer identifier type */ -public class DistributableTimerService implements ManagedTimerService, Function { +public class DistributableTimerService implements ManagedTimerService { private final TimerServiceRegistry registry; private final TimedObjectInvoker invoker; @@ -215,17 +215,22 @@ private Timer createTimer(BiFunction, I, Timer> fac public Collection getTimers() throws EJBException { this.validateInvocationContext(); + Collection timers = new LinkedList<>(); @SuppressWarnings("unchecked") Set inactiveTimers = (ManagedTimerService.getActiveTransaction() != null) ? (Set) this.invoker.getComponent().getTransactionSynchronizationRegistry().getResource(this.manager) : null; + if (inactiveTimers != null) { + this.addTimers(timers, inactiveTimers); + } try (Stream activeTimers = this.manager.getActiveTimers()) { - Stream timers = (inactiveTimers != null) ? Stream.concat(activeTimers, inactiveTimers.stream()) : activeTimers; - return Collections.unmodifiableCollection(timers.map(this).collect(Collectors.toList())); + this.addTimers(timers, activeTimers::iterator); } + return Collections.unmodifiableCollection(timers); } - @Override - public jakarta.ejb.Timer apply(I id) { - return new OOBTimer<>(this.manager, id, this.invoker, this.synchronizationFactory); + private void addTimers(Collection timers, Iterable timerIds) { + for (I timerId : timerIds) { + timers.add(new OOBTimer<>(this.manager, timerId, this.invoker, this.synchronizationFactory)); + } } @Override diff --git a/elytron-oidc-client/pom.xml b/elytron-oidc-client/pom.xml index ebbf6e8e1fac..9997a1ab6744 100644 --- a/elytron-oidc-client/pom.xml +++ b/elytron-oidc-client/pom.xml @@ -27,7 +27,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT ../pom.xml @@ -168,5 +168,10 @@ junit test + + org.mockito + mockito-core + test + diff --git a/elytron-oidc-client/src/main/java/org/wildfly/extension/elytron/oidc/OidcConfigService.java b/elytron-oidc-client/src/main/java/org/wildfly/extension/elytron/oidc/OidcConfigService.java index 62a8f2c6a170..634ebc244a87 100644 --- a/elytron-oidc-client/src/main/java/org/wildfly/extension/elytron/oidc/OidcConfigService.java +++ b/elytron-oidc-client/src/main/java/org/wildfly/extension/elytron/oidc/OidcConfigService.java @@ -25,15 +25,15 @@ import static org.wildfly.extension.elytron.oidc.ElytronOidcDescriptionConstants.RESOURCE; import static org.wildfly.extension.elytron.oidc._private.ElytronOidcLogger.ROOT_LOGGER; -import java.util.ArrayList; import java.util.HashMap; import java.util.Map; +import java.util.stream.Stream; +import org.jboss.as.controller.AttributeDefinition; import org.jboss.as.controller.SimpleAttributeDefinition; import org.jboss.as.server.deployment.DeploymentUnit; import org.jboss.as.web.common.WarMetaData; import org.jboss.dmr.ModelNode; -import org.jboss.dmr.Property; import org.jboss.metadata.web.jboss.JBossWebMetaData; import org.wildfly.security.http.oidc.Oidc; @@ -234,9 +234,9 @@ private String getJSON(ModelNode deployment, boolean convertToRealmConfiguration // set realm/provider values first, some can be overridden by deployment values if (realmOrProvider != null) { - setJSONValues(json, realmOrProvider); + setJSONValues(json, realmOrProvider, Stream.of(ProviderAttributeDefinitions.ATTRIBUTES).map(AttributeDefinition::getName)::iterator); } - setJSONValues(json, deployment); + setJSONValues(json, deployment, Stream.concat(SecureDeploymentDefinition.ALL_ATTRIBUTES.stream().map(AttributeDefinition::getName), Stream.of(CREDENTIALS_JSON_NAME, REDIRECT_REWRITE_RULE_JSON_NAME))::iterator); if (removeProvider) { json.remove(ElytronOidcDescriptionConstants.PROVIDER); } @@ -259,13 +259,11 @@ private String getJSON(ModelNode deployment, boolean convertToRealmConfiguration return json.toJSONString(true); } - private void setJSONValues(ModelNode json, ModelNode values) { + private static void setJSONValues(ModelNode json, ModelNode values, Iterable keys) { synchronized (values) { - for (Property prop : new ArrayList<>(values.asPropertyList())) { - String name = prop.getName(); - ModelNode value = prop.getValue(); - if (value.isDefined()) { - json.get(name).set(value); + for (String key : keys) { + if (values.hasDefined(key)) { + json.get(key).set(values.get(key)); } } } diff --git a/elytron-oidc-client/src/main/java/org/wildfly/extension/elytron/oidc/SecureDeploymentDefinition.java b/elytron-oidc-client/src/main/java/org/wildfly/extension/elytron/oidc/SecureDeploymentDefinition.java index 7f78b1714fcb..4beb85d9c920 100644 --- a/elytron-oidc-client/src/main/java/org/wildfly/extension/elytron/oidc/SecureDeploymentDefinition.java +++ b/elytron-oidc-client/src/main/java/org/wildfly/extension/elytron/oidc/SecureDeploymentDefinition.java @@ -206,7 +206,7 @@ private SecureDeploymentAddHandler() { @Override protected void populateModel(final OperationContext context, final ModelNode operation, final Resource resource) throws OperationFailedException { - super.populateModel(operation, resource); + super.populateModel(context, operation, resource); if (! isWarDeployment(context)) { VirtualDomainMarkerUtility.virtualDomainRequired(context); AdvancedSecurityMetaData advancedSecurityMetaData = new AdvancedSecurityMetaData(); diff --git a/elytron-oidc-client/src/test/java/org/wildfly/extension/elytron/oidc/OidcActivationProcessorTest.java b/elytron-oidc-client/src/test/java/org/wildfly/extension/elytron/oidc/OidcActivationProcessorTest.java index 9bafb0fc9f11..8cd783a41d97 100644 --- a/elytron-oidc-client/src/test/java/org/wildfly/extension/elytron/oidc/OidcActivationProcessorTest.java +++ b/elytron-oidc-client/src/test/java/org/wildfly/extension/elytron/oidc/OidcActivationProcessorTest.java @@ -19,175 +19,17 @@ package org.wildfly.extension.elytron.oidc; import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.mock; -import java.util.List; - -import org.jboss.as.controller.PathAddress; -import org.jboss.as.controller.PathElement; -import org.jboss.as.controller.registry.Resource; -import org.jboss.as.server.deployment.AttachmentKey; -import org.jboss.as.server.deployment.AttachmentList; -import org.jboss.as.server.deployment.DelegatingSupplier; import org.jboss.as.server.deployment.DeploymentPhaseContext; import org.jboss.as.server.deployment.DeploymentUnit; -import org.jboss.as.server.deployment.Phase; import org.jboss.as.web.common.WarMetaData; -import org.jboss.dmr.ModelNode; import org.jboss.metadata.web.jboss.JBossWebMetaData; import org.jboss.metadata.web.spec.LoginConfigMetaData; -import org.jboss.msc.inject.Injector; -import org.jboss.msc.service.ServiceName; -import org.jboss.msc.service.ServiceRegistry; -import org.jboss.msc.service.ServiceTarget; import org.junit.Test; public class OidcActivationProcessorTest { - private final class MockDeploymentPhaseContext implements DeploymentPhaseContext { - private final class MockDeploymentUnit implements DeploymentUnit { - @Override - public boolean hasAttachment(AttachmentKey key) { - return false; - } - - @Override - public T getAttachment(AttachmentKey key) { - if (WarMetaData.ATTACHMENT_KEY.equals(key)) { - return (T) new NonNullRealmNullEverythingElseWarMetaData(); - } - - return null; - } - - @Override - public List getAttachmentList(AttachmentKey> key) { - return null; - } - - @Override - public T putAttachment(AttachmentKey key, T value) { - return null; - } - - @Override - public T removeAttachment(AttachmentKey key) { - return null; - } - - @Override - public void addToAttachmentList(AttachmentKey> key, T value) { - } - - @Override - public ServiceName getServiceName() { - return null; - } - - @Override - public DeploymentUnit getParent() { - return null; - } - - @Override - public String getName() { - return null; - } - - @Override - public ServiceRegistry getServiceRegistry() { - return null; - } - - //@Override - public ModelNode getDeploymentSubsystemModel(String subsystemName) { - return null; - } - - //@Override - public ModelNode createDeploymentSubModel(String subsystemName, PathElement address) { - return null; - } - - //@Override - public ModelNode createDeploymentSubModel(String subsystemName, PathAddress address) { - return null; - } - - //@Override - public ModelNode createDeploymentSubModel(String subsystemName, PathAddress address, - Resource resource) { - return null; - } - } - - @Override - public void addToAttachmentList(AttachmentKey> arg0, T arg1) { - } - - @Override - public T getAttachment(AttachmentKey arg0) { - return null; - } - - @Override - public List getAttachmentList(AttachmentKey> arg0) { - return null; - } - - @Override - public boolean hasAttachment(AttachmentKey arg0) { - return false; - } - - @Override - public T putAttachment(AttachmentKey arg0, T arg1) { - return null; - } - - @Override - public T removeAttachment(AttachmentKey arg0) { - return null; - } - - @Override - public void addDependency(ServiceName arg0, AttachmentKey arg1) { - } - - public void addDependency(ServiceName arg0, Class arg1, Injector arg2) { - } - - @Override - public void addDeploymentDependency(ServiceName arg0, AttachmentKey arg1) { - } - - @Override - public DeploymentUnit getDeploymentUnit() { - return new MockDeploymentUnit(); - } - - @Override - public Phase getPhase() { - return null; - } - - @Override - public ServiceName getPhaseServiceName() { - return null; - } - - @Override - public ServiceRegistry getServiceRegistry() { - return null; - } - - @Override - public ServiceTarget getServiceTarget() { - return null; - } - - @Override - public void requires(ServiceName arg0, DelegatingSupplier arg1) { - } - } private final class NonNullRealmNullEverythingElseWarMetaData extends WarMetaData { private final class JBossWebMetaDataExtension extends JBossWebMetaData { @@ -215,7 +57,14 @@ public JBossWebMetaData getMergedJBossWebMetaData() { */ @Test public void testDeployLoginConfigWithRealmAndNullAuthMethod() throws Exception { - new OidcActivationProcessor().deploy(new MockDeploymentPhaseContext()); + DeploymentUnit unit = mock(DeploymentUnit.class); + doReturn(true).when(unit).hasAttachment(WarMetaData.ATTACHMENT_KEY); + doReturn(new NonNullRealmNullEverythingElseWarMetaData()).when(unit).getAttachment(WarMetaData.ATTACHMENT_KEY); + + DeploymentPhaseContext context = mock(DeploymentPhaseContext.class); + doReturn(unit).when(context).getDeploymentUnit(); + + new OidcActivationProcessor().deploy(context); assertTrue("Expect to succeed and reach this point", true); } diff --git a/galleon-pack/galleon-feature-pack/pom.xml b/galleon-pack/galleon-feature-pack/pom.xml index 5d82e2b490ad..23b801705cb7 100644 --- a/galleon-pack/galleon-feature-pack/pom.xml +++ b/galleon-pack/galleon-feature-pack/pom.xml @@ -34,7 +34,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT ../pom.xml diff --git a/galleon-pack/galleon-local/pom.xml b/galleon-pack/galleon-local/pom.xml index 5afd4914b308..5478886549a1 100644 --- a/galleon-pack/galleon-local/pom.xml +++ b/galleon-pack/galleon-local/pom.xml @@ -31,7 +31,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-feature-pack-galleon-local diff --git a/galleon-pack/galleon-local/src/main/resources/packages/docs.licenses/pm/wildfly/tasks.xml b/galleon-pack/galleon-local/src/main/resources/packages/docs.licenses/pm/wildfly/tasks.xml index 1a47b6f513c3..66cfb7e0d97b 100644 --- a/galleon-pack/galleon-local/src/main/resources/packages/docs.licenses/pm/wildfly/tasks.xml +++ b/galleon-pack/galleon-local/src/main/resources/packages/docs.licenses/pm/wildfly/tasks.xml @@ -4,9 +4,9 @@ - + - + diff --git a/galleon-pack/galleon-shared/pom.xml b/galleon-pack/galleon-shared/pom.xml index b5c5f1948b75..1282cf08c2ef 100644 --- a/galleon-pack/galleon-shared/pom.xml +++ b/galleon-pack/galleon-shared/pom.xml @@ -34,7 +34,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-feature-pack-galleon-shared diff --git a/galleon-pack/galleon-shared/src/main/resources/layers/standalone/micrometer/layer-spec.xml b/galleon-pack/galleon-shared/src/main/resources/layers/standalone/micrometer/layer-spec.xml index 15baf1b7dd37..a3dd808415c5 100644 --- a/galleon-pack/galleon-shared/src/main/resources/layers/standalone/micrometer/layer-spec.xml +++ b/galleon-pack/galleon-shared/src/main/resources/layers/standalone/micrometer/layer-spec.xml @@ -18,7 +18,11 @@ ~ * limitations under the License. ~ */ --> - + + + + + diff --git a/galleon-pack/galleon-shared/src/main/resources/layers/standalone/microprofile-config/layer-spec.xml b/galleon-pack/galleon-shared/src/main/resources/layers/standalone/microprofile-config/layer-spec.xml index 4d57bc29e23b..ba0420c6f230 100644 --- a/galleon-pack/galleon-shared/src/main/resources/layers/standalone/microprofile-config/layer-spec.xml +++ b/galleon-pack/galleon-shared/src/main/resources/layers/standalone/microprofile-config/layer-spec.xml @@ -22,7 +22,11 @@ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. --> - + + + + + diff --git a/galleon-pack/galleon-shared/src/main/resources/layers/standalone/microprofile-fault-tolerance/layer-spec.xml b/galleon-pack/galleon-shared/src/main/resources/layers/standalone/microprofile-fault-tolerance/layer-spec.xml index 48a358447f28..e3b719286f4c 100644 --- a/galleon-pack/galleon-shared/src/main/resources/layers/standalone/microprofile-fault-tolerance/layer-spec.xml +++ b/galleon-pack/galleon-shared/src/main/resources/layers/standalone/microprofile-fault-tolerance/layer-spec.xml @@ -22,7 +22,11 @@ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. --> - + + + + + diff --git a/galleon-pack/galleon-shared/src/main/resources/layers/standalone/microprofile-health/layer-spec.xml b/galleon-pack/galleon-shared/src/main/resources/layers/standalone/microprofile-health/layer-spec.xml index 6ddf4e273146..5b673d1ded0f 100644 --- a/galleon-pack/galleon-shared/src/main/resources/layers/standalone/microprofile-health/layer-spec.xml +++ b/galleon-pack/galleon-shared/src/main/resources/layers/standalone/microprofile-health/layer-spec.xml @@ -22,7 +22,11 @@ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. --> - + + + + + diff --git a/galleon-pack/galleon-shared/src/main/resources/layers/standalone/microprofile-jwt/layer-spec.xml b/galleon-pack/galleon-shared/src/main/resources/layers/standalone/microprofile-jwt/layer-spec.xml index 58a7d8143c11..f58daeefb5e0 100644 --- a/galleon-pack/galleon-shared/src/main/resources/layers/standalone/microprofile-jwt/layer-spec.xml +++ b/galleon-pack/galleon-shared/src/main/resources/layers/standalone/microprofile-jwt/layer-spec.xml @@ -1,5 +1,9 @@ - + + + + + diff --git a/galleon-pack/galleon-shared/src/main/resources/layers/standalone/microprofile-lra-coordinator/layer-spec.xml b/galleon-pack/galleon-shared/src/main/resources/layers/standalone/microprofile-lra-coordinator/layer-spec.xml index 7572d5f2a163..579ea77cd2a8 100644 --- a/galleon-pack/galleon-shared/src/main/resources/layers/standalone/microprofile-lra-coordinator/layer-spec.xml +++ b/galleon-pack/galleon-shared/src/main/resources/layers/standalone/microprofile-lra-coordinator/layer-spec.xml @@ -21,7 +21,11 @@ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. --> - + + + + + diff --git a/galleon-pack/galleon-shared/src/main/resources/layers/standalone/microprofile-lra-participant/layer-spec.xml b/galleon-pack/galleon-shared/src/main/resources/layers/standalone/microprofile-lra-participant/layer-spec.xml index fdc7e17c0520..d40bca085a2b 100644 --- a/galleon-pack/galleon-shared/src/main/resources/layers/standalone/microprofile-lra-participant/layer-spec.xml +++ b/galleon-pack/galleon-shared/src/main/resources/layers/standalone/microprofile-lra-participant/layer-spec.xml @@ -21,7 +21,11 @@ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. --> - + + + + + diff --git a/galleon-pack/galleon-shared/src/main/resources/layers/standalone/microprofile-openapi/layer-spec.xml b/galleon-pack/galleon-shared/src/main/resources/layers/standalone/microprofile-openapi/layer-spec.xml index 0cb82b8e1617..326bd88ce360 100644 --- a/galleon-pack/galleon-shared/src/main/resources/layers/standalone/microprofile-openapi/layer-spec.xml +++ b/galleon-pack/galleon-shared/src/main/resources/layers/standalone/microprofile-openapi/layer-spec.xml @@ -1,5 +1,9 @@ - + + + + + diff --git a/galleon-pack/galleon-shared/src/main/resources/layers/standalone/microprofile-reactive-messaging-kafka/layer-spec.xml b/galleon-pack/galleon-shared/src/main/resources/layers/standalone/microprofile-reactive-messaging-kafka/layer-spec.xml index 410f402e9ff5..c292c82fe78e 100644 --- a/galleon-pack/galleon-shared/src/main/resources/layers/standalone/microprofile-reactive-messaging-kafka/layer-spec.xml +++ b/galleon-pack/galleon-shared/src/main/resources/layers/standalone/microprofile-reactive-messaging-kafka/layer-spec.xml @@ -20,7 +20,14 @@ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. --> - + + + + + + + + diff --git a/galleon-pack/galleon-shared/src/main/resources/layers/standalone/microprofile-reactive-messaging/layer-spec.xml b/galleon-pack/galleon-shared/src/main/resources/layers/standalone/microprofile-reactive-messaging/layer-spec.xml index ace370d5592b..4ac86dd6ce0d 100644 --- a/galleon-pack/galleon-shared/src/main/resources/layers/standalone/microprofile-reactive-messaging/layer-spec.xml +++ b/galleon-pack/galleon-shared/src/main/resources/layers/standalone/microprofile-reactive-messaging/layer-spec.xml @@ -21,7 +21,11 @@ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. --> - + + + + + diff --git a/galleon-pack/galleon-shared/src/main/resources/layers/standalone/microprofile-reactive-streams-operators/layer-spec.xml b/galleon-pack/galleon-shared/src/main/resources/layers/standalone/microprofile-reactive-streams-operators/layer-spec.xml index 4dafbfe25dde..a235c710cc34 100644 --- a/galleon-pack/galleon-shared/src/main/resources/layers/standalone/microprofile-reactive-streams-operators/layer-spec.xml +++ b/galleon-pack/galleon-shared/src/main/resources/layers/standalone/microprofile-reactive-streams-operators/layer-spec.xml @@ -21,7 +21,10 @@ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. --> - + + + + diff --git a/galleon-pack/galleon-shared/src/main/resources/layers/standalone/microprofile-rest-client/layer-spec.xml b/galleon-pack/galleon-shared/src/main/resources/layers/standalone/microprofile-rest-client/layer-spec.xml index db79d9047fb7..d96744d7d80a 100644 --- a/galleon-pack/galleon-shared/src/main/resources/layers/standalone/microprofile-rest-client/layer-spec.xml +++ b/galleon-pack/galleon-shared/src/main/resources/layers/standalone/microprofile-rest-client/layer-spec.xml @@ -20,7 +20,11 @@ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. --> - + + + + + diff --git a/galleon-pack/galleon-shared/src/main/resources/layers/standalone/microprofile-telemetry/layer-spec.xml b/galleon-pack/galleon-shared/src/main/resources/layers/standalone/microprofile-telemetry/layer-spec.xml index 78872594b553..61085f35c3dd 100644 --- a/galleon-pack/galleon-shared/src/main/resources/layers/standalone/microprofile-telemetry/layer-spec.xml +++ b/galleon-pack/galleon-shared/src/main/resources/layers/standalone/microprofile-telemetry/layer-spec.xml @@ -1,5 +1,11 @@ - + + + + + + + diff --git a/galleon-pack/galleon-shared/src/main/resources/layers/standalone/opentelemetry/layer-spec.xml b/galleon-pack/galleon-shared/src/main/resources/layers/standalone/opentelemetry/layer-spec.xml index 6c74e1b9dcc2..447286911277 100644 --- a/galleon-pack/galleon-shared/src/main/resources/layers/standalone/opentelemetry/layer-spec.xml +++ b/galleon-pack/galleon-shared/src/main/resources/layers/standalone/opentelemetry/layer-spec.xml @@ -1,5 +1,11 @@ - + + + + + + + diff --git a/galleon-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/jboss/narayana/rts/lra-participant/main/module.xml b/galleon-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/jboss/narayana/rts/lra-participant/main/module.xml index 0a326ea5bf1f..ced275cdfccd 100644 --- a/galleon-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/jboss/narayana/rts/lra-participant/main/module.xml +++ b/galleon-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/jboss/narayana/rts/lra-participant/main/module.xml @@ -45,7 +45,9 @@ - + + + \ No newline at end of file diff --git a/galleon-pack/pom.xml b/galleon-pack/pom.xml index bb497cab3b21..d264e3febf66 100644 --- a/galleon-pack/pom.xml +++ b/galleon-pack/pom.xml @@ -34,7 +34,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-feature-pack-parent diff --git a/health/pom.xml b/health/pom.xml index 71efa7360639..fab6871a9a9d 100644 --- a/health/pom.xml +++ b/health/pom.xml @@ -29,7 +29,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-health diff --git a/health/src/main/java/org/wildfly/extension/health/HealthSubsystemSchema.java b/health/src/main/java/org/wildfly/extension/health/HealthSubsystemSchema.java index 233384c3feb6..af1899e33a4e 100644 --- a/health/src/main/java/org/wildfly/extension/health/HealthSubsystemSchema.java +++ b/health/src/main/java/org/wildfly/extension/health/HealthSubsystemSchema.java @@ -26,7 +26,7 @@ import org.jboss.as.controller.PersistentResourceXMLDescription; import org.jboss.as.controller.PersistentSubsystemSchema; -import org.jboss.as.controller.SubsystemURN; +import org.jboss.as.controller.SubsystemSchema; import org.jboss.as.controller.xml.VersionedNamespace; import org.jboss.staxmapper.IntVersion; @@ -43,7 +43,7 @@ public enum HealthSubsystemSchema implements PersistentSubsystemSchema namespace; HealthSubsystemSchema(int major) { - this.namespace = new SubsystemURN<>(HealthExtension.SUBSYSTEM_NAME, new IntVersion(major)); + this.namespace = SubsystemSchema.createSubsystemURN(HealthExtension.SUBSYSTEM_NAME, new IntVersion(major)); } @Override diff --git a/health/src/main/java/org/wildfly/extension/health/ServerProbes.java b/health/src/main/java/org/wildfly/extension/health/ServerProbes.java index 373867d0ea02..de8b86be592a 100644 --- a/health/src/main/java/org/wildfly/extension/health/ServerProbes.java +++ b/health/src/main/java/org/wildfly/extension/health/ServerProbes.java @@ -35,7 +35,9 @@ import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.RESULT; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.STATUS; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SUCCESS; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SUSPEND_STATE; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.VALUE; +import static org.jboss.as.server.suspend.SuspendController.State.RUNNING; import java.util.List; @@ -46,6 +48,7 @@ class ServerProbes { private static final ModelNode READ_SERVER_STATE_ATTRIBUTE; + private static final ModelNode READ_SUSPEND_STATE_ATTRIBUTE; private static final ModelNode READ_BOOT_ERRORS; private static final ModelNode READ_DEPLOYMENTS_STATUS; @@ -55,6 +58,11 @@ class ServerProbes { READ_SERVER_STATE_ATTRIBUTE.get(OP_ADDR).set(new ModelNode()); READ_SERVER_STATE_ATTRIBUTE.get(NAME).set("server-state"); + READ_SUSPEND_STATE_ATTRIBUTE = new ModelNode(); + READ_SUSPEND_STATE_ATTRIBUTE.get(OP).set(READ_ATTRIBUTE_OPERATION); + READ_SUSPEND_STATE_ATTRIBUTE.get(OP_ADDR).set(new ModelNode()); + READ_SUSPEND_STATE_ATTRIBUTE.get(NAME).set(SUSPEND_STATE); + READ_BOOT_ERRORS = new ModelNode(); READ_BOOT_ERRORS.get(OP).set("read-boot-errors"); READ_BOOT_ERRORS.get(OP_ADDR).add(CORE_SERVICE, MANAGEMENT); @@ -104,6 +112,45 @@ public String getName() { } } + /** + * Check that the suspend-state attribute value is "RUNNING" + */ + static class SuspendStateCheck implements ServerProbe { + + private final LocalModelControllerClient modelControllerClient; + + public SuspendStateCheck(LocalModelControllerClient modelControllerClient) { + this.modelControllerClient = modelControllerClient; + } + + @Override + public Outcome getOutcome() { + ModelNode response = modelControllerClient.execute(READ_SUSPEND_STATE_ATTRIBUTE); + + if (!SUCCESS.equals(response.get(OUTCOME).asStringOrNull())) { + return Outcome.FAILURE; + } + if (response.hasDefined(FAILURE_DESCRIPTION)) { + ModelNode data = new ModelNode(); + data.add(FAILURE_DESCRIPTION, response.get(FAILURE_DESCRIPTION).asString()); + return new Outcome(false, data); + } + ModelNode result = response.get(RESULT); + if (!result.isDefined()) { + return Outcome.FAILURE; + } + String value = result.asString(); + ModelNode data = new ModelNode(); + data.add(VALUE, value); + return new Outcome(RUNNING.toString().equals(value), data); + } + + @Override + public String getName() { + return "suspend-state"; + } + } + /** * Check that /core-service=management:read-boot-errors does not report any errors. */ diff --git a/health/src/main/java/org/wildfly/extension/health/ServerProbesService.java b/health/src/main/java/org/wildfly/extension/health/ServerProbesService.java index 2ee09f2cb3d1..0fcbd244af71 100644 --- a/health/src/main/java/org/wildfly/extension/health/ServerProbesService.java +++ b/health/src/main/java/org/wildfly/extension/health/ServerProbesService.java @@ -75,6 +75,7 @@ public void start(StartContext context) throws StartException { modelControllerClient = modelControllerClientFactory.get().createSuperUserClient(managementExecutor.get(), true); serverProbes.add(new ServerProbes.ServerStateCheck(modelControllerClient)); + serverProbes.add(new ServerProbes.SuspendStateCheck(modelControllerClient)); serverProbes.add(new ServerProbes.DeploymentsStatusCheck(modelControllerClient)); serverProbes.add(new ServerProbes.NoBootErrorsCheck(modelControllerClient)); diff --git a/iiop-openjdk/pom.xml b/iiop-openjdk/pom.xml index 04e3e8dac83c..bcb7c8f4eabf 100644 --- a/iiop-openjdk/pom.xml +++ b/iiop-openjdk/pom.xml @@ -34,7 +34,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-iiop-openjdk diff --git a/jaxrs/pom.xml b/jaxrs/pom.xml index 78c8abca3312..a7cfe1aab21b 100644 --- a/jaxrs/pom.xml +++ b/jaxrs/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-jaxrs diff --git a/jaxrs/src/main/java/org/jboss/as/jaxrs/JaxrsExtension.java b/jaxrs/src/main/java/org/jboss/as/jaxrs/JaxrsExtension.java index f8c05af58a12..ec0414c1b7d2 100644 --- a/jaxrs/src/main/java/org/jboss/as/jaxrs/JaxrsExtension.java +++ b/jaxrs/src/main/java/org/jboss/as/jaxrs/JaxrsExtension.java @@ -24,7 +24,6 @@ import static org.jboss.as.jaxrs.logging.JaxrsLogger.JAXRS_LOGGER; -import org.jboss.as.controller.AttributeDefinition; import org.jboss.as.controller.Extension; import org.jboss.as.controller.ExtensionContext; import org.jboss.as.controller.ModelVersion; @@ -69,7 +68,6 @@ public void initialize(final ExtensionContext context) { final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, CURRENT_MODEL_VERSION); final ManagementResourceRegistration registration = subsystem.registerSubsystemModel(new JaxrsSubsystemDefinition()); registration.registerOperationHandler(GenericSubsystemDescribeHandler.DEFINITION, GenericSubsystemDescribeHandler.INSTANCE); - registerAttributes(registration); ManagementResourceRegistration jaxrsResReg = subsystem.registerDeploymentModel(new JaxrsDeploymentDefinition()); jaxrsResReg.registerSubModel(new DeploymentRestResourcesDefintion()); subsystem.registerXMLElementWriter(JaxrsSubsystemParser_3_0::new); @@ -84,10 +82,4 @@ public void initializeParsers(final ExtensionParsingContext context) { context.setSubsystemXmlMapping(SUBSYSTEM_NAME, "urn:jboss:domain:jaxrs:2.0", JaxrsSubsystemParser_2_0::new); context.setSubsystemXmlMapping(SUBSYSTEM_NAME, "urn:jboss:domain:jaxrs:3.0", JaxrsSubsystemParser_3_0::new); } - - private static void registerAttributes(ManagementResourceRegistration registration) { - for (AttributeDefinition definition : JaxrsAttribute.ATTRIBUTES) { - registration.registerReadWriteAttribute(definition, null, new JaxrsParamHandler(definition)); - } - } } diff --git a/jaxrs/src/main/java/org/jboss/as/jaxrs/JaxrsSubsystemDefinition.java b/jaxrs/src/main/java/org/jboss/as/jaxrs/JaxrsSubsystemDefinition.java index c2e67c939bc1..df20ae896b84 100644 --- a/jaxrs/src/main/java/org/jboss/as/jaxrs/JaxrsSubsystemDefinition.java +++ b/jaxrs/src/main/java/org/jboss/as/jaxrs/JaxrsSubsystemDefinition.java @@ -20,6 +20,8 @@ */ package org.jboss.as.jaxrs; +import org.jboss.as.controller.AttributeDefinition; +import org.jboss.as.controller.OperationStepHandler; import org.jboss.as.controller.ReloadRequiredRemoveStepHandler; import org.jboss.as.controller.SimpleResourceDefinition; @@ -63,6 +65,14 @@ public class JaxrsSubsystemDefinition extends SimpleResourceDefinition { .setRemoveHandler(ReloadRequiredRemoveStepHandler.INSTANCE)); } + @Override + public void registerAttributes(ManagementResourceRegistration registration) { + OperationStepHandler handler = new JaxrsParamHandler(JaxrsAttribute.ATTRIBUTES); + for (AttributeDefinition definition : JaxrsAttribute.ATTRIBUTES) { + registration.registerReadWriteAttribute(definition, null, handler); + } + } + @Override public void registerAdditionalRuntimePackages(ManagementResourceRegistration resourceRegistration) { resourceRegistration.registerAdditionalRuntimePackages(RuntimePackageDependency.passive(RESTEASY_CDI), diff --git a/jdr/pom.xml b/jdr/pom.xml index 5fbf180cbc38..67d030de5798 100644 --- a/jdr/pom.xml +++ b/jdr/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-jdr diff --git a/jdr/src/main/java/org/jboss/as/jdr/JdrReportSubsystemSchema.java b/jdr/src/main/java/org/jboss/as/jdr/JdrReportSubsystemSchema.java index b8b44cd044de..50f65be99fc9 100644 --- a/jdr/src/main/java/org/jboss/as/jdr/JdrReportSubsystemSchema.java +++ b/jdr/src/main/java/org/jboss/as/jdr/JdrReportSubsystemSchema.java @@ -24,9 +24,9 @@ import static org.jboss.as.controller.PersistentResourceXMLDescription.builder; -import org.jboss.as.controller.LegacySubsystemURN; import org.jboss.as.controller.PersistentResourceXMLDescription; import org.jboss.as.controller.PersistentSubsystemSchema; +import org.jboss.as.controller.SubsystemSchema; import org.jboss.as.controller.xml.VersionedNamespace; import org.jboss.staxmapper.IntVersion; @@ -45,7 +45,7 @@ enum JdrReportSubsystemSchema implements PersistentSubsystemSchema namespace; JdrReportSubsystemSchema(int major) { - this.namespace = new LegacySubsystemURN<>(JdrReportExtension.SUBSYSTEM_NAME, new IntVersion(major)); + this.namespace = SubsystemSchema.createLegacySubsystemURN(JdrReportExtension.SUBSYSTEM_NAME, new IntVersion(major)); } @Override diff --git a/jpa/eclipselink/pom.xml b/jpa/eclipselink/pom.xml index e5d0f6cd20df..8f49dab1e7a7 100644 --- a/jpa/eclipselink/pom.xml +++ b/jpa/eclipselink/pom.xml @@ -12,7 +12,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT jipijapa-eclipselink diff --git a/jpa/hibernate6/pom.xml b/jpa/hibernate6/pom.xml index a6ea0809e3a5..315e8e22f6dd 100644 --- a/jpa/hibernate6/pom.xml +++ b/jpa/hibernate6/pom.xml @@ -29,7 +29,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT jipijapa-hibernate6 diff --git a/jpa/hibernatesearch/pom.xml b/jpa/hibernatesearch/pom.xml new file mode 100644 index 000000000000..51af4760882f --- /dev/null +++ b/jpa/hibernatesearch/pom.xml @@ -0,0 +1,112 @@ + + + + 4.0.0 + + + org.wildfly + wildfly-jpa-parent + + 30.0.0.Beta1-SNAPSHOT + + + jipijapa-hibernatesearch + + WildFly: Jipijapa Hibernate Search integration + + + + wildfly-standard-ee-bom + + + + + + + ${project.groupId} + jipijapa-spi + + + + + + org.jboss.logging + jboss-logging + + + + org.jboss.logging + jboss-logging-annotations + + provided + true + + + + org.jboss.logging + jboss-logging-processor + + provided + true + + + + io.smallrye + jandex + + + + org.hibernate.common + hibernate-commons-annotations + provided + + + + org.hibernate.orm + hibernate-core + provided + + + + org.hibernate.search + hibernate-search-util-common + provided + + + + org.hibernate.search + hibernate-search-engine + provided + + + + org.hibernate.search + hibernate-search-mapper-pojo-base + provided + + + + org.hibernate.search + hibernate-search-mapper-orm-orm6 + provided + + + + org.hibernate.validator + hibernate-validator + provided + + + + jakarta.persistence + jakarta.persistence-api + + + diff --git a/jpa/hibernatesearch/src/main/java/org/jipijapa/hibernate/search/HibernateSearchIntegratorAdaptor.java b/jpa/hibernatesearch/src/main/java/org/jipijapa/hibernate/search/HibernateSearchIntegratorAdaptor.java new file mode 100644 index 000000000000..5e9f2a540d4e --- /dev/null +++ b/jpa/hibernatesearch/src/main/java/org/jipijapa/hibernate/search/HibernateSearchIntegratorAdaptor.java @@ -0,0 +1,93 @@ +/* + * JBoss, Home of Professional Open Source. + * Copyright 2023, Red Hat, Inc., and individual contributors + * as indicated by the @author tags. See the copyright.txt file in the + * distribution for a full listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ + +package org.jipijapa.hibernate.search; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.function.Function; +import java.util.regex.Pattern; + +import org.hibernate.search.engine.cfg.spi.ConvertUtils; +import org.hibernate.search.mapper.orm.cfg.HibernateOrmMapperSettings; +import org.jboss.jandex.Index; +import org.jipijapa.plugin.spi.PersistenceProviderIntegratorAdaptor; +import org.jipijapa.plugin.spi.PersistenceUnitMetadata; + +/** + * Implements the PersistenceProviderIntegratorAdaptor for Hibernate Search + */ +public class HibernateSearchIntegratorAdaptor implements PersistenceProviderIntegratorAdaptor { + + // Same as org.hibernate.search.engine.cfg.impl.OptionalPropertyContextImpl.MULTI_VALUE_SEPARATOR_PATTERN + private static final Pattern MULTI_VALUE_SEPARATOR_PATTERN = Pattern.compile( "," ); + + private Collection indexes; + private final List configurers = new ArrayList<>(); + + @Override + public void injectIndexes(Collection indexes) { + this.indexes = indexes; + } + + @Override + public void addIntegratorProperties(Map properties, PersistenceUnitMetadata pu) { + // See WildFlyHibernateOrmSearchMappingConfigurer + addMappingConfigurer(properties, pu); + } + + private void addMappingConfigurer(Map properties, PersistenceUnitMetadata pu) { + Properties puProperties = pu.getProperties(); + + List mappingConfigurerRefs = new ArrayList<>(); + Object customMappingConfigurerRefs = puProperties.get(HibernateOrmMapperSettings.MAPPING_CONFIGURER); + if (customMappingConfigurerRefs != null) { + // We need to parse user-provided config to preserve it + try { + mappingConfigurerRefs.addAll(ConvertUtils.convertMultiValue(MULTI_VALUE_SEPARATOR_PATTERN, + Function.identity(), customMappingConfigurerRefs)); + } catch (RuntimeException e) { + throw JpaHibernateSearchLogger.JPA_HIBERNATE_SEARCH_LOGGER.failOnPropertyParsingForIntegration( + pu.getPersistenceUnitName(), HibernateOrmMapperSettings.MAPPING_CONFIGURER, e); + } + } + // Change the default behavior of Hibernate Search regarding Jandex indexes + WildFlyHibernateOrmSearchMappingConfigurer configurer = new WildFlyHibernateOrmSearchMappingConfigurer(indexes); + configurers.add(configurer); // for cleaning up later, see methods below + mappingConfigurerRefs.add(0, configurer); + properties.put(HibernateOrmMapperSettings.MAPPING_CONFIGURER, mappingConfigurerRefs); + } + + @Override + public void afterCreateContainerEntityManagerFactory(PersistenceUnitMetadata pu) { + // Don't keep any reference to indexes, as those can be quite large. + indexes = null; + for (WildFlyHibernateOrmSearchMappingConfigurer configurer : configurers) { + configurer.clearIndexReferences(); + } + configurers.clear(); + } +} + diff --git a/jpa/hibernatesearch/src/main/java/org/jipijapa/hibernate/search/JpaHibernateSearchLogger.java b/jpa/hibernatesearch/src/main/java/org/jipijapa/hibernate/search/JpaHibernateSearchLogger.java new file mode 100644 index 000000000000..6a44c20bb515 --- /dev/null +++ b/jpa/hibernatesearch/src/main/java/org/jipijapa/hibernate/search/JpaHibernateSearchLogger.java @@ -0,0 +1,46 @@ +/* + * JBoss, Home of Professional Open Source. + * Copyright 2023, Red Hat, Inc., and individual contributors + * as indicated by the @author tags. See the copyright.txt file in the + * distribution for a full listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ + +package org.jipijapa.hibernate.search; + +import org.jboss.logging.BasicLogger; +import org.jboss.logging.Logger; +import org.jboss.logging.annotations.Cause; +import org.jboss.logging.annotations.Message; +import org.jboss.logging.annotations.MessageLogger; + +/** + * JipiJapa message range is 20200-20299 + * note: keep duplicate messages in sync between different sub-projects that use the same messages + */ +@MessageLogger(projectCode = "JIPISEARCH") +public interface JpaHibernateSearchLogger extends BasicLogger { + + /** + * A logger with the category {@code org.jipijapa}. + */ + JpaHibernateSearchLogger JPA_HIBERNATE_SEARCH_LOGGER = Logger.getMessageLogger(JpaHibernateSearchLogger.class, "org.jipijapa"); + + @Message(id = 20290, value = "Failed to parse property '%2$s' while integrating Hibernate Search into persistence unit '%1$s") + IllegalStateException failOnPropertyParsingForIntegration(String puUnitName, String propertyKey, @Cause Exception cause); + +} diff --git a/jpa/hibernatesearch/src/main/java/org/jipijapa/hibernate/search/WildFlyHibernateOrmSearchMappingConfigurer.java b/jpa/hibernatesearch/src/main/java/org/jipijapa/hibernate/search/WildFlyHibernateOrmSearchMappingConfigurer.java new file mode 100644 index 000000000000..9de289b17796 --- /dev/null +++ b/jpa/hibernatesearch/src/main/java/org/jipijapa/hibernate/search/WildFlyHibernateOrmSearchMappingConfigurer.java @@ -0,0 +1,58 @@ +/* + * JBoss, Home of Professional Open Source. + * Copyright 2023, Red Hat, Inc., and individual contributors + * as indicated by the @author tags. See the copyright.txt file in the + * distribution for a full listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ + +package org.jipijapa.hibernate.search; + +import org.hibernate.search.mapper.orm.mapping.HibernateOrmMappingConfigurationContext; +import org.hibernate.search.mapper.orm.mapping.HibernateOrmSearchMappingConfigurer; +import org.jboss.jandex.Index; + +import java.util.Collection; + +final class WildFlyHibernateOrmSearchMappingConfigurer implements HibernateOrmSearchMappingConfigurer { + private Collection indexes; + + public WildFlyHibernateOrmSearchMappingConfigurer(Collection indexes) { + this.indexes = indexes; + } + + @Override + public void configure(HibernateOrmMappingConfigurationContext context) { + // Hibernate Search can't deal with WildFly's JAR URLs using vfs://, + // so it fails to load Jandex indexes from the JARs. + // Regardless, WildFly already has Jandex indexes in memory, + // so we'll configure Hibernate Search to just use those. + context.annotationMapping().discoverJandexIndexesFromAddedTypes(false) + .buildMissingDiscoveredJandexIndexes(false); + if (indexes != null) { + for (Index index : indexes) { + // This class is garbage-collected after bootstrap, + // so the reference to indexes does not matter. + context.annotationMapping().addJandexIndex(index); + } + } + } + + public void clearIndexReferences() { + indexes = null; + } +} diff --git a/jpa/hibernatesearch/src/main/resources/META-INF/services/org.jipijapa.plugin.spi.PersistenceProviderIntegratorAdaptor b/jpa/hibernatesearch/src/main/resources/META-INF/services/org.jipijapa.plugin.spi.PersistenceProviderIntegratorAdaptor new file mode 100644 index 000000000000..b2e98306c117 --- /dev/null +++ b/jpa/hibernatesearch/src/main/resources/META-INF/services/org.jipijapa.plugin.spi.PersistenceProviderIntegratorAdaptor @@ -0,0 +1 @@ +org.jipijapa.hibernate.search.HibernateSearchIntegratorAdaptor \ No newline at end of file diff --git a/jpa/pom.xml b/jpa/pom.xml index c649e756fb04..f9d9b98a293a 100644 --- a/jpa/pom.xml +++ b/jpa/pom.xml @@ -12,7 +12,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT ../pom.xml @@ -39,6 +39,7 @@ hibernate6 + hibernatesearch subsystem spi eclipselink diff --git a/jpa/spi/pom.xml b/jpa/spi/pom.xml index 78362cf2181e..bdb9c22f38ba 100644 --- a/jpa/spi/pom.xml +++ b/jpa/spi/pom.xml @@ -12,7 +12,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT diff --git a/jpa/spi/src/main/java/org/jipijapa/plugin/spi/PersistenceProviderIntegratorAdaptor.java b/jpa/spi/src/main/java/org/jipijapa/plugin/spi/PersistenceProviderIntegratorAdaptor.java new file mode 100644 index 000000000000..88b236f29be9 --- /dev/null +++ b/jpa/spi/src/main/java/org/jipijapa/plugin/spi/PersistenceProviderIntegratorAdaptor.java @@ -0,0 +1,54 @@ +/* + * JBoss, Home of Professional Open Source. + * Copyright 2023, Red Hat, Inc., and individual contributors + * as indicated by the @author tags. See the copyright.txt file in the + * distribution for a full listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ + +package org.jipijapa.plugin.spi; + +import org.jboss.jandex.Index; + +import java.util.Collection; +import java.util.Map; + +/** + * Adaptor for integrators into persistence providers, e.g. Hibernate Search. + */ +public interface PersistenceProviderIntegratorAdaptor { + + /** + * @param indexes The index views for the unit being deployed + */ + void injectIndexes(Collection indexes); + + /** + * Adds any integrator-specific persistence unit properties + * + * @param properties + * @param pu + */ + void addIntegratorProperties(Map properties, PersistenceUnitMetadata pu); + + /** + * Called right after persistence provider is invoked to create container entity manager factory. + */ + void afterCreateContainerEntityManagerFactory(PersistenceUnitMetadata pu); + +} + diff --git a/jpa/subsystem/pom.xml b/jpa/subsystem/pom.xml index f04f68ec0032..2294801a78b9 100644 --- a/jpa/subsystem/pom.xml +++ b/jpa/subsystem/pom.xml @@ -34,7 +34,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-jpa diff --git a/jpa/subsystem/src/main/java/org/jboss/as/jpa/config/Configuration.java b/jpa/subsystem/src/main/java/org/jboss/as/jpa/config/Configuration.java index 8c8fb8a2a7f6..0728c28131b3 100644 --- a/jpa/subsystem/src/main/java/org/jboss/as/jpa/config/Configuration.java +++ b/jpa/subsystem/src/main/java/org/jboss/as/jpa/config/Configuration.java @@ -190,6 +190,11 @@ public class Configuration { */ public static final String HIBERNATE_SEARCH_MODULE = "wildfly.jpa.hibernate.search.module"; + /** + * name of the Hibernate Search integrator adaptor module + */ + public static final String HIBERNATE_SEARCH_INTEGRATOR_ADAPTOR_MODULE_NAME = "org.hibernate.search.jipijapa-hibernatesearch"; + /** * name of the Hibernate Search module providing the ORM mapper */ diff --git a/jpa/subsystem/src/main/java/org/jboss/as/jpa/messages/JpaLogger.java b/jpa/subsystem/src/main/java/org/jboss/as/jpa/messages/JpaLogger.java index 2f1ae7443e4e..0ed2cdd77053 100644 --- a/jpa/subsystem/src/main/java/org/jboss/as/jpa/messages/JpaLogger.java +++ b/jpa/subsystem/src/main/java/org/jboss/as/jpa/messages/JpaLogger.java @@ -753,8 +753,20 @@ public interface JpaLogger extends BasicLogger { // id = 72, value = "Could not obtain TransactionListenerRegistry from transaction manager") - @Message(id = 73, value = "Transformation of class %s failed") - IllegalStateException invalidClassFormat(@Cause Exception cause, String className); + @Message(id = 73, value = "Bytecode rewrite (transformation) of class %s failed") + String invalidClassFormat(String className); // @Message(id = 74, value = "Deprecated Hibernate51CompatibilityTransformer is enabled for all application deployments.") + + /** + * Creates an exception indicating the persistence provider integrator module, represented by the + * {@code persistenceProviderModule} parameter, had an error loading. + * + * @param cause the cause of the error. + * @param persistenceProviderModule the name of the adapter module. + * @return a {@link DeploymentUnitProcessingException} for the error. + */ + @Message(id = 74, value = "Persistence provider integrator module load error for %s") + DeploymentUnitProcessingException cannotLoadPersistenceProviderIntegratorModule(@Cause Throwable cause, String persistenceProviderModule); + } diff --git a/jpa/subsystem/src/main/java/org/jboss/as/jpa/processor/HibernateSearchProcessor.java b/jpa/subsystem/src/main/java/org/jboss/as/jpa/processor/HibernateSearchProcessor.java index 7877ea03b370..7340b0a15f08 100644 --- a/jpa/subsystem/src/main/java/org/jboss/as/jpa/processor/HibernateSearchProcessor.java +++ b/jpa/subsystem/src/main/java/org/jboss/as/jpa/processor/HibernateSearchProcessor.java @@ -125,6 +125,11 @@ else if (!providerModule.equals(searchMapperModuleName)) { } } + // Configure sourcing of Jandex indexes in Hibernate Search, + // so that it can look for @ProjectionConstructor annotations + deploymentUnit.addToAttachmentList(JpaAttachments.INTEGRATOR_ADAPTOR_MODULE_NAMES, + Configuration.HIBERNATE_SEARCH_INTEGRATOR_ADAPTOR_MODULE_NAME); + List backendTypes = HibernateSearchDeploymentMarker.getBackendTypes(deploymentUnit); if (backendTypes != null) { if (backendTypes.contains(Configuration.HIBERNATE_SEARCH_BACKEND_TYPE_VALUE_LUCENE)) { diff --git a/jpa/subsystem/src/main/java/org/jboss/as/jpa/processor/JPADelegatingClassFileTransformer.java b/jpa/subsystem/src/main/java/org/jboss/as/jpa/processor/JPADelegatingClassFileTransformer.java index 3f399e6b369b..d414d255ffa0 100644 --- a/jpa/subsystem/src/main/java/org/jboss/as/jpa/processor/JPADelegatingClassFileTransformer.java +++ b/jpa/subsystem/src/main/java/org/jboss/as/jpa/processor/JPADelegatingClassFileTransformer.java @@ -73,7 +73,10 @@ public ByteBuffer run() { // because we won't ever be called to transform already loaded classes. result = transformer.transform(classLoader, className, null, protectionDomain, transformedBuffer); } catch (Exception e) { - throw JpaLogger.ROOT_LOGGER.invalidClassFormat(e, className); + String message = JpaLogger.ROOT_LOGGER.invalidClassFormat(className); + // ModuleClassLoader.defineClass discards the cause of the exception we throw, so to ensure it is logged we log it here. + ROOT_LOGGER.error(message,e); + throw new IllegalStateException(message); } if (result != null) { transformedBuffer = result; diff --git a/jpa/subsystem/src/main/java/org/jboss/as/jpa/processor/JpaAttachments.java b/jpa/subsystem/src/main/java/org/jboss/as/jpa/processor/JpaAttachments.java index 34f7a9c1d794..a00e31ce8357 100644 --- a/jpa/subsystem/src/main/java/org/jboss/as/jpa/processor/JpaAttachments.java +++ b/jpa/subsystem/src/main/java/org/jboss/as/jpa/processor/JpaAttachments.java @@ -1,8 +1,8 @@ /* - * JBoss, Home of Professional Open Source - * Copyright 2010, Red Hat Inc., and individual contributors as indicated - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. + * JBoss, Home of Professional Open Source. + * Copyright 2010, Red Hat, Inc., and individual contributors + * as indicated by the @author tags. See the copyright.txt file in the + * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as @@ -25,6 +25,7 @@ import org.jboss.as.jpa.config.JPADeploymentSettings; import org.jboss.as.jpa.config.PersistenceProviderDeploymentHolder; import org.jboss.as.server.deployment.AttachmentKey; +import org.jboss.as.server.deployment.AttachmentList; import org.jboss.msc.service.ServiceName; import jakarta.transaction.TransactionSynchronizationRegistry; @@ -51,6 +52,8 @@ public final class JpaAttachments { public static final AttachmentKey BEAN_MANAGER_AFTER_DEPLOYMENT_VALIDATION_ATTACHMENT_KEY = AttachmentKey.create(BeanManagerAfterDeploymentValidation.class); + public static final AttachmentKey> INTEGRATOR_ADAPTOR_MODULE_NAMES = AttachmentKey.createList(String.class); + private JpaAttachments() { } } diff --git a/jpa/subsystem/src/main/java/org/jboss/as/jpa/processor/PersistenceProviderAdaptorLoader.java b/jpa/subsystem/src/main/java/org/jboss/as/jpa/processor/PersistenceProviderAdaptorLoader.java index ffda3fe218d6..de59a9e0df1f 100644 --- a/jpa/subsystem/src/main/java/org/jboss/as/jpa/processor/PersistenceProviderAdaptorLoader.java +++ b/jpa/subsystem/src/main/java/org/jboss/as/jpa/processor/PersistenceProviderAdaptorLoader.java @@ -24,6 +24,9 @@ import static org.jboss.as.jpa.messages.JpaLogger.ROOT_LOGGER; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; import java.util.Map; import java.util.ServiceLoader; @@ -32,6 +35,7 @@ import org.jboss.as.jpa.messages.JpaLogger; import org.jboss.as.jpa.transaction.JtaManagerImpl; +import org.jboss.jandex.Index; import org.jboss.modules.Module; import org.jboss.modules.ModuleIdentifier; import org.jboss.modules.ModuleLoadException; @@ -39,6 +43,7 @@ import org.jipijapa.plugin.spi.JtaManager; import org.jipijapa.plugin.spi.ManagementAdaptor; import org.jipijapa.plugin.spi.PersistenceProviderAdaptor; +import org.jipijapa.plugin.spi.PersistenceProviderIntegratorAdaptor; import org.jipijapa.plugin.spi.PersistenceUnitMetadata; import org.jipijapa.plugin.spi.Platform; @@ -171,4 +176,32 @@ public static PersistenceProviderAdaptor loadPersistenceAdapter(final Persistenc persistenceProviderAdaptor; } + + /** + * Loads the persistence provider integrator adapter + * + * @param adapterModule the adapter module name + * @return the adaptors for the given module + * @throws ModuleLoadException + */ + public static List loadPersistenceProviderIntegratorModule( + String adapterModule, Collection indexes) throws ModuleLoadException { + final ModuleLoader moduleLoader = Module.getBootModuleLoader(); + + List persistenceProviderAdaptors = new ArrayList<>(); + + Module module = moduleLoader.loadModule(adapterModule); + final ServiceLoader serviceLoader = + module.loadService(PersistenceProviderIntegratorAdaptor.class); + for (PersistenceProviderIntegratorAdaptor adaptor : serviceLoader) { + persistenceProviderAdaptors.add(adaptor); + ROOT_LOGGER.debugf("loaded persistence provider integrator adapter %s from %s", adaptor, adapterModule); + if (adaptor != null) { + adaptor.injectIndexes(indexes); + } + } + + return persistenceProviderAdaptors; + } + } diff --git a/jpa/subsystem/src/main/java/org/jboss/as/jpa/processor/PersistenceUnitServiceHandler.java b/jpa/subsystem/src/main/java/org/jboss/as/jpa/processor/PersistenceUnitServiceHandler.java index 95451a4c13c1..ceb87d270ef5 100644 --- a/jpa/subsystem/src/main/java/org/jboss/as/jpa/processor/PersistenceUnitServiceHandler.java +++ b/jpa/subsystem/src/main/java/org/jboss/as/jpa/processor/PersistenceUnitServiceHandler.java @@ -89,6 +89,7 @@ import org.jboss.as.server.deployment.DeploymentUtils; import org.jboss.as.server.deployment.JPADeploymentMarker; import org.jboss.as.server.deployment.SubDeploymentMarker; +import org.jboss.as.server.deployment.annotation.CompositeIndex; import org.jboss.as.server.deployment.module.ResourceRoot; import org.jboss.as.weld.WeldCapability; import org.jboss.dmr.ModelNode; @@ -105,6 +106,7 @@ import org.jboss.msc.service.ServiceTarget; import org.jipijapa.plugin.spi.ManagementAdaptor; import org.jipijapa.plugin.spi.PersistenceProviderAdaptor; +import org.jipijapa.plugin.spi.PersistenceProviderIntegratorAdaptor; import org.jipijapa.plugin.spi.PersistenceUnitMetadata; import org.jipijapa.plugin.spi.Platform; import org.jipijapa.plugin.spi.TwoPhaseBootstrapCapable; @@ -263,11 +265,13 @@ private static void addPuService(final DeploymentPhaseContext phaseContext, fina final PersistenceProviderDeploymentHolder persistenceProviderDeploymentHolder = getPersistenceProviderDeploymentHolder(deploymentUnit); final PersistenceProvider provider = lookupProvider(pu, persistenceProviderDeploymentHolder, deploymentUnit); final PersistenceProviderAdaptor adaptor = getPersistenceProviderAdaptor(pu, persistenceProviderDeploymentHolder, deploymentUnit, provider, platform); + final List integratorAdaptors = getPersistenceProviderIntegratorAdaptors(deploymentUnit); final boolean twoPhaseBootStrapCapable = (adaptor instanceof TwoPhaseBootstrapCapable) && Configuration.allowTwoPhaseBootstrap(pu); if (startEarly) { if (twoPhaseBootStrapCapable) { - deployPersistenceUnitPhaseOne(deploymentUnit, eeModuleDescription, serviceTarget, classLoader, pu, adaptor); + deployPersistenceUnitPhaseOne(deploymentUnit, eeModuleDescription, serviceTarget, + classLoader, pu, adaptor, integratorAdaptors); } else if (false == Configuration.needClassFileTransformer(pu)) { // will start later when startEarly == false @@ -278,16 +282,18 @@ else if (false == Configuration.needClassFileTransformer(pu)) { // we need class file transformer to work, don't allow Jakarta Contexts and Dependency Injection bean manager to be access since that // could cause application classes to be loaded (workaround by setting jboss.as.jpa.classtransformer to false). WFLY-1463 final boolean allowCdiBeanManagerAccess = false; - deployPersistenceUnit(deploymentUnit, eeModuleDescription, serviceTarget, classLoader, pu, provider, adaptor, allowCdiBeanManagerAccess); + deployPersistenceUnit(deploymentUnit, eeModuleDescription, serviceTarget, + classLoader, pu, provider, adaptor, integratorAdaptors, allowCdiBeanManagerAccess); } } else { // !startEarly if (twoPhaseBootStrapCapable) { - deployPersistenceUnitPhaseTwo(deploymentUnit, eeModuleDescription, serviceTarget, classLoader, pu, provider, adaptor); + deployPersistenceUnitPhaseTwo(deploymentUnit, eeModuleDescription, serviceTarget, classLoader, pu, provider, adaptor, integratorAdaptors); } else if (false == Configuration.needClassFileTransformer(pu)) { final boolean allowCdiBeanManagerAccess = true; // PUs that have Configuration.JPA_CONTAINER_CLASS_TRANSFORMER = false will start during INSTALL phase - deployPersistenceUnit(deploymentUnit, eeModuleDescription, serviceTarget, classLoader, pu, provider, adaptor, allowCdiBeanManagerAccess); + deployPersistenceUnit(deploymentUnit, eeModuleDescription, serviceTarget, + classLoader, pu, provider, adaptor, integratorAdaptors, allowCdiBeanManagerAccess); } } @@ -311,6 +317,7 @@ else if (false == Configuration.needClassFileTransformer(pu)) { * @param pu * @param provider * @param adaptor + * @param integratorAdaptors Adapters for integrators, e.g. Hibernate Search. * @param allowCdiBeanManagerAccess * @throws DeploymentUnitProcessingException */ @@ -322,6 +329,7 @@ private static void deployPersistenceUnit( final PersistenceUnitMetadata pu, final PersistenceProvider provider, final PersistenceProviderAdaptor adaptor, + final List integratorAdaptors, final boolean allowCdiBeanManagerAccess) throws DeploymentUnitProcessingException { pu.setClassLoader(classLoader); TransactionManager transactionManager = ContextTransactionManager.getInstance(); @@ -329,7 +337,7 @@ private static void deployPersistenceUnit( CapabilityServiceSupport capabilitySupport = deploymentUnit.getAttachment(Attachments.CAPABILITY_SERVICE_SUPPORT); try { ValidatorFactory validatorFactory = null; - final HashMap properties = new HashMap<>(); + final HashMap properties = new HashMap<>(); CapabilityServiceSupport css = deploymentUnit.getAttachment(Attachments.CAPABILITY_SERVICE_SUPPORT); if (!ValidationMode.NONE.equals(pu.getValidationMode()) @@ -345,6 +353,11 @@ private static void deployPersistenceUnit( // add persistence provider specific properties adaptor.addProviderProperties(properties, pu); + // add persistence provider integrator specific properties + for (PersistenceProviderIntegratorAdaptor integratorAdaptor : integratorAdaptors) { + integratorAdaptor.addIntegratorProperties(properties, pu); + } + final ServiceName puServiceName = PersistenceUnitServiceImpl.getPUServiceName(pu); deploymentUnit.putAttachment(JpaAttachments.PERSISTENCE_UNIT_SERVICE_KEY, puServiceName); @@ -353,8 +366,10 @@ private static void deployPersistenceUnit( deploymentUnit.addToAttachmentList(Attachments.WEB_DEPENDENCIES, puServiceName); final PersistenceUnitServiceImpl service = - new PersistenceUnitServiceImpl(properties, classLoader, pu, adaptor, provider, PersistenceUnitRegistryImpl.INSTANCE, - deploymentUnit.getServiceName(), validatorFactory, deploymentUnit.getAttachment(org.jboss.as.ee.naming.Attachments.JAVA_NAMESPACE_SETUP_ACTION), + new PersistenceUnitServiceImpl(properties, classLoader, pu, adaptor, integratorAdaptors, provider, + PersistenceUnitRegistryImpl.INSTANCE, + deploymentUnit.getServiceName(), validatorFactory, + deploymentUnit.getAttachment(org.jboss.as.ee.naming.Attachments.JAVA_NAMESPACE_SETUP_ACTION), beanManagerAfterDeploymentValidation ); ServiceBuilder builder = serviceTarget.addService(puServiceName, service); @@ -444,6 +459,7 @@ private static void deployPersistenceUnit( * @param classLoader * @param pu * @param adaptor + * @param integratorAdaptors Adapters for integrators, e.g. Hibernate Search. * @throws DeploymentUnitProcessingException */ private static void deployPersistenceUnitPhaseOne( @@ -452,11 +468,13 @@ private static void deployPersistenceUnitPhaseOne( final ServiceTarget serviceTarget, final ModuleClassLoader classLoader, final PersistenceUnitMetadata pu, - final PersistenceProviderAdaptor adaptor) throws DeploymentUnitProcessingException { + final PersistenceProviderAdaptor adaptor, + final List integratorAdaptors) + throws DeploymentUnitProcessingException { CapabilityServiceSupport capabilitySupport = deploymentUnit.getAttachment(Attachments.CAPABILITY_SERVICE_SUPPORT); pu.setClassLoader(classLoader); try { - final HashMap properties = new HashMap<>(); + final HashMap properties = new HashMap<>(); ProxyBeanManager proxyBeanManager = null; // JPA 2.1 sections 3.5.1 + 9.1 require the Jakarta Contexts and Dependency Injection bean manager to be passed to the peristence provider @@ -478,6 +496,11 @@ private static void deployPersistenceUnitPhaseOne( // add persistence provider specific properties adaptor.addProviderProperties(properties, pu); + // add persistence provider integrator specific properties + for (PersistenceProviderIntegratorAdaptor integratorAdaptor : integratorAdaptors) { + integratorAdaptor.addIntegratorProperties(properties, pu); + } + final ServiceName puServiceName = PersistenceUnitServiceImpl.getPUServiceName(pu).append(FIRST_PHASE); deploymentUnit.putAttachment(JpaAttachments.PERSISTENCE_UNIT_SERVICE_KEY, puServiceName); @@ -557,6 +580,7 @@ private static void deployPersistenceUnitPhaseOne( * @param pu * @param provider * @param adaptor + * @param integratorAdaptors Adapters for integrators, e.g. Hibernate Search. * @throws DeploymentUnitProcessingException */ private static void deployPersistenceUnitPhaseTwo( @@ -566,14 +590,15 @@ private static void deployPersistenceUnitPhaseTwo( final ModuleClassLoader classLoader, final PersistenceUnitMetadata pu, final PersistenceProvider provider, - final PersistenceProviderAdaptor adaptor) throws DeploymentUnitProcessingException { + final PersistenceProviderAdaptor adaptor, + final List integratorAdaptors) throws DeploymentUnitProcessingException { TransactionManager transactionManager = ContextTransactionManager.getInstance(); TransactionSynchronizationRegistry transactionSynchronizationRegistry = deploymentUnit.getAttachment(JpaAttachments.TRANSACTION_SYNCHRONIZATION_REGISTRY); CapabilityServiceSupport capabilitySupport = deploymentUnit.getAttachment(Attachments.CAPABILITY_SERVICE_SUPPORT); pu.setClassLoader(classLoader); try { ValidatorFactory validatorFactory = null; - final HashMap properties = new HashMap<>(); + final HashMap properties = new HashMap<>(); if (!ValidationMode.NONE.equals(pu.getValidationMode()) && capabilitySupport.hasCapability("org.wildfly.bean-validation")) { // Get the Jakarta Contexts and Dependency Injection enabled ValidatorFactory @@ -586,6 +611,11 @@ private static void deployPersistenceUnitPhaseTwo( // add persistence provider specific properties adaptor.addProviderProperties(properties, pu); + // add persistence provider integrator specific properties + for (PersistenceProviderIntegratorAdaptor integratorAdaptor : integratorAdaptors) { + integratorAdaptor.addIntegratorProperties(properties, pu); + } + final ServiceName puServiceName = PersistenceUnitServiceImpl.getPUServiceName(pu); deploymentUnit.putAttachment(JpaAttachments.PERSISTENCE_UNIT_SERVICE_KEY, puServiceName); @@ -593,7 +623,11 @@ private static void deployPersistenceUnitPhaseTwo( deploymentUnit.addToAttachmentList(Attachments.WEB_DEPENDENCIES, puServiceName); - final PersistenceUnitServiceImpl service = new PersistenceUnitServiceImpl(properties, classLoader, pu, adaptor, provider, PersistenceUnitRegistryImpl.INSTANCE, deploymentUnit.getServiceName(), validatorFactory, deploymentUnit.getAttachment(org.jboss.as.ee.naming.Attachments.JAVA_NAMESPACE_SETUP_ACTION), beanManagerAfterDeploymentValidation); + final PersistenceUnitServiceImpl service = new PersistenceUnitServiceImpl(properties, classLoader, pu, + adaptor, integratorAdaptors, provider, PersistenceUnitRegistryImpl.INSTANCE, + deploymentUnit.getServiceName(), validatorFactory, + deploymentUnit.getAttachment(org.jboss.as.ee.naming.Attachments.JAVA_NAMESPACE_SETUP_ACTION), + beanManagerAfterDeploymentValidation); ServiceBuilder builder = serviceTarget.addService(puServiceName, service); // the PU service has to depend on the JPAService which is responsible for setting up the necessary JPA infrastructure (like registering the cache EventListener(s)) // @see https://issues.jboss.org/browse/WFLY-1531 for details @@ -847,6 +881,21 @@ private static PersistenceProviderAdaptor getPersistenceProviderAdaptor( return adaptor; } + private static List getPersistenceProviderIntegratorAdaptors(DeploymentUnit deploymentUnit) + throws DeploymentUnitProcessingException { + List integratorAdaptorModuleNames = deploymentUnit.getAttachmentList(JpaAttachments.INTEGRATOR_ADAPTOR_MODULE_NAMES); + List integratorAdaptorList = new ArrayList<>(); + CompositeIndex compositeIndex = deploymentUnit.getAttachment(Attachments.COMPOSITE_ANNOTATION_INDEX); + for (String moduleName : integratorAdaptorModuleNames) { + try { + integratorAdaptorList.addAll(PersistenceProviderAdaptorLoader.loadPersistenceProviderIntegratorModule(moduleName, compositeIndex.getIndexes())); + } catch (RuntimeException | ModuleLoadException e) { + throw JpaLogger.ROOT_LOGGER.cannotLoadPersistenceProviderIntegratorModule(e, moduleName); + } + } + return integratorAdaptorList; + } + private static JtaManagerImpl createManager(DeploymentUnit deploymentUnit) { return new JtaManagerImpl(deploymentUnit.getAttachment(JpaAttachments.TRANSACTION_SYNCHRONIZATION_REGISTRY)); } diff --git a/jpa/subsystem/src/main/java/org/jboss/as/jpa/service/PersistenceUnitServiceImpl.java b/jpa/subsystem/src/main/java/org/jboss/as/jpa/service/PersistenceUnitServiceImpl.java index 974129366e92..f0b814599d02 100644 --- a/jpa/subsystem/src/main/java/org/jboss/as/jpa/service/PersistenceUnitServiceImpl.java +++ b/jpa/subsystem/src/main/java/org/jboss/as/jpa/service/PersistenceUnitServiceImpl.java @@ -26,6 +26,7 @@ import java.security.AccessController; import java.security.PrivilegedAction; import java.util.Collections; +import java.util.List; import java.util.Map; import java.util.concurrent.ExecutorService; import java.util.concurrent.RejectedExecutionException; @@ -53,6 +54,7 @@ import org.jboss.msc.value.InjectedValue; import org.jipijapa.plugin.spi.EntityManagerFactoryBuilder; import org.jipijapa.plugin.spi.PersistenceProviderAdaptor; +import org.jipijapa.plugin.spi.PersistenceProviderIntegratorAdaptor; import org.jipijapa.plugin.spi.PersistenceUnitMetadata; import org.wildfly.security.manager.action.GetAccessControlContextAction; import org.wildfly.security.manager.WildFlySecurityManager; @@ -81,6 +83,7 @@ public class PersistenceUnitServiceImpl implements Service persistenceProviderIntegratorAdaptors; private final PersistenceProvider persistenceProvider; private final PersistenceUnitMetadata pu; private final ClassLoader classLoader; @@ -98,6 +101,7 @@ public PersistenceUnitServiceImpl( final ClassLoader classLoader, final PersistenceUnitMetadata pu, final PersistenceProviderAdaptor persistenceProviderAdaptor, + final List persistenceProviderIntegratorAdaptors, final PersistenceProvider persistenceProvider, final PersistenceUnitRegistryImpl persistenceUnitRegistry, final ServiceName deploymentUnitServiceName, @@ -106,6 +110,7 @@ public PersistenceUnitServiceImpl( this.properties = properties; this.pu = pu; this.persistenceProviderAdaptor = persistenceProviderAdaptor; + this.persistenceProviderIntegratorAdaptors = persistenceProviderIntegratorAdaptors; this.persistenceProvider = persistenceProvider; this.classLoader = classLoader; this.persistenceUnitRegistry = persistenceUnitRegistry; @@ -367,6 +372,9 @@ private EntityManagerFactory createContainerEntityManagerFactory() { return persistenceProvider.createContainerEntityManagerFactory(pu, properties); } finally { persistenceProviderAdaptor.afterCreateContainerEntityManagerFactory(pu); + for (PersistenceProviderIntegratorAdaptor adaptor : persistenceProviderIntegratorAdaptors) { + adaptor.afterCreateContainerEntityManagerFactory(pu); + } } } diff --git a/jsf/injection/pom.xml b/jsf/injection/pom.xml index 406195ec2c7f..c4c875336ff7 100644 --- a/jsf/injection/pom.xml +++ b/jsf/injection/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-jsf-injection diff --git a/jsf/pom.xml b/jsf/pom.xml index bc284fa6df14..9fc8e7b39be9 100644 --- a/jsf/pom.xml +++ b/jsf/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-jsf-parent diff --git a/jsf/subsystem/pom.xml b/jsf/subsystem/pom.xml index 88d3ed0f055a..d0c86ce6b4b5 100644 --- a/jsf/subsystem/pom.xml +++ b/jsf/subsystem/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-jsf diff --git a/legacy/jsr77/pom.xml b/legacy/jsr77/pom.xml index fcadfe0a66fd..312d373739de 100644 --- a/legacy/jsr77/pom.xml +++ b/legacy/jsr77/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT ../../pom.xml diff --git a/legacy/keycloak/pom.xml b/legacy/keycloak/pom.xml index e23f7a839c63..83f952a86167 100755 --- a/legacy/keycloak/pom.xml +++ b/legacy/keycloak/pom.xml @@ -25,7 +25,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT ../../pom.xml diff --git a/legacy/keycloak/src/test/java/org/keycloak/subsystem/adapter/extension/MigrateOperationTestCase.java b/legacy/keycloak/src/test/java/org/keycloak/subsystem/adapter/extension/MigrateOperationTestCase.java index 488a7e6a6117..c9f1422272c7 100644 --- a/legacy/keycloak/src/test/java/org/keycloak/subsystem/adapter/extension/MigrateOperationTestCase.java +++ b/legacy/keycloak/src/test/java/org/keycloak/subsystem/adapter/extension/MigrateOperationTestCase.java @@ -279,11 +279,11 @@ protected void initializeExtraSubystemsAndModel(ExtensionRegistry extensionRegis .build(); PathElement keycloakExtension = PathElement.pathElement(EXTENSION, "org.keycloak.keycloak-adapter-subsystem"); rootRegistration.registerSubModel(new SimpleResourceDefinition(keycloakExtension, ControllerResolver.getResolver(EXTENSION))) - .registerOperationHandler(removeExtension, new ReloadRequiredRemoveStepHandler()); + .registerOperationHandler(removeExtension, ReloadRequiredRemoveStepHandler.INSTANCE); rootResource.registerChild(keycloakExtension, Resource.Factory.create()); PathElement elytronExtension = PathElement.pathElement(EXTENSION, "org.wildfly.extension.elytron"); rootRegistration.registerSubModel(new SimpleResourceDefinition(elytronExtension, ControllerResolver.getResolver(EXTENSION))) - .registerOperationHandler(removeExtension, new ReloadRequiredRemoveStepHandler()); + .registerOperationHandler(removeExtension, ReloadRequiredRemoveStepHandler.INSTANCE); rootResource.registerChild(elytronExtension, Resource.Factory.create()); rootRegistration.registerSubModel(new SimpleResourceDefinition(PathElement.pathElement(EXTENSION), diff --git a/legacy/opentracing-extension/pom.xml b/legacy/opentracing-extension/pom.xml index d9a53d930ec2..882814bea8cb 100644 --- a/legacy/opentracing-extension/pom.xml +++ b/legacy/opentracing-extension/pom.xml @@ -31,7 +31,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-microprofile-opentracing-extension @@ -41,16 +41,16 @@ - ${project.groupId} + ${full.maven.groupId} wildfly-standard-expansion-bom - ${ee.maven.version} + ${full.maven.version} pom import - ${project.groupId} + ${ee.maven.groupId} wildfly-standard-test-bom - ${project.version} + ${ee.maven.version} pom import diff --git a/legacy/opentracing-extension/src/test/java/org/wildfly/extension/microprofile/opentracing/MigrateOperationTestCase.java b/legacy/opentracing-extension/src/test/java/org/wildfly/extension/microprofile/opentracing/MigrateOperationTestCase.java index ff054af48997..f19f34c5e5dd 100644 --- a/legacy/opentracing-extension/src/test/java/org/wildfly/extension/microprofile/opentracing/MigrateOperationTestCase.java +++ b/legacy/opentracing-extension/src/test/java/org/wildfly/extension/microprofile/opentracing/MigrateOperationTestCase.java @@ -110,7 +110,7 @@ protected void initializeExtraSubystemsAndModel(ExtensionRegistry extensionRegis .build(); PathElement opentracingExtension = PathElement.pathElement(EXTENSION, SubsystemExtension.EXTENSION_NAME); rootRegistration.registerSubModel(new SimpleResourceDefinition(opentracingExtension, ControllerResolver.getResolver(EXTENSION))) - .registerOperationHandler(removeExtension, new ReloadRequiredRemoveStepHandler()); + .registerOperationHandler(removeExtension, ReloadRequiredRemoveStepHandler.INSTANCE); rootResource.registerChild(opentracingExtension, Resource.Factory.create()); rootRegistration.registerSubModel( diff --git a/mail/pom.xml b/mail/pom.xml index c65adc82ee22..b4ee3c861e94 100644 --- a/mail/pom.xml +++ b/mail/pom.xml @@ -30,7 +30,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-mail diff --git a/messaging-activemq/injection/pom.xml b/messaging-activemq/injection/pom.xml index e5c97cccbaff..68e24455b93d 100644 --- a/messaging-activemq/injection/pom.xml +++ b/messaging-activemq/injection/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-messaging-activemq-injection diff --git a/messaging-activemq/injection/src/main/java/org/wildfly/extension/messaging/activemq/logging/MessagingLogger.java b/messaging-activemq/injection/src/main/java/org/wildfly/extension/messaging/activemq/logging/MessagingLogger.java index d8b9838ef5a2..39c109bf0ab1 100644 --- a/messaging-activemq/injection/src/main/java/org/wildfly/extension/messaging/activemq/logging/MessagingLogger.java +++ b/messaging-activemq/injection/src/main/java/org/wildfly/extension/messaging/activemq/logging/MessagingLogger.java @@ -887,4 +887,6 @@ public interface MessagingLogger extends BasicLogger { @Message(id = 107, value = "You must define a elytron security doman when security is enabled.") IllegalStateException securityEnabledWithoutDomain(); + @Message(id = 108, value = "Either socket-binding or jgroups-cluster attribute is required.") + OperationFailedException socketBindingOrJGroupsClusterRequired(); } diff --git a/messaging-activemq/pom.xml b/messaging-activemq/pom.xml index c682631d2b90..0baec4a1ca47 100644 --- a/messaging-activemq/pom.xml +++ b/messaging-activemq/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-messaging-activemq diff --git a/messaging-activemq/subsystem/pom.xml b/messaging-activemq/subsystem/pom.xml index 3edad11e3d91..7e3ef1882fac 100644 --- a/messaging-activemq/subsystem/pom.xml +++ b/messaging-activemq/subsystem/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-messaging-activemq-subsystem diff --git a/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/AbstractTransportDefinition.java b/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/AbstractTransportDefinition.java index bdf3cbaa634b..7387b2cb6aa7 100644 --- a/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/AbstractTransportDefinition.java +++ b/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/AbstractTransportDefinition.java @@ -19,7 +19,6 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ - package org.wildfly.extension.messaging.activemq; import java.util.Arrays; @@ -54,18 +53,25 @@ public abstract class AbstractTransportDefinition extends PersistentResourceDefi public static final String CONNECTOR_CAPABILITY_NAME = "org.wildfly.messaging.activemq.connector"; public static final String ACCEPTOR_CAPABILITY_NAME = "org.wildfly.messaging.activemq.acceptor"; + static final RuntimeCapability CONNECTOR_CAPABILITY = RuntimeCapability.Builder.of(CONNECTOR_CAPABILITY_NAME, true, ConnectorService.class) + .setDynamicNameMapper(TransportCapabilityNameMapper.INSTANCE) + .build(); private final boolean registerRuntimeOnly; private final AttributeDefinition[] attrs; protected final boolean isAcceptor; - private static class TransportCapabilityNameMapper implements Function { + private static class TransportCapabilityNameMapper implements Function { + private static final TransportCapabilityNameMapper INSTANCE = new TransportCapabilityNameMapper(); - private TransportCapabilityNameMapper(){} + + private TransportCapabilityNameMapper() { + } + @Override public String[] apply(PathAddress address) { String[] result = new String[2]; PathAddress serverAddress = MessagingServices.getActiveMQServerPathAddress(address); - if(serverAddress.size() > 0 ) { + if (serverAddress.size() > 0) { result[0] = serverAddress.getLastElement().getValue(); } else { result[0] = "external"; @@ -75,58 +81,60 @@ public String[] apply(PathAddress address) { } } - public static class TransportCapabilityReferenceRecorder extends CapabilityReferenceRecorder.ResourceCapabilityReferenceRecorder { - private final boolean external; - public TransportCapabilityReferenceRecorder(String baseDependentName, String baseRequirementName, boolean external) { - super(external ? DynamicNameMappers.SIMPLE : DynamicNameMappers.PARENT, baseDependentName, TransportCapabilityNameMapper.INSTANCE, baseRequirementName); - this.external = external; - } - - @Override - public void addCapabilityRequirements(OperationContext context, Resource resource, String attributeName, String... attributeValues) { - processCapabilityRequirement(context, attributeName, false, attributeValues); - } - - @Override - public void removeCapabilityRequirements(OperationContext context, Resource resource, String attributeName, String... attributeValues) { - processCapabilityRequirement(context, attributeName, true, attributeValues); - } - - private void processCapabilityRequirement(OperationContext context, String attributeName, boolean remove, String... attributeValues) { - String dependentName = getDependentName(context.getCurrentAddress()); - String requirement = getRequirementName(context.getCurrentAddress()); - for (String att : attributeValues) { - String requirementName = RuntimeCapability.buildDynamicCapabilityName(requirement, att); - if (remove) { - context.deregisterCapabilityRequirement(requirementName, dependentName, attributeName); - } else { - context.registerAdditionalCapabilityRequirement(requirementName, dependentName, attributeName); - } - } - } - - private String getDependentName(PathAddress address) { - if (external) { - return RuntimeCapability.buildDynamicCapabilityName(getBaseDependentName(), DynamicNameMappers.SIMPLE.apply(address)); - } - return RuntimeCapability.buildDynamicCapabilityName(getBaseDependentName(), DynamicNameMappers.PARENT.apply(address)); - } - - private String getRequirementName(PathAddress address) { - PathAddress serverAddress = MessagingServices.getActiveMQServerPathAddress(address); - if (serverAddress.size() > 0) { - return RuntimeCapability.buildDynamicCapabilityName(getBaseRequirementName(), serverAddress.getLastElement().getValue()); - } - return getBaseRequirementName(); - } - - @Override - public String getBaseRequirementName() { - if (external) { - return super.getBaseRequirementName() + ".external"; - } - return super.getBaseRequirementName(); - } + public static class TransportCapabilityReferenceRecorder extends CapabilityReferenceRecorder.ResourceCapabilityReferenceRecorder { + + private final boolean external; + + public TransportCapabilityReferenceRecorder(String baseDependentName, String baseRequirementName, boolean external) { + super(external ? DynamicNameMappers.SIMPLE : DynamicNameMappers.PARENT, baseDependentName, TransportCapabilityNameMapper.INSTANCE, baseRequirementName); + this.external = external; + } + + @Override + public void addCapabilityRequirements(OperationContext context, Resource resource, String attributeName, String... attributeValues) { + processCapabilityRequirement(context, attributeName, false, attributeValues); + } + + @Override + public void removeCapabilityRequirements(OperationContext context, Resource resource, String attributeName, String... attributeValues) { + processCapabilityRequirement(context, attributeName, true, attributeValues); + } + + private void processCapabilityRequirement(OperationContext context, String attributeName, boolean remove, String... attributeValues) { + String dependentName = getDependentName(context.getCurrentAddress()); + String requirement = getRequirementName(context.getCurrentAddress()); + for (String att : attributeValues) { + String requirementName = RuntimeCapability.buildDynamicCapabilityName(requirement, att); + if (remove) { + context.deregisterCapabilityRequirement(requirementName, dependentName, attributeName); + } else { + context.registerAdditionalCapabilityRequirement(requirementName, dependentName, attributeName); + } + } + } + + private String getDependentName(PathAddress address) { + if (external) { + return RuntimeCapability.buildDynamicCapabilityName(getBaseDependentName(), DynamicNameMappers.SIMPLE.apply(address)); + } + return RuntimeCapability.buildDynamicCapabilityName(getBaseDependentName(), DynamicNameMappers.PARENT.apply(address)); + } + + private String getRequirementName(PathAddress address) { + PathAddress serverAddress = MessagingServices.getActiveMQServerPathAddress(address); + if (serverAddress.size() > 0) { + return RuntimeCapability.buildDynamicCapabilityName(getBaseRequirementName(), serverAddress.getLastElement().getValue()); + } + return getBaseRequirementName(); + } + + @Override + public String getBaseRequirementName() { + if (external) { + return super.getBaseRequirementName() + ".external"; + } + return super.getBaseRequirementName(); + } @Override public String[] getRequirementPatternSegments(String dynamicElement, PathAddress registrationAddress) { @@ -156,15 +164,15 @@ protected AbstractTransportDefinition(final boolean isAcceptor, final String spe super(new SimpleResourceDefinition.Parameters(PathElement.pathElement(specificType), new StandardResourceDescriptionResolver((isAcceptor ? CommonAttributes.ACCEPTOR : CommonAttributes.CONNECTOR), MessagingExtension.RESOURCE_NAME, MessagingExtension.class.getClassLoader(), true, false) { - @Override - public String getResourceDescription(Locale locale, ResourceBundle bundle) { - return bundle.getString(specificType); - } - }) + @Override + public String getResourceDescription(Locale locale, ResourceBundle bundle) { + return bundle.getString(specificType); + } + }) .setCapabilities(RuntimeCapability.Builder.of(isAcceptor ? ACCEPTOR_CAPABILITY_NAME : CONNECTOR_CAPABILITY_NAME, true) .setDynamicNameMapper(TransportCapabilityNameMapper.INSTANCE) .build()) - .setAddHandler(new ActiveMQReloadRequiredHandlers.AddStepHandler(attrs)) + .setAddHandler(isAcceptor ? new ActiveMQReloadRequiredHandlers.AddStepHandler(attrs) : new ConnectorAdd(attrs)) .setRemoveHandler(new ActiveMQReloadRequiredHandlers.RemoveStepHandler())); this.isAcceptor = isAcceptor; this.registerRuntimeOnly = registerRuntimeOnly; @@ -175,12 +183,12 @@ protected AbstractTransportDefinition(final boolean isAcceptor, final String spe super(new SimpleResourceDefinition.Parameters(PathElement.pathElement(specificType), new StandardResourceDescriptionResolver((isAcceptor ? CommonAttributes.ACCEPTOR : CommonAttributes.CONNECTOR), MessagingExtension.RESOURCE_NAME, MessagingExtension.class.getClassLoader(), true, false) { - @Override - public String getResourceDescription(Locale locale, ResourceBundle bundle) { - return bundle.getString(specificType); - } - }) - .setAddHandler(new ActiveMQReloadRequiredHandlers.AddStepHandler(attrs)) + @Override + public String getResourceDescription(Locale locale, ResourceBundle bundle) { + return bundle.getString(specificType); + } + }) + .setAddHandler(isAcceptor ? new ActiveMQReloadRequiredHandlers.AddStepHandler(attrs) : new ConnectorAdd(attrs)) .setRemoveHandler(new ActiveMQReloadRequiredHandlers.RemoveStepHandler()) .setDeprecatedSince(deprecatedSince)); this.isAcceptor = isAcceptor; diff --git a/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/AddressSettingAdd.java b/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/AddressSettingAdd.java index be36d6c5b1ff..70532a8469e5 100644 --- a/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/AddressSettingAdd.java +++ b/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/AddressSettingAdd.java @@ -19,7 +19,6 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ - package org.wildfly.extension.messaging.activemq; import static org.wildfly.extension.messaging.activemq.ActiveMQActivationService.getActiveMQServer; @@ -57,13 +56,18 @@ private AddressSettingAdd(AttributeDefinition... attributes) { protected void populateModel(OperationContext context, ModelNode operation, final Resource resource) throws OperationFailedException { super.populateModel(context, operation, resource); - context.addStep(AddressSettingsValidator.ADD_VALIDATOR, OperationContext.Stage.MODEL); + context.addStep(AddressSettingsValidator.ADD_VALIDATOR, OperationContext.Stage.MODEL, true); + } + + @Override + protected boolean requiresRuntime(OperationContext context) { + return context.isDefaultRequiresRuntime() && !context.isBooting(); } @Override protected void performRuntime(final OperationContext context, final ModelNode operation, final ModelNode model) throws OperationFailedException { final ActiveMQServer server = getActiveMQServer(context, operation); - if(server != null) { + if (server != null) { final AddressSettings settings = createSettings(context, model); server.getAddressSettingsRepository().addMatch(context.getCurrentAddressValue(), settings); } diff --git a/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/AddressSettingRemove.java b/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/AddressSettingRemove.java index 72615da8c908..a20173bb6fd9 100644 --- a/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/AddressSettingRemove.java +++ b/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/AddressSettingRemove.java @@ -22,6 +22,9 @@ package org.wildfly.extension.messaging.activemq; + +import static org.wildfly.extension.messaging.activemq.ActiveMQActivationService.getActiveMQServer; + import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.jboss.as.controller.AbstractRemoveStepHandler; import org.jboss.as.controller.OperationContext; @@ -30,8 +33,6 @@ import org.jboss.as.controller.PathAddress; import org.jboss.as.controller.descriptions.ModelDescriptionConstants; import org.jboss.dmr.ModelNode; -import org.jboss.msc.service.ServiceController; -import org.jboss.msc.service.ServiceName; /** * {@code OperationStepHandler} removing an existing address setting. @@ -44,20 +45,10 @@ class AddressSettingRemove extends AbstractRemoveStepHandler { @Override protected void performRuntime(final OperationContext context, final ModelNode operation, final ModelNode model) throws OperationFailedException { - final ActiveMQServer server = getServer(context, operation); - if(server != null) { + final ActiveMQServer server = getActiveMQServer(context, operation); + if (server != null) { final PathAddress address = PathAddress.pathAddress(operation.require(ModelDescriptionConstants.OP_ADDR)); server.getAddressSettingsRepository().removeMatch(address.getLastElement().getValue()); } } - - static ActiveMQServer getServer(final OperationContext context, ModelNode operation) { - final ServiceName serviceName = MessagingServices.getActiveMQServiceName(PathAddress.pathAddress(operation.get(ModelDescriptionConstants.OP_ADDR))); - final ServiceController controller = context.getServiceRegistry(true).getService(serviceName); - if(controller != null) { - return ActiveMQServer.class.cast(controller.getValue()); - } - return null; - } - } diff --git a/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/AddressSettingsWriteHandler.java b/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/AddressSettingsWriteHandler.java index d6b83e0c2d85..c5844dab87be 100644 --- a/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/AddressSettingsWriteHandler.java +++ b/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/AddressSettingsWriteHandler.java @@ -31,7 +31,6 @@ import org.jboss.as.controller.OperationContext; import org.jboss.as.controller.OperationFailedException; import org.jboss.as.controller.PathAddress; -import org.jboss.as.controller.descriptions.ModelDescriptionConstants; import org.jboss.as.controller.registry.Resource; import org.jboss.dmr.ModelNode; @@ -61,10 +60,9 @@ protected boolean applyUpdateToRuntime(final OperationContext context, final Mod final ActiveMQServer server = getActiveMQServer(context, operation); if(server != null) { final ModelNode model = resource.getModel(); - final PathAddress address = PathAddress.pathAddress(operation.require(ModelDescriptionConstants.OP_ADDR)); final AddressSettings settings = AddressSettingAdd.createSettings(context, model); final HierarchicalRepository repository = server.getAddressSettingsRepository(); - final String match = address.getLastElement().getValue(); + final String match = context.getCurrentAddressValue(); final AddressSettings existingSettings = repository.getMatch(match); repository.addMatch(match, settings); if(existingSettings != null) { @@ -72,7 +70,7 @@ protected boolean applyUpdateToRuntime(final OperationContext context, final Mod @Override public void doRevertUpdateToRuntime() { // Restore the old settings - repository.addMatch(address.getLastElement().getValue(), existingSettings); + repository.addMatch(match, existingSettings); } }); } diff --git a/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/BroadcastGroupAdd.java b/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/BroadcastGroupAdd.java index 4103b9bb0bdd..1897ac63a595 100644 --- a/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/BroadcastGroupAdd.java +++ b/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/BroadcastGroupAdd.java @@ -24,6 +24,7 @@ import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP_ADDR; import static org.wildfly.extension.messaging.activemq.CommonAttributes.JGROUPS_CLUSTER; +import static org.wildfly.extension.messaging.activemq.CommonAttributes.SOCKET_BINDING; import java.util.ArrayList; import java.util.List; @@ -68,9 +69,11 @@ public void execute(OperationContext context, ModelNode operation) throws Operat if (operation.hasDefined(JGROUPS_CLUSTER.getName())) { target = target.append(CommonAttributes.JGROUPS_BROADCAST_GROUP, context.getCurrentAddressValue()); addHandler = JGroupsBroadcastGroupAdd.LEGACY_INSTANCE; - } else { + } else if (operation.hasDefined(SOCKET_BINDING.getName())) { target = target.append(CommonAttributes.SOCKET_BROADCAST_GROUP, context.getCurrentAddressValue()); addHandler = SocketBroadcastGroupAdd.LEGACY_INSTANCE; + } else { + throw MessagingLogger.ROOT_LOGGER.socketBindingOrJGroupsClusterRequired(); } op.get(OP_ADDR).set(target.toModelNode()); context.addStep(op, addHandler, OperationContext.Stage.MODEL, true); diff --git a/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/BroadcastGroupDefinition.java b/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/BroadcastGroupDefinition.java index 01aa86655a76..e36a913c6465 100644 --- a/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/BroadcastGroupDefinition.java +++ b/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/BroadcastGroupDefinition.java @@ -19,7 +19,6 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ - package org.wildfly.extension.messaging.activemq; import static org.jboss.as.controller.SimpleAttributeDefinitionBuilder.create; @@ -66,6 +65,7 @@ * @deprecated Use JGroupsBroadcastGroupDefinition or SocketBroadcastGroupDefinition. */ public class BroadcastGroupDefinition extends ShallowResourceDefinition { + public static final PrimitiveListAttributeDefinition CONNECTOR_REFS = new StringListAttributeDefinition.Builder(CONNECTORS) .setRequired(true) .setElementValidator(new StringLengthValidator(1)) @@ -75,7 +75,7 @@ public class BroadcastGroupDefinition extends ShallowResourceDefinition { .setRestartAllServices() .build(); - /** + /** * @see ActiveMQDefaultConfiguration#getDefaultBroadcastPeriod */ public static final SimpleAttributeDefinition BROADCAST_PERIOD = create("broadcast-period", LONG) @@ -93,8 +93,8 @@ public class BroadcastGroupDefinition extends ShallowResourceDefinition { public static final SimpleAttributeDefinition JGROUPS_CHANNEL = create(CommonAttributes.JGROUPS_CHANNEL) .build(); - public static final AttributeDefinition[] ATTRIBUTES = { JGROUPS_CHANNEL_FACTORY, JGROUPS_CHANNEL, JGROUPS_CLUSTER, SOCKET_BINDING, - BROADCAST_PERIOD, CONNECTOR_REFS }; + public static final AttributeDefinition[] ATTRIBUTES = {JGROUPS_CHANNEL_FACTORY, JGROUPS_CHANNEL, JGROUPS_CLUSTER, SOCKET_BINDING, + BROADCAST_PERIOD, CONNECTOR_REFS}; public static final String GET_CONNECTOR_PAIRS_AS_JSON = "get-connector-pairs-as-json"; @@ -112,7 +112,6 @@ public Collection getAttributes() { return Arrays.asList(ATTRIBUTES); } - @Override public void registerOperations(ManagementResourceRegistration registry) { super.registerOperations(registry); @@ -130,33 +129,33 @@ public void registerOperations(ManagementResourceRegistration registry) { } static void validateConnectors(OperationContext context, ModelNode operation, ModelNode connectorRefs) throws OperationFailedException { - final Set availableConnectors = getAvailableConnectors(context,operation); + final Set availableConnectors = getAvailableConnectors(context, operation); final List operationAddress = operation.get(ModelDescriptionConstants.ADDRESS).asList(); - if(connectorRefs.isDefined()) { - for(ModelNode connectorRef:connectorRefs.asList()){ + if (connectorRefs.isDefined()) { + for (ModelNode connectorRef : connectorRefs.asList()) { final String connectorName = connectorRef.asString(); - if(!availableConnectors.contains(connectorName)){ - throw MessagingLogger.ROOT_LOGGER.wrongConnectorRefInBroadCastGroup(getBroadCastGroupName(operationAddress.get(operationAddress.size()-1)), connectorName, availableConnectors); + if (!availableConnectors.contains(connectorName)) { + throw MessagingLogger.ROOT_LOGGER.wrongConnectorRefInBroadCastGroup(getBroadCastGroupName(operationAddress.get(operationAddress.size() - 1)), connectorName, availableConnectors); } } } } private static String getBroadCastGroupName(ModelNode node) { - if(node.hasDefined(CommonAttributes.BROADCAST_GROUP)) { + if (node.hasDefined(CommonAttributes.BROADCAST_GROUP)) { return node.get(CommonAttributes.BROADCAST_GROUP).asString(); } - if(node.hasDefined(CommonAttributes.SOCKET_BROADCAST_GROUP)) { + if (node.hasDefined(CommonAttributes.SOCKET_BROADCAST_GROUP)) { return node.get(CommonAttributes.SOCKET_BROADCAST_GROUP).asString(); } - if(node.hasDefined(CommonAttributes.JGROUPS_BROADCAST_GROUP)) { + if (node.hasDefined(CommonAttributes.JGROUPS_BROADCAST_GROUP)) { return node.get(CommonAttributes.JGROUPS_BROADCAST_GROUP).asString(); } return ModelType.UNDEFINED.name(); } // FIXME use capabilities & requirements - private static Set getAvailableConnectors(final OperationContext context,final ModelNode operation) throws OperationFailedException{ + private static Set getAvailableConnectors(final OperationContext context, final ModelNode operation) throws OperationFailedException { PathAddress address = PathAddress.pathAddress(operation.get(ModelDescriptionConstants.OP_ADDR)); PathAddress active = MessagingServices.getActiveMQServerPathAddress(address); Set availableConnectors = new HashSet<>(); @@ -198,4 +197,9 @@ public Set getIgnoredAttributes(OperationContext context, ModelNode oper } return ignoredAttributes; } + + @Override + protected boolean isUsingSocketBinding(PathAddress targetAddress) { + return CommonAttributes.SOCKET_BROADCAST_GROUP.equals(targetAddress.getLastElement().getKey()); + } } diff --git a/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/ConnectorAdd.java b/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/ConnectorAdd.java new file mode 100644 index 000000000000..e2d2a7721c39 --- /dev/null +++ b/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/ConnectorAdd.java @@ -0,0 +1,58 @@ +/* + * Copyright 2023 JBoss by Red Hat. + * + * 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. + */ +package org.wildfly.extension.messaging.activemq; + +import static org.wildfly.extension.messaging.activemq.ActiveMQReloadRequiredHandlers.isServiceInstalled; + +import org.jboss.as.controller.AbstractAddStepHandler; +import org.jboss.as.controller.AttributeDefinition; +import org.jboss.as.controller.OperationContext; +import org.jboss.as.controller.OperationFailedException; +import org.jboss.as.controller.capability.CapabilityServiceSupport; +import org.jboss.dmr.ModelNode; + +/** + * + * @author Emmanuel Hugonnet (c) 2023 Red Hat, Inc. + */ +public class ConnectorAdd extends AbstractAddStepHandler { + + public ConnectorAdd(AttributeDefinition... attributes) { + super(attributes); + } + + /** + * Nothing to do if is it an external connector as we don't need to update + * the underlying broker. + * + * @param context operation context + * @return {@code true} if {@code performRuntime} should be invoked; + * {@code false} otherwise. + */ + @Override + protected boolean requiresRuntime(OperationContext context) { + return context.isDefaultRequiresRuntime() && !context.isBooting() && !MessagingServices.isSubsystemResource(context) && isServiceInstalled(context); + } + + @Override + protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { + try { + TransportConfigOperationHandlers.processConnector(context, model); + } catch (CapabilityServiceSupport.NoSuchCapabilityException ex) { + throw new OperationFailedException(ex); + } + } +} diff --git a/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/ConnectorService.java b/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/ConnectorService.java new file mode 100644 index 000000000000..01bbf857fd3b --- /dev/null +++ b/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/ConnectorService.java @@ -0,0 +1,102 @@ +/* + * Copyright 2023 JBoss by Red Hat. + * + * 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. + */ +package org.wildfly.extension.messaging.activemq; + +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.PORT; +import static org.wildfly.extension.messaging.activemq.CommonAttributes.HOST; +import java.net.InetSocketAddress; +import java.util.Map; +import java.util.function.Supplier; +import org.apache.activemq.artemis.api.core.TransportConfiguration; +import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants; +import org.apache.activemq.artemis.core.server.ActiveMQServer; +import org.jboss.as.network.ClientMapping; +import org.jboss.as.network.NetworkUtils; +import org.jboss.as.network.OutboundSocketBinding; +import org.jboss.as.network.SocketBinding; +import org.jboss.msc.Service; +import org.jboss.msc.service.StartContext; +import org.jboss.msc.service.StartException; +import org.jboss.msc.service.StopContext; + +/** + * + * @author Emmanuel Hugonnet (c) 2023 Red Hat, Inc. + */ +class ConnectorService implements Service { + + private final Supplier serverSupplier; + private final Supplier socketBindingSupplier; + private final Supplier outboundSocketBindingSupplier; + private final String factoryClass; + private final Map parameters; + private final Map extraParameters; + private final String name; + + ConnectorService(Supplier serverSupplier, Supplier socketBindingSupplier, Supplier outboundSocketBindingSupplier, String factoryClass, Map parameters, Map extraParameters, String name) { + this.serverSupplier = serverSupplier; + this.socketBindingSupplier = socketBindingSupplier; + this.outboundSocketBindingSupplier = outboundSocketBindingSupplier; + this.factoryClass = factoryClass; + this.parameters = parameters; + this.extraParameters = extraParameters; + this.name = name; + } + + @Override + public void start(StartContext sc) throws StartException { + if (outboundSocketBindingSupplier != null) { + OutboundSocketBinding binding = outboundSocketBindingSupplier.get(); + if (binding.getSourceAddress() != null) { + parameters.put(TransportConstants.LOCAL_ADDRESS_PROP_NAME, + NetworkUtils.canonize(binding.getSourceAddress().getHostAddress())); + } + if (binding.getSourcePort() != null) { + // Use absolute port to account for source port offset/fixation + parameters.put(TransportConstants.LOCAL_PORT_PROP_NAME, binding.getAbsoluteSourcePort()); + } + parameters.put(HOST, NetworkUtils.canonize(binding.getUnresolvedDestinationAddress())); + parameters.put(PORT, binding.getDestinationPort()); + } else if (socketBindingSupplier != null) { + SocketBinding binding = socketBindingSupplier.get(); + if (binding.getClientMappings() != null && !binding.getClientMappings().isEmpty()) { + // At the moment ActiveMQ doesn't allow to select mapping based on client's network. + // Instead the first client-mapping element will always be used - see WFLY-8432 + ClientMapping clientMapping = binding.getClientMappings().get(0); + parameters.put(HOST, NetworkUtils.canonize(clientMapping.getDestinationAddress())); + parameters.put(PORT, clientMapping.getDestinationPort()); + } else { + InetSocketAddress sa = binding.getSocketAddress(); + parameters.put(PORT, sa.getPort()); + // resolve the host name of the address only if a loopback address has been set + if (sa.getAddress().isLoopbackAddress()) { + parameters.put(HOST, NetworkUtils.canonize(sa.getAddress().getHostName())); + } else { + parameters.put(HOST, NetworkUtils.canonize(sa.getAddress().getHostAddress())); + } + } + } + try { + serverSupplier.get().getConfiguration().addConnectorConfiguration(name, new TransportConfiguration(factoryClass, parameters, name, extraParameters)); + } catch (Exception ex) { + throw new StartException(ex); + } + } + + @Override + public void stop(StopContext sc) { + } +} diff --git a/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/DiscoveryGroupAdd.java b/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/DiscoveryGroupAdd.java index 79b9101125ac..5e5f9695b405 100644 --- a/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/DiscoveryGroupAdd.java +++ b/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/DiscoveryGroupAdd.java @@ -29,6 +29,7 @@ import org.jboss.as.controller.OperationStepHandler; import org.jboss.as.controller.PathAddress; import org.jboss.dmr.ModelNode; +import org.wildfly.extension.messaging.activemq.logging.MessagingLogger; import org.wildfly.extension.messaging.activemq.shallow.ShallowResourceAdd; /** @@ -60,9 +61,11 @@ public void execute(OperationContext context, ModelNode operation) throws Operat if (operation.hasDefined(JGROUPS_CLUSTER.getName())) { target = target.append(CommonAttributes.JGROUPS_DISCOVERY_GROUP, context.getCurrentAddressValue()); addHandler = JGroupsDiscoveryGroupAdd.LEGACY_INSTANCE; - } else { + } else if (operation.hasDefined(CommonAttributes.SOCKET_BINDING.getName())) { target = target.append(CommonAttributes.SOCKET_DISCOVERY_GROUP, context.getCurrentAddressValue()); addHandler = SocketDiscoveryGroupAdd.LEGACY_INSTANCE; + } else { + throw MessagingLogger.ROOT_LOGGER.socketBindingOrJGroupsClusterRequired(); } op.get(OP_ADDR).set(target.toModelNode()); context.addStep(op, addHandler, OperationContext.Stage.MODEL, true); diff --git a/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/DiscoveryGroupDefinition.java b/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/DiscoveryGroupDefinition.java index 1c43825153b5..2afc5e931a0b 100644 --- a/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/DiscoveryGroupDefinition.java +++ b/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/DiscoveryGroupDefinition.java @@ -129,4 +129,9 @@ public Set getIgnoredAttributes(OperationContext context, ModelNode oper } return ignoredAttributes; } + + @Override + protected boolean isUsingSocketBinding(PathAddress targetAddress) { + return CommonAttributes.SOCKET_DISCOVERY_GROUP.equals(targetAddress.getLastElement().getKey()); + } } diff --git a/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/DivertAdd.java b/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/DivertAdd.java index 0b8d7f8f4686..e8ef81356200 100644 --- a/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/DivertAdd.java +++ b/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/DivertAdd.java @@ -52,6 +52,11 @@ private DivertAdd(AttributeDefinition... attributes) { super(attributes); } + @Override + protected boolean requiresRuntime(OperationContext context) { + return context.isDefaultRequiresRuntime() && !context.isBooting(); + } + @Override protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { diff --git a/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/GroupingHandlerAdd.java b/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/GroupingHandlerAdd.java index 550a6520ecd9..d92c9f57f2b5 100644 --- a/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/GroupingHandlerAdd.java +++ b/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/GroupingHandlerAdd.java @@ -50,6 +50,11 @@ private GroupingHandlerAdd(AttributeDefinition... attributes) { super(attributes); } + @Override + protected boolean requiresRuntime(OperationContext context) { + return context.isDefaultRequiresRuntime() && !context.isBooting(); + } + @Override protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { diff --git a/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/QueueAdd.java b/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/QueueAdd.java index 2ac2ede29fe3..5765a51687c0 100644 --- a/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/QueueAdd.java +++ b/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/QueueAdd.java @@ -54,6 +54,11 @@ private QueueAdd(AttributeDefinition... attributes) { super(attributes); } + @Override + protected boolean requiresRuntime(OperationContext context) { + return context.isDefaultRequiresRuntime() && !context.isBooting(); + } + @Override protected void populateModel(ModelNode operation, ModelNode model) throws OperationFailedException { for (final AttributeDefinition attributeDefinition : QueueDefinition.ATTRIBUTES) { diff --git a/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/SecurityRoleAdd.java b/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/SecurityRoleAdd.java index 7e5ceb854de6..ccf820107a08 100644 --- a/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/SecurityRoleAdd.java +++ b/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/SecurityRoleAdd.java @@ -22,6 +22,8 @@ package org.wildfly.extension.messaging.activemq; +import static org.wildfly.extension.messaging.activemq.ActiveMQActivationService.getActiveMQServer; + import java.util.Set; import org.apache.activemq.artemis.core.security.Role; @@ -34,8 +36,6 @@ import org.jboss.as.controller.descriptions.ModelDescriptionConstants; import org.jboss.as.controller.registry.Resource; import org.jboss.dmr.ModelNode; -import org.jboss.msc.service.ServiceController; -import org.jboss.msc.service.ServiceName; /** * {@code OperationStepHandler} for adding a new security role. @@ -50,12 +50,17 @@ private SecurityRoleAdd(AttributeDefinition... attributes) { super(attributes); } + @Override + protected boolean requiresRuntime(OperationContext context) { + return context.isDefaultRequiresRuntime() && !context.isBooting(); + } + @Override protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { if(context.isNormalServer()) { final PathAddress address = PathAddress.pathAddress(operation.require(ModelDescriptionConstants.OP_ADDR)); - final ActiveMQServer server = getServer(context, operation); + final ActiveMQServer server = getActiveMQServer(context, operation); final String match = address.getElement(address.size() - 2).getValue(); final String roleName = address.getLastElement().getValue(); @@ -71,18 +76,9 @@ protected void performRuntime(OperationContext context, ModelNode operation, Mod @Override protected void rollbackRuntime(OperationContext context, ModelNode operation, Resource resource) { final PathAddress address = PathAddress.pathAddress(operation.require(ModelDescriptionConstants.OP_ADDR)); - final ActiveMQServer server = getServer(context, operation); + final ActiveMQServer server = getActiveMQServer(context, operation); final String match = address.getElement(address.size() - 2).getValue(); final String roleName = address.getLastElement().getValue(); SecurityRoleRemove.removeRole(server, match, roleName); } - - static ActiveMQServer getServer(final OperationContext context, ModelNode operation) { - final ServiceName serviceName = MessagingServices.getActiveMQServiceName(PathAddress.pathAddress(operation.get(ModelDescriptionConstants.OP_ADDR))); - final ServiceController controller = context.getServiceRegistry(true).getService(serviceName); - if(controller != null) { - return ActiveMQServer.class.cast(controller.getValue()); - } - return null; - } } diff --git a/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/SecurityRoleRemove.java b/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/SecurityRoleRemove.java index bb16f947fbbb..3e7c94323136 100644 --- a/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/SecurityRoleRemove.java +++ b/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/SecurityRoleRemove.java @@ -22,6 +22,9 @@ package org.wildfly.extension.messaging.activemq; + +import static org.wildfly.extension.messaging.activemq.ActiveMQActivationService.getActiveMQServer; + import java.util.HashSet; import java.util.Set; @@ -33,8 +36,6 @@ import org.jboss.as.controller.PathAddress; import org.jboss.as.controller.descriptions.ModelDescriptionConstants; import org.jboss.dmr.ModelNode; -import org.jboss.msc.service.ServiceController; -import org.jboss.msc.service.ServiceName; /** * {@code OperationStepHandler} for removing a security role. @@ -48,7 +49,7 @@ class SecurityRoleRemove extends AbstractRemoveStepHandler { @Override protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { final PathAddress address = PathAddress.pathAddress(operation.require(ModelDescriptionConstants.OP_ADDR)); - final ActiveMQServer server = getServer(context, operation); + final ActiveMQServer server = getActiveMQServer(context, operation); final String match = address.getElement(address.size() - 2).getValue(); final String roleName = address.getLastElement().getValue(); removeRole(server, match, roleName); @@ -57,7 +58,7 @@ protected void performRuntime(OperationContext context, ModelNode operation, Mod static void removeRole(ActiveMQServer server, String match, String roleName) { if (server != null) { final Set roles = server.getSecurityRepository().getMatch(match); - final Set newRoles = new HashSet(); + final Set newRoles = new HashSet<>(); for (final Role role : roles) { if (!roleName.equals(role.getName())) { newRoles.add(role); @@ -66,13 +67,4 @@ static void removeRole(ActiveMQServer server, String match, String roleName) { server.getSecurityRepository().addMatch(match, newRoles); } } - - static ActiveMQServer getServer(final OperationContext context, ModelNode operation) { - final ServiceName serviceName = MessagingServices.getActiveMQServiceName(PathAddress.pathAddress(operation.get(ModelDescriptionConstants.OP_ADDR))); - final ServiceController controller = context.getServiceRegistry(true).getService(serviceName); - if(controller != null) { - return ActiveMQServer.class.cast(controller.getValue()); - } - return null; - } } diff --git a/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/SecuritySettingAdd.java b/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/SecuritySettingAdd.java index c145b1650731..fd0ce1c83998 100644 --- a/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/SecuritySettingAdd.java +++ b/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/SecuritySettingAdd.java @@ -19,12 +19,12 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ - package org.wildfly.extension.messaging.activemq; +import static org.wildfly.extension.messaging.activemq.ActiveMQActivationService.getActiveMQServer; + import java.util.HashSet; -import org.apache.activemq.artemis.core.security.Role; import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.jboss.as.controller.AbstractAddStepHandler; import org.jboss.as.controller.OperationContext; @@ -32,8 +32,6 @@ import org.jboss.as.controller.PathAddress; import org.jboss.as.controller.descriptions.ModelDescriptionConstants; import org.jboss.dmr.ModelNode; -import org.jboss.msc.service.ServiceController; -import org.jboss.msc.service.ServiceName; /** * {@code OperationStepHandler} for adding a new security setting. @@ -50,23 +48,18 @@ protected void populateModel(ModelNode operation, ModelNode model) throws Operat } @Override - protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { + protected boolean requiresRuntime(OperationContext context) { + return context.isDefaultRequiresRuntime() && !context.isBooting(); + } - final ActiveMQServer server = getServer(context, operation); - if(server != null) { + @Override + protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { + final ActiveMQServer server = getActiveMQServer(context, operation); + if (server != null) { final PathAddress address = PathAddress.pathAddress(operation.require(ModelDescriptionConstants.OP_ADDR)); final String match = address.getLastElement().getValue(); - server.getSecurityRepository().addMatch(match, new HashSet()); - } - } - - static ActiveMQServer getServer(final OperationContext context, ModelNode operation) { - final ServiceName serviceName = MessagingServices.getActiveMQServiceName(PathAddress.pathAddress(operation.get(ModelDescriptionConstants.OP_ADDR))); - final ServiceController controller = context.getServiceRegistry(true).getService(serviceName); - if(controller != null) { - return ActiveMQServer.class.cast(controller.getValue()); + server.getSecurityRepository().addMatch(match, new HashSet<>()); } - return null; } } diff --git a/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/SecuritySettingRemove.java b/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/SecuritySettingRemove.java index 1081bf90a6f8..7cfbcb7282e9 100644 --- a/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/SecuritySettingRemove.java +++ b/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/SecuritySettingRemove.java @@ -19,9 +19,10 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ - package org.wildfly.extension.messaging.activemq; +import static org.wildfly.extension.messaging.activemq.ActiveMQActivationService.getActiveMQServer; + import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.jboss.as.controller.AbstractRemoveStepHandler; import org.jboss.as.controller.OperationContext; @@ -29,8 +30,6 @@ import org.jboss.as.controller.PathAddress; import org.jboss.as.controller.descriptions.ModelDescriptionConstants; import org.jboss.dmr.ModelNode; -import org.jboss.msc.service.ServiceController; -import org.jboss.msc.service.ServiceName; /** * {@code OperationStepHandler} for removing an existing security setting. @@ -43,20 +42,12 @@ class SecuritySettingRemove extends AbstractRemoveStepHandler { @Override protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { - final ActiveMQServer server = getServer(context, operation); - if(server != null) { + final ActiveMQServer server = getActiveMQServer(context, operation); + if (server != null) { final PathAddress address = PathAddress.pathAddress(operation.require(ModelDescriptionConstants.OP_ADDR)); final String match = address.getLastElement().getValue(); server.getSecurityRepository().removeMatch(match); } } - static ActiveMQServer getServer(final OperationContext context, ModelNode operation) { - final ServiceName serviceName = MessagingServices.getActiveMQServiceName(PathAddress.pathAddress(operation.get(ModelDescriptionConstants.OP_ADDR))); - final ServiceController controller = context.getServiceRegistry(true).getService(serviceName); - if(controller != null) { - return ActiveMQServer.class.cast(controller.getValue()); - } - return null; - } } diff --git a/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/ServerAdd.java b/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/ServerAdd.java index ded5e159cbf1..238a483ae96a 100644 --- a/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/ServerAdd.java +++ b/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/ServerAdd.java @@ -710,7 +710,7 @@ private void processAddressSettings(final OperationContext context, final Config final String match = property.getName(); final ModelNode config = property.getValue(); final AddressSettings settings = AddressSettingAdd.createSettings(context, config); - configuration.getAddressesSettings().put(match, settings); + configuration.addAddressSetting(match, settings); } } } diff --git a/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/TransportConfigOperationHandlers.java b/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/TransportConfigOperationHandlers.java index a23f653df22a..ae88777b49e0 100644 --- a/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/TransportConfigOperationHandlers.java +++ b/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/TransportConfigOperationHandlers.java @@ -19,11 +19,13 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ - package org.wildfly.extension.messaging.activemq; import static org.apache.activemq.artemis.core.remoting.impl.invm.TransportConstants.SERVER_ID_PROP_NAME; import static org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants.ACTIVEMQ_SERVER_NAME; +import static org.wildfly.extension.messaging.activemq.AbstractTransportDefinition.CONNECTOR_CAPABILITY; +import static org.wildfly.extension.messaging.activemq.Capabilities.OUTBOUND_SOCKET_BINDING_CAPABILITY_NAME; +import static org.wildfly.extension.messaging.activemq.Capabilities.SOCKET_BINDING_CAPABILITY_NAME; import static org.wildfly.extension.messaging.activemq.CommonAttributes.ACCEPTOR; import static org.wildfly.extension.messaging.activemq.CommonAttributes.CONNECTOR; import static org.wildfly.extension.messaging.activemq.CommonAttributes.FACTORY_CLASS; @@ -52,10 +54,13 @@ import org.apache.activemq.artemis.core.remoting.impl.netty.NettyAcceptorFactory; import org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactory; import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants; +import org.apache.activemq.artemis.core.server.ActiveMQServer; +import org.jboss.as.controller.CapabilityServiceBuilder; import org.jboss.as.controller.OperationContext; import org.jboss.as.controller.OperationFailedException; import org.jboss.as.controller.PathAddress; import org.jboss.as.controller.PathElement; +import org.jboss.as.controller.capability.CapabilityServiceSupport; import org.jboss.as.controller.descriptions.ModelDescriptionConstants; import org.jboss.as.controller.registry.Resource; import org.jboss.as.network.ClientMapping; @@ -64,14 +69,17 @@ import org.jboss.as.network.SocketBinding; import org.jboss.dmr.ModelNode; import org.jboss.dmr.Property; +import org.jboss.msc.service.ServiceController; import org.jboss.msc.service.StartException; import org.wildfly.extension.messaging.activemq.logging.MessagingLogger; /** * Basic {@link TransportConfiguration} (Acceptor/Connector) related operations. * - * Artemis changed the naming convention for naming its parameters and uses CamelCase names. - * WildFly convention is to use hyphen-separated names. The mapping is done when creating Artemis connector/acceptor + * Artemis changed the naming convention for naming its parameters and uses + * CamelCase names. + * WildFly convention is to use hyphen-separated names. The mapping is done when + * creating Artemis connector/acceptor * configuration based on the WildFly management model. * * @author Emanuel Muckenhuber @@ -252,7 +260,7 @@ public class TransportConfigOperationHandlers { TransportConstants.USE_NIO_PROP_NAME); ACCEPTOR_KEYS_MAP.put(VERIFY_HOST, TransportConstants.VERIFY_HOST_PROP_NAME); - Set allowable = new HashSet<>(3); + Set allowable = new HashSet<>(3); allowable.add(org.apache.activemq.artemis.core.remoting.impl.invm.TransportConstants.BUFFER_POOLING); allowable.add(org.apache.activemq.artemis.core.remoting.impl.invm.TransportConstants.CONNECTIONS_ALLOWED); allowable.add(org.apache.activemq.artemis.core.remoting.impl.invm.TransportConstants.SERVER_ID_PROP_NAME); @@ -262,10 +270,10 @@ public class TransportConfigOperationHandlers { /** * Process the acceptor information. * - * @param context the operation context + * @param context the operation context * @param configuration the ActiveMQ configuration - * @param params the detyped operation parameters - * @param bindings the referenced socket bindings + * @param params the detyped operation parameters + * @param bindings the referenced socket bindings * @throws OperationFailedException */ static void processAcceptors(final OperationContext context, final Configuration configuration, final ModelNode params, final Set bindings, final Map sslContexts) throws OperationFailedException { @@ -277,8 +285,8 @@ static void processAcceptors(final OperationContext context, final Configuration final Map parameters = getParameters(context, config, ACCEPTOR_KEYS_MAP); final Map extraParameters = getExtraParameters(TransportConstants.ALLOWABLE_ACCEPTOR_KEYS, parameters); final String clazz = config.get(FACTORY_CLASS.getName()).asString(); - if(config.hasDefined(CommonAttributes.SSL_CONTEXT.getName())) { - String sslContextName = config.get(CommonAttributes.SSL_CONTEXT.getName()).asString(); + if (config.hasDefined(CommonAttributes.SSL_CONTEXT.getName())) { + String sslContextName = CommonAttributes.SSL_CONTEXT.resolveModelAttribute(context, config).asString(); sslContexts.put(acceptorName, sslContextName); parameters.put(TransportConstants.SSL_CONTEXT_PROP_NAME, sslContextName); parameters.put(TransportConstants.SSL_ENABLED_PROP_NAME, true); @@ -302,8 +310,8 @@ static void processAcceptors(final OperationContext context, final Configuration bindings.add(binding); // uses the parameters to pass the socket binding name that will be read in ActiveMQServerService.start() parameters.put(RemoteTransportDefinition.SOCKET_BINDING.getName(), binding); - if(config.hasDefined(CommonAttributes.SSL_CONTEXT.getName())) { - String sslContextName = config.get(CommonAttributes.SSL_CONTEXT.getName()).asString(); + if (config.hasDefined(CommonAttributes.SSL_CONTEXT.getName())) { + String sslContextName = CommonAttributes.SSL_CONTEXT.resolveModelAttribute(context, config).asString(); sslContexts.put(acceptorName, sslContextName); parameters.put(TransportConstants.SSL_CONTEXT_PROP_NAME, sslContextName); parameters.put(TransportConstants.SSL_ENABLED_PROP_NAME, true); @@ -328,8 +336,8 @@ static void processAcceptors(final OperationContext context, final Configuration final Map parameters = getParameters(context, config, ACCEPTOR_KEYS_MAP); final Map extraParameters = getExtraParameters(TransportConstants.ALLOWABLE_ACCEPTOR_KEYS, parameters); parameters.put(TransportConstants.HTTP_UPGRADE_ENABLED_PROP_NAME, true); - if(config.hasDefined(CommonAttributes.SSL_CONTEXT.getName())) { - String sslContextName = config.get(CommonAttributes.SSL_CONTEXT.getName()).asString(); + if (config.hasDefined(CommonAttributes.SSL_CONTEXT.getName())) { + String sslContextName = CommonAttributes.SSL_CONTEXT.resolveModelAttribute(context, config).asString(); sslContexts.put(acceptorName, config.get(CommonAttributes.SSL_CONTEXT.getName()).asString()); parameters.put(TransportConstants.SSL_CONTEXT_PROP_NAME, sslContextName); parameters.put(TransportConstants.SSL_ENABLED_PROP_NAME, true); @@ -340,16 +348,96 @@ static void processAcceptors(final OperationContext context, final Configuration configuration.setAcceptorConfigurations(new HashSet<>(acceptors.values())); } + public static final void processConnector(OperationContext context, ModelNode config) throws OperationFailedException, CapabilityServiceSupport.NoSuchCapabilityException { + String connectorType = context.getCurrentAddress().getLastElement().getKey(); + CapabilityServiceBuilder builder = context.getCapabilityServiceTarget().addService(); + builder.provides(CONNECTOR_CAPABILITY.getCapabilityServiceName(context.getCurrentAddress())); + builder.setInitialMode(ServiceController.Mode.ACTIVE); + switch (connectorType) { + case CommonAttributes.CONNECTOR: { + final Map parameters = getParameters(context, config, CONNECTORS_KEYS_MAP); + String socketBindingName = GenericTransportDefinition.SOCKET_BINDING.resolveModelAttribute(context, config).asStringOrNull(); + final String clazz = FACTORY_CLASS.resolveModelAttribute(context, config).asString(); + if (config.hasDefined(CommonAttributes.SSL_CONTEXT.getName())) { + String sslContextName = CommonAttributes.SSL_CONTEXT.resolveModelAttribute(context, config).asString(); + parameters.put(TransportConstants.SSL_CONTEXT_PROP_NAME, sslContextName); + parameters.put(TransportConstants.SSL_ENABLED_PROP_NAME, true); + } + processSocketBinding(context, builder, clazz, parameters, Collections.emptyMap(), socketBindingName); + break; + } + case CommonAttributes.IN_VM_CONNECTOR: { + final Map parameters = getParameters(context, config, CONNECTORS_KEYS_MAP); + parameters.put(CONNECTORS_KEYS_MAP.get(InVMTransportDefinition.SERVER_ID.getName()), InVMTransportDefinition.SERVER_ID.resolveModelAttribute(context, config).asInt()); + processSocketBinding(context, builder, InVMConnectorFactory.class.getName(), parameters, Collections.emptyMap(), null); + break; + } + case CommonAttributes.REMOTE_CONNECTOR: { + final Map parameters = getParameters(context, config, CONNECTORS_KEYS_MAP); + String socketBindingName = GenericTransportDefinition.SOCKET_BINDING.resolveModelAttribute(context, config).asStringOrNull(); + if (!config.hasDefined(FACTORY_CLASS.getName())) { + config.get(FACTORY_CLASS.getName()).set(NettyConnectorFactory.class.getName()); + } + final String clazz = FACTORY_CLASS.resolveModelAttribute(context, config).asString(); + if (config.hasDefined(CommonAttributes.SSL_CONTEXT.getName())) { + String sslContextName = CommonAttributes.SSL_CONTEXT.resolveModelAttribute(context, config).asString(); + parameters.put(TransportConstants.SSL_CONTEXT_PROP_NAME, sslContextName); + parameters.put(TransportConstants.SSL_ENABLED_PROP_NAME, true); + } + processSocketBinding(context, builder, clazz, parameters, Collections.emptyMap(), socketBindingName); + break; + } + case HTTP_CONNECTOR: { + final Map parameters = getParameters(context, config, CONNECTORS_KEYS_MAP); + final Map extraParameters = getExtraParameters(TransportConstants.ALLOWABLE_CONNECTOR_KEYS, parameters); + String socketBindingName = GenericTransportDefinition.SOCKET_BINDING.resolveModelAttribute(context, config).asStringOrNull(); + // ARTEMIS-803 Artemis knows that is must not offset the HTTP port when it is used by colocated backups + parameters.put(TransportConstants.HTTP_UPGRADE_ENABLED_PROP_NAME, true); + parameters.put(TransportConstants.HTTP_UPGRADE_ENDPOINT_PROP_NAME, HTTPConnectorDefinition.ENDPOINT.resolveModelAttribute(context, config).asString()); + ModelNode serverNameModelNode = HTTPConnectorDefinition.SERVER_NAME.resolveModelAttribute(context, config); + // use the name of this server if the server-name attribute is undefined + String serverName = serverNameModelNode.isDefined() ? serverNameModelNode.asString() : MessagingServices.getActiveMQServerPathAddress(context.getCurrentAddress()).getLastElement().getValue(); + parameters.put(ACTIVEMQ_SERVER_NAME, serverName); + if (config.hasDefined(CommonAttributes.SSL_CONTEXT.getName())) { + String sslContextName = CommonAttributes.SSL_CONTEXT.resolveModelAttribute(context, config).asString(); + parameters.put(TransportConstants.SSL_CONTEXT_PROP_NAME, sslContextName); + parameters.put(TransportConstants.SSL_ENABLED_PROP_NAME, true); + } + processSocketBinding(context, builder, NettyConnectorFactory.class.getName(), parameters, extraParameters, socketBindingName); + break; + } + default: + break; + } + } + + @SuppressWarnings("unchecked") + private static void processSocketBinding(OperationContext context, CapabilityServiceBuilder builder, String factoryClass, Map parameters, Map extraParameters, String socketBindingName) throws CapabilityServiceSupport.NoSuchCapabilityException, OperationFailedException { + Supplier outboundSocketBindingSupplier = null; + Supplier socketBindingSupplier = null; + if (socketBindingName != null) { + if (listOutBoundSocketBinding(context, Collections.singleton(socketBindingName)).get(socketBindingName)) { + outboundSocketBindingSupplier = builder.requiresCapability(OUTBOUND_SOCKET_BINDING_CAPABILITY_NAME, OutboundSocketBinding.class, socketBindingName); + } else { + socketBindingSupplier = builder.requiresCapability(SOCKET_BINDING_CAPABILITY_NAME, SocketBinding.class, socketBindingName); + } + } + Supplier serverSupplier = builder.requires(MessagingServices.getActiveMQServiceName(context.getCurrentAddress())); + builder.setInstance(new ConnectorService(serverSupplier, socketBindingSupplier, outboundSocketBindingSupplier, factoryClass, parameters, extraParameters, context.getCurrentAddressValue())); + builder.install(); + } + /** * Extract extra parameters from the map of parameters. + * * @param allowedKeys: the keys for allowed parameters. * @param parameters all the parameters (allowed and extra). * @return a Map of extra parameters (those that are not allowed). */ private static Map getExtraParameters(final Set allowedKeys, final Map parameters) { Map extraParameters = new HashMap<>(); - for(Map.Entry parameter : parameters.entrySet()) { - if(!allowedKeys.contains(parameter.getKey())) { + for (Map.Entry parameter : parameters.entrySet()) { + if (!allowedKeys.contains(parameter.getKey())) { extraParameters.put(parameter.getKey(), parameter.getValue()); } } @@ -358,12 +446,14 @@ private static Map getExtraParameters(final Set allowedK } return extraParameters; } + /** * Get the parameters. * * @param context the operation context * @param config the transport configuration - * @param mapping Mapping betwen WildFly parameters (keys) and Artemis constants (values) + * @param mapping Mapping betwen WildFly parameters (keys) and Artemis + * constants (values) * @return the extracted parameters * @throws OperationFailedException if an expression can not be resolved */ @@ -379,10 +469,10 @@ public static Map getParameters(final OperationContext context, /** * Process the connector information. * - * @param context the operation context + * @param context the operation context * @param configuration the ActiveMQ configuration - * @param params the detyped operation parameters - * @param bindings the referenced socket bindings + * @param params the detyped operation parameters + * @param bindings the referenced socket bindings * @throws OperationFailedException */ static Map processConnectors(final OperationContext context, final String configServerName, @@ -395,8 +485,8 @@ static Map processConnectors(final OperationCont final Map parameters = getParameters(context, config, CONNECTORS_KEYS_MAP); final Map extraParameters = getExtraParameters(TransportConstants.ALLOWABLE_CONNECTOR_KEYS, parameters); ModelNode socketBinding = GenericTransportDefinition.SOCKET_BINDING.resolveModelAttribute(context, config); - if(config.hasDefined(CommonAttributes.SSL_CONTEXT.getName())) { - String sslContextName = config.get(CommonAttributes.SSL_CONTEXT.getName()).asString(); + if (config.hasDefined(CommonAttributes.SSL_CONTEXT.getName())) { + String sslContextName = CommonAttributes.SSL_CONTEXT.resolveModelAttribute(context, config).asString(); sslContexts.put(connectorName, sslContextName); parameters.put(TransportConstants.SSL_CONTEXT_PROP_NAME, sslContextName); parameters.put(TransportConstants.SSL_ENABLED_PROP_NAME, true); @@ -420,8 +510,8 @@ static Map processConnectors(final OperationCont bindings.add(binding); // uses the parameters to pass the socket binding name that will be read in ActiveMQServerService.start() parameters.put(RemoteTransportDefinition.SOCKET_BINDING.getName(), binding); - if(config.hasDefined(CommonAttributes.SSL_CONTEXT.getName())) { - String sslContextName = config.get(CommonAttributes.SSL_CONTEXT.getName()).asString(); + if (config.hasDefined(CommonAttributes.SSL_CONTEXT.getName())) { + String sslContextName = CommonAttributes.SSL_CONTEXT.resolveModelAttribute(context, config).asString(); sslContexts.put(connectorName, sslContextName); parameters.put(TransportConstants.SSL_CONTEXT_PROP_NAME, sslContextName); parameters.put(TransportConstants.SSL_ENABLED_PROP_NAME, true); @@ -458,12 +548,11 @@ static Map processConnectors(final OperationCont String serverName = serverNameModelNode.isDefined() ? serverNameModelNode.asString() : configServerName; parameters.put(ACTIVEMQ_SERVER_NAME, serverName); if (config.hasDefined(CommonAttributes.SSL_CONTEXT.getName())) { - String sslContextName = config.get(CommonAttributes.SSL_CONTEXT.getName()).asString(); + String sslContextName = CommonAttributes.SSL_CONTEXT.resolveModelAttribute(context, config).asString(); sslContexts.put(connectorName, sslContextName); parameters.put(TransportConstants.SSL_CONTEXT_PROP_NAME, sslContextName); parameters.put(TransportConstants.SSL_ENABLED_PROP_NAME, true); } - connectors.put(connectorName, new TransportConfiguration(NettyConnectorFactory.class.getName(), parameters, connectorName, extraParameters)); } } @@ -487,7 +576,7 @@ public static TransportConfiguration[] processConnectors(final OperationContext } final String clazz = FACTORY_CLASS.resolveModelAttribute(context, config).asString(); if (config.hasDefined(CommonAttributes.SSL_CONTEXT.getName())) { - String sslContextName = config.get(CommonAttributes.SSL_CONTEXT.getName()).asString(); + String sslContextName = CommonAttributes.SSL_CONTEXT.resolveModelAttribute(context, config).asString(); sslContexts.add(sslContextName); parameters.put(TransportConstants.SSL_CONTEXT_PROP_NAME, sslContextName); parameters.put(TransportConstants.SSL_ENABLED_PROP_NAME, true); @@ -502,13 +591,14 @@ public static TransportConfiguration[] processConnectors(final OperationContext // uses the parameters to pass the socket binding name that will be read in ActiveMQServerService.start() parameters.put(GenericTransportDefinition.SOCKET_BINDING.getName(), socketBinding.asString()); bindings.add(socketBinding.asString()); + } - if(!config.hasDefined(FACTORY_CLASS.getName())) { + if (!config.hasDefined(FACTORY_CLASS.getName())) { config.get(FACTORY_CLASS.getName()).set(NettyConnectorFactory.class.getName()); } final String clazz = FACTORY_CLASS.resolveModelAttribute(context, config).asString(); if (config.hasDefined(CommonAttributes.SSL_CONTEXT.getName())) { - String sslContextName = config.get(CommonAttributes.SSL_CONTEXT.getName()).asString(); + String sslContextName = CommonAttributes.SSL_CONTEXT.resolveModelAttribute(context, config).asString(); sslContexts.add(sslContextName); parameters.put(TransportConstants.SSL_CONTEXT_PROP_NAME, sslContextName); parameters.put(TransportConstants.SSL_ENABLED_PROP_NAME, true); @@ -533,14 +623,15 @@ public static TransportConfiguration[] processConnectors(final OperationContext parameters.put(HTTPConnectorDefinition.SOCKET_BINDING.getName(), binding); bindings.add(binding); ModelNode serverNameModelNode = HTTPConnectorDefinition.SERVER_NAME.resolveModelAttribute(context, config); - if( serverNameModelNode.isDefined()) { + if (serverNameModelNode.isDefined()) { parameters.put(ACTIVEMQ_SERVER_NAME, serverNameModelNode.asString()); } if (config.hasDefined(CommonAttributes.SSL_CONTEXT.getName())) { - String sslContextName = config.get(CommonAttributes.SSL_CONTEXT.getName()).asString(); + String sslContextName = CommonAttributes.SSL_CONTEXT.resolveModelAttribute(context, config).asString(); sslContexts.add(sslContextName); parameters.put(TransportConstants.SSL_CONTEXT_PROP_NAME, sslContextName); parameters.put(TransportConstants.SSL_ENABLED_PROP_NAME, true); + } connectors.add(new TransportConfiguration(NettyConnectorFactory.class.getName(), parameters, connectorName)); } @@ -564,14 +655,15 @@ public static Map listOutBoundSocketBinding(OperationContext co } } if (result.size() != names.size()) { - for(String name : names) { - if(!result.containsKey(name)) { + for (String name : names) { + if (!result.containsKey(name)) { throw MessagingLogger.ROOT_LOGGER.noSocketBinding(name); } } } return result; } + public static void processConnectorBindings(Collection connectors, Map> socketBindings, Map> outboundSocketBindings) throws StartException { @@ -621,7 +713,6 @@ public static void processConnectorBindings(Collection c tc.getParams().put(TransportConstants.LOCAL_PORT_PROP_NAME, binding.getAbsoluteSourcePort()); } } - tc.getParams().put(HOST, host); tc.getParams().put(PORT, port); } diff --git a/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/shallow/ShallowResourceDefinition.java b/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/shallow/ShallowResourceDefinition.java index ce81e267b9a6..aaff757a0bf6 100644 --- a/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/shallow/ShallowResourceDefinition.java +++ b/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/shallow/ShallowResourceDefinition.java @@ -15,12 +15,18 @@ */ package org.wildfly.extension.messaging.activemq.shallow; - import org.jboss.as.controller.AttributeDefinition; +import org.jboss.as.controller.OperationContext; +import org.jboss.as.controller.OperationFailedException; +import org.jboss.as.controller.PathAddress; import org.jboss.as.controller.PersistentResourceDefinition; import org.jboss.as.controller.SimpleResourceDefinition; +import org.jboss.as.controller.descriptions.ModelDescriptionConstants; +import org.jboss.as.controller.logging.ControllerLogger; import org.jboss.as.controller.registry.AttributeAccess; import org.jboss.as.controller.registry.ManagementResourceRegistration; +import org.jboss.dmr.ModelNode; +import org.wildfly.extension.messaging.activemq.CommonAttributes; /** * @@ -61,4 +67,34 @@ public void registerAttributes(ManagementResourceRegistration registry) { } } } + + /** + * This provides more informative message when a user tries to undefine attribute that is required by the + * jgroups-discovery-group or socket-discovery-group resources (while it hasn't been required on the original + * discovery-group resource). + * @param context + * @param targetAddress + * @param translatedOperation + * @throws org.jboss.as.controller.OperationFailedException + */ + protected void validateOperation(OperationContext context, PathAddress targetAddress, ModelNode translatedOperation) + throws OperationFailedException { + String attributeName = translatedOperation.get(ModelDescriptionConstants.NAME).asString(); + String operationName = translatedOperation.get(ModelDescriptionConstants.OP).asString(); + boolean isUsingSocketBinding = isUsingSocketBinding(targetAddress); + + // if undefining an attribute + if ((ModelDescriptionConstants.UNDEFINE_ATTRIBUTE_OPERATION.equals(operationName) + || ModelDescriptionConstants.WRITE_ATTRIBUTE_OPERATION.equals(operationName)) + && !translatedOperation.hasDefined(ModelDescriptionConstants.VALUE)) { + // and the attribute is socket-binding on a socket-discovery-group, + // or jgroups-cluster on a jgroups-discovery-group, throw an error + if ((isUsingSocketBinding && CommonAttributes.SOCKET_BINDING.getName().equals(attributeName)) + || (!isUsingSocketBinding && CommonAttributes.JGROUPS_CLUSTER.getName().equals(attributeName))) { + throw ControllerLogger.ROOT_LOGGER.validationFailedRequiredParameterNotPresent(attributeName, translatedOperation.toString()); + } + } + } + + protected abstract boolean isUsingSocketBinding(PathAddress targetAddress); } diff --git a/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/shallow/TranslatedWriteAttributeHandler.java b/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/shallow/TranslatedWriteAttributeHandler.java index 63bccc90317a..3fc7e3ab954d 100644 --- a/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/shallow/TranslatedWriteAttributeHandler.java +++ b/messaging-activemq/subsystem/src/main/java/org/wildfly/extension/messaging/activemq/shallow/TranslatedWriteAttributeHandler.java @@ -33,19 +33,20 @@ public class TranslatedWriteAttributeHandler implements OperationStepHandler { private static final Logger LOG = Logger.getLogger(TranslatedWriteAttributeHandler.class); - private final ShallowResourceDefinition converter; + private final ShallowResourceDefinition shallowResource; - public TranslatedWriteAttributeHandler(ShallowResourceDefinition converter) { - this.converter = converter; + public TranslatedWriteAttributeHandler(ShallowResourceDefinition shallowResource) { + this.shallowResource = shallowResource; } @Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { - PathAddress targetAddress = converter.convert(context, operation); + PathAddress targetAddress = shallowResource.convert(context, operation); ModelNode op = operation.clone(); op.get(OP_ADDR).set(targetAddress.toModelNode()); String attributeName = op.get(ModelDescriptionConstants.NAME).asString(); - if (!converter.getIgnoredAttributes(context, op).contains(attributeName)) { + if (!shallowResource.getIgnoredAttributes(context, op).contains(attributeName)) { + shallowResource.validateOperation(context, targetAddress, op); OperationStepHandler writeAttributeHandler = context.getRootResourceRegistration() .getAttributeAccess(targetAddress, attributeName).getWriteHandler(); context.addStep(op, writeAttributeHandler, context.getCurrentStage(), true); diff --git a/messaging-activemq/subsystem/src/test/java/org/wildfly/extension/messaging/activemq/ShallowResourcesTestCase.java b/messaging-activemq/subsystem/src/test/java/org/wildfly/extension/messaging/activemq/ShallowResourcesTestCase.java new file mode 100644 index 000000000000..ee82cedb3c8d --- /dev/null +++ b/messaging-activemq/subsystem/src/test/java/org/wildfly/extension/messaging/activemq/ShallowResourcesTestCase.java @@ -0,0 +1,206 @@ +/* + * JBoss, Home of Professional Open Source. + * Copyright 2022, Red Hat, Inc., and individual contributors + * as indicated by the @author tags. See the copyright.txt file in the + * distribution for a full listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ + +package org.wildfly.extension.messaging.activemq; + +import org.jboss.as.controller.PathAddress; +import org.jboss.as.controller.descriptions.ModelDescriptionConstants; +import org.jboss.as.controller.operations.common.Util; +import org.jboss.as.controller.security.CredentialReference; +import org.jboss.as.subsystem.test.AbstractSubsystemTest; +import org.jboss.as.subsystem.test.AdditionalInitialization; +import org.jboss.as.subsystem.test.KernelServices; +import org.jboss.dmr.ModelNode; +import org.junit.Assert; +import org.junit.Test; +import org.wildfly.clustering.jgroups.spi.JGroupsDefaultRequirement; + +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ADDRESS; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.FAILED; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.FAILURE_DESCRIPTION; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OUTCOME; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SUCCESS; + +import org.wildfly.clustering.server.service.ClusteringDefaultRequirement; +import org.wildfly.clustering.server.service.ClusteringRequirement; + +/** + * Verifies that an attempt to undefine socket-binding attr on the socket-discovery-group resource, when performed via + * the original discovery-group shallow resource, fails with informative error message. + * + * The same is tested for the jgroups-cluster attr on the jgroups-discovery-group, and similarly for the *-broadcast-group resources. + */ +public class ShallowResourcesTestCase extends AbstractSubsystemTest { + + private static final PathAddress SUBSYSTEM_ADDRESS = PathAddress.pathAddress(ModelDescriptionConstants.SUBSYSTEM, MessagingExtension.SUBSYSTEM_NAME); + private static final PathAddress SERVER_ADDRESS = SUBSYSTEM_ADDRESS.append(CommonAttributes.SERVER, CommonAttributes.DEFAULT); + + private static PathAddress discoveryGroupAddress(String name) { + return SUBSYSTEM_ADDRESS.append(CommonAttributes.DISCOVERY_GROUP, name); + } + + private static PathAddress broadcastGroupAddress(String name) { + return SERVER_ADDRESS.append(CommonAttributes.BROADCAST_GROUP, name); + } + + public ShallowResourcesTestCase() { + super(MessagingExtension.SUBSYSTEM_NAME, new MessagingExtension()); + } + + @Test + public void testDiscoveryGroupRequiresSocketBindingOrJGroupsCluster() throws Exception { + ModelNode operationTemplate = Util.createAddOperation(discoveryGroupAddress("dg")); + testRequiresSocketBindingOrJGroupsCluster(operationTemplate); + } + + @Test + public void testBroadcastGroupRequiresSocketBindingOrJGroupsCluster() throws Exception { + ModelNode operationTemplate = Util.createAddOperation(broadcastGroupAddress("bg")); + operationTemplate.get(CommonAttributes.CONNECTORS).setEmptyList().add("in-vm"); + testRequiresSocketBindingOrJGroupsCluster(operationTemplate); + } + + private void testRequiresSocketBindingOrJGroupsCluster(ModelNode addOperationTemplate) throws Exception { + KernelServices kernelServices = createKernelServices(); + + // try to add discovery or broadcast group with no socket-binding and no jgroups-cluster attrs -> should fail + // with a message saying that one of the two attributes must be set + ModelNode op = addOperationTemplate.clone(); + ModelNode result = kernelServices.executeOperation(op); + Assert.assertEquals(FAILED, result.get(OUTCOME).asString()); + Assert.assertTrue(result.get(FAILURE_DESCRIPTION).asString().contains("WFLYMSGAMQ0108:")); + + // try to add discovery or broadcast group with jgroups-cluster set -> should succeed + op = addOperationTemplate.clone(); + op.get(CommonAttributes.JGROUPS_CLUSTER.getName()).set("default-cluster"); + result = kernelServices.executeOperation(op); + Assert.assertEquals(result.get(FAILURE_DESCRIPTION).asString(), + SUCCESS, result.get(OUTCOME).asString()); + removeResource(kernelServices, addOperationTemplate.get(ADDRESS)); + + // try to add discovery or broadcast group with socket-binding set -> should succeed + op = addOperationTemplate.clone(); + op.get(CommonAttributes.SOCKET_BINDING.getName()).set("http"); + result = kernelServices.executeOperation(op); + Assert.assertEquals(result.get(FAILURE_DESCRIPTION).asString(), + SUCCESS, result.get(OUTCOME).asString()); + removeResource(kernelServices, addOperationTemplate.get(ADDRESS)); + } + + @Test + public void testUndefineDiscoveryGroupAttrs() throws Exception { + ModelNode addSocketDiscoveryGroup = Util.createAddOperation(discoveryGroupAddress("socket-group")); + addSocketDiscoveryGroup.get(CommonAttributes.SOCKET_BINDING.getName()).set("http"); + + ModelNode addJGroupsDiscoveryGroup = Util.createAddOperation(discoveryGroupAddress("jgroups-group")); + addJGroupsDiscoveryGroup.get(CommonAttributes.JGROUPS_CLUSTER.getName()).set("default"); + + testUndefineAttrs(addSocketDiscoveryGroup, addJGroupsDiscoveryGroup); + } + + @Test + public void testUndefineBroadcastGroupAttrs() throws Exception { + ModelNode addSocketBroadcastGroup = Util.createAddOperation(broadcastGroupAddress("socket-group")); + addSocketBroadcastGroup.get(CommonAttributes.CONNECTORS).setEmptyList().add("in-vm"); + addSocketBroadcastGroup.get(CommonAttributes.SOCKET_BINDING.getName()).set("http"); + + ModelNode addJGroupsBroadcastGroup = Util.createAddOperation(broadcastGroupAddress("jgroups-group")); + addJGroupsBroadcastGroup.get(CommonAttributes.CONNECTORS).setEmptyList().add("in-vm"); + addJGroupsBroadcastGroup.get(CommonAttributes.JGROUPS_CLUSTER.getName()).set("default"); + + testUndefineAttrs(addSocketBroadcastGroup, addJGroupsBroadcastGroup); + } + + private void testUndefineAttrs(ModelNode addSocketGroupTemplate, ModelNode addJGroupsGroupTemplate) throws Exception { + KernelServices kernelServices = createKernelServices(); + + // create socket-*-group to work with + ModelNode result = kernelServices.executeOperation(addSocketGroupTemplate); + Assert.assertEquals(result.get(FAILURE_DESCRIPTION).asString(), SUCCESS, result.get(OUTCOME).asString()); + + // create jgroups-*-group to work with + result = kernelServices.executeOperation(addJGroupsGroupTemplate); + Assert.assertEquals(result.get(FAILURE_DESCRIPTION).asString(), SUCCESS, result.get(OUTCOME).asString()); + + // try to undefine socket-binding from socket-*-group + PathAddress socketGroupAddress = PathAddress.pathAddress(addSocketGroupTemplate.get(ADDRESS)); + ModelNode op = Util.getUndefineAttributeOperation(socketGroupAddress, CommonAttributes.SOCKET_BINDING.getName()); + result = kernelServices.executeOperation(op); + Assert.assertEquals(FAILED, result.get(OUTCOME).asString()); + Assert.assertTrue("Failure description doesn't match: " + result.get(FAILURE_DESCRIPTION).asString(), + result.get(FAILURE_DESCRIPTION).asString().contains("WFLYCTL0231")); + Assert.assertTrue("Failure description doesn't match: " + result.get(FAILURE_DESCRIPTION).asString(), + result.get(FAILURE_DESCRIPTION).asString().contains(CommonAttributes.SOCKET_BINDING.getName())); + Assert.assertFalse("Failure description doesn't match: " + result.get(FAILURE_DESCRIPTION).asString(), + result.get(FAILURE_DESCRIPTION).asString().contains(CommonAttributes.JGROUPS_CLUSTER.getName())); + + // try to undefine jgroups-cluster from jgroups-*-group + PathAddress jgroupsGroupAddress = PathAddress.pathAddress(addJGroupsGroupTemplate.get(ADDRESS)); + op = Util.getUndefineAttributeOperation(jgroupsGroupAddress, CommonAttributes.JGROUPS_CLUSTER.getName()); + result = kernelServices.executeOperation(op); + Assert.assertEquals(FAILED, result.get(OUTCOME).asString()); + Assert.assertTrue("Failure description doesn't match: " + result.get(FAILURE_DESCRIPTION).asString(), + result.get(FAILURE_DESCRIPTION).asString().contains("WFLYCTL0231:")); + Assert.assertFalse("Failure description doesn't match: " + result.get(FAILURE_DESCRIPTION).asString(), + result.get(FAILURE_DESCRIPTION).asString().contains(CommonAttributes.SOCKET_BINDING.getName())); + Assert.assertTrue("Failure description doesn't match: " + result.get(FAILURE_DESCRIPTION).asString(), + result.get(FAILURE_DESCRIPTION).asString().contains(CommonAttributes.JGROUPS_CLUSTER.getName())); + + // try to undefine jgroups-cluster attribute in socket-*-group, operation should succeed (it should be ignored) + op = Util.getUndefineAttributeOperation(socketGroupAddress, CommonAttributes.JGROUPS_CLUSTER.getName()); + result = kernelServices.executeOperation(op); + Assert.assertEquals(SUCCESS, result.get(OUTCOME).asString()); + + // try to undefine socket-binding attribute in jgroups-*-group, operation should succeed (it should be ignored) + op = Util.getUndefineAttributeOperation(jgroupsGroupAddress, CommonAttributes.SOCKET_BINDING.getName()); + result = kernelServices.executeOperation(op); + Assert.assertEquals(SUCCESS, result.get(OUTCOME).asString()); + } + + private KernelServices createKernelServices() throws Exception { + KernelServices kernelServices = createKernelServicesBuilder(createAdditionalInitialization()) + .setSubsystemXml(readResource("subsystem_15_0.xml")) + .build(); + Assert.assertTrue("Subsystem boot failed!", kernelServices.isSuccessfulBoot()); + return kernelServices; + } + + private static void removeResource(KernelServices kernelServices, ModelNode address) { + ModelNode op = Util.createRemoveOperation(PathAddress.pathAddress(address)); + ModelNode result = kernelServices.executeOperation(op); + Assert.assertEquals(SUCCESS, result.get(OUTCOME).asString()); + } + + private AdditionalInitialization createAdditionalInitialization() { + return AdditionalInitialization.withCapabilities(ClusteringRequirement.COMMAND_DISPATCHER_FACTORY.resolve("ee"), + ClusteringDefaultRequirement.COMMAND_DISPATCHER_FACTORY.getName(), + JGroupsDefaultRequirement.CHANNEL_FACTORY.getName(), + Capabilities.ELYTRON_DOMAIN_CAPABILITY, + Capabilities.ELYTRON_DOMAIN_CAPABILITY + ".elytronDomain", + CredentialReference.CREDENTIAL_STORE_CAPABILITY + ".cs1", + Capabilities.DATA_SOURCE_CAPABILITY + ".fooDS", + "org.wildfly.messaging.activemq.connector.external.in-vm", + "org.wildfly.messaging.activemq.connector.external.client", + "org.wildfly.remoting.http-listener-registry", + Capabilities.HTTP_UPGRADE_REGISTRY_CAPABILITY_NAME + ".default"); + } +} diff --git a/metrics/pom.xml b/metrics/pom.xml index c330dbcfbb7b..e2813555dade 100644 --- a/metrics/pom.xml +++ b/metrics/pom.xml @@ -29,7 +29,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-metrics diff --git a/metrics/src/main/java/org/wildfly/extension/metrics/MetricCollector.java b/metrics/src/main/java/org/wildfly/extension/metrics/MetricCollector.java index 4adc65fe5740..a8396f065a08 100644 --- a/metrics/src/main/java/org/wildfly/extension/metrics/MetricCollector.java +++ b/metrics/src/main/java/org/wildfly/extension/metrics/MetricCollector.java @@ -83,6 +83,13 @@ public void propertyChange(PropertyChangeEvent evt) { } }; this.processStateNotifier.addPropertyChangeListener(listener); + Runnable cleanupTask = new Runnable() { + @Override + public void run() { + processStateNotifier.removePropertyChangeListener(listener); + } + }; + registration.addCleanUpTask(cleanupTask); // If server is already running, we won't get a change event so register now if (ControlledProcessState.State.RUNNING == this.processStateNotifier.getCurrentState()) { registration.register(); diff --git a/metrics/src/main/java/org/wildfly/extension/metrics/MetricRegistration.java b/metrics/src/main/java/org/wildfly/extension/metrics/MetricRegistration.java index 393ca6cd10ef..f1896de3a75d 100644 --- a/metrics/src/main/java/org/wildfly/extension/metrics/MetricRegistration.java +++ b/metrics/src/main/java/org/wildfly/extension/metrics/MetricRegistration.java @@ -29,6 +29,7 @@ public class MetricRegistration { private final List registrationTasks = new ArrayList<>(); private final List unregistrationTasks = new ArrayList<>(); private final MetricRegistry registry; + private final List cleanUpTasks = new ArrayList<>(); public MetricRegistration(MetricRegistry registry) { this.registry = registry; @@ -52,6 +53,10 @@ public void unregister() { } unregistrationTasks.clear(); } + for (Runnable cleanupTask : cleanUpTasks) { + cleanupTask.run(); + } + cleanUpTasks.clear(); } public void registerMetric(WildFlyMetric metric, WildFlyMetricMetadata metadata) { @@ -65,4 +70,8 @@ public synchronized void addRegistrationTask(Runnable task) { public void addUnregistrationTask(MetricID metricID) { unregistrationTasks.add(metricID); } + + void addCleanUpTask(Runnable task) { + cleanUpTasks.add(task); + } } diff --git a/microprofile/config-smallrye/pom.xml b/microprofile/config-smallrye/pom.xml index 7c0bf1d11695..681137751a3d 100644 --- a/microprofile/config-smallrye/pom.xml +++ b/microprofile/config-smallrye/pom.xml @@ -30,7 +30,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-microprofile-config-smallrye @@ -47,9 +47,9 @@ import - ${project.groupId} + ${ee.maven.groupId} wildfly-standard-test-bom - ${project.version} + ${ee.maven.version} pom import diff --git a/microprofile/fault-tolerance-smallrye/deployment/pom.xml b/microprofile/fault-tolerance-smallrye/deployment/pom.xml index c6a570229f04..8cf0681cc317 100644 --- a/microprofile/fault-tolerance-smallrye/deployment/pom.xml +++ b/microprofile/fault-tolerance-smallrye/deployment/pom.xml @@ -30,7 +30,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-microprofile-fault-tolerance-smallrye-deployment diff --git a/microprofile/fault-tolerance-smallrye/extension/pom.xml b/microprofile/fault-tolerance-smallrye/extension/pom.xml index 77983d77d704..0c4525c0ad89 100644 --- a/microprofile/fault-tolerance-smallrye/extension/pom.xml +++ b/microprofile/fault-tolerance-smallrye/extension/pom.xml @@ -30,7 +30,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-microprofile-fault-tolerance-smallrye-extension diff --git a/microprofile/fault-tolerance-smallrye/extension/src/main/java/org/wildfly/extension/microprofile/faulttolerance/MicroProfileFaultToleranceSchema.java b/microprofile/fault-tolerance-smallrye/extension/src/main/java/org/wildfly/extension/microprofile/faulttolerance/MicroProfileFaultToleranceSchema.java index 87863a94540b..52722f4d3ee7 100644 --- a/microprofile/fault-tolerance-smallrye/extension/src/main/java/org/wildfly/extension/microprofile/faulttolerance/MicroProfileFaultToleranceSchema.java +++ b/microprofile/fault-tolerance-smallrye/extension/src/main/java/org/wildfly/extension/microprofile/faulttolerance/MicroProfileFaultToleranceSchema.java @@ -25,7 +25,7 @@ import org.jboss.as.controller.PersistentResourceXMLDescription; import org.jboss.as.controller.PersistentSubsystemSchema; -import org.jboss.as.controller.SubsystemURN; +import org.jboss.as.controller.SubsystemSchema; import org.jboss.as.controller.xml.VersionedNamespace; import org.jboss.staxmapper.IntVersion; @@ -43,7 +43,7 @@ public enum MicroProfileFaultToleranceSchema implements PersistentSubsystemSchem private final VersionedNamespace namespace; MicroProfileFaultToleranceSchema(int major, int minor) { - this.namespace = new SubsystemURN<>(MicroProfileFaultToleranceExtension.SUBSYSTEM_NAME, new IntVersion(major, minor)); + this.namespace = SubsystemSchema.createSubsystemURN(MicroProfileFaultToleranceExtension.SUBSYSTEM_NAME, new IntVersion(major, minor)); } @Override diff --git a/microprofile/fault-tolerance-smallrye/pom.xml b/microprofile/fault-tolerance-smallrye/pom.xml index bcc4219648cb..175ce6621d8e 100644 --- a/microprofile/fault-tolerance-smallrye/pom.xml +++ b/microprofile/fault-tolerance-smallrye/pom.xml @@ -30,7 +30,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-microprofile-fault-tolerance-smallrye diff --git a/microprofile/health-smallrye/pom.xml b/microprofile/health-smallrye/pom.xml index ebe43fc55e87..8cd6f577bbc8 100644 --- a/microprofile/health-smallrye/pom.xml +++ b/microprofile/health-smallrye/pom.xml @@ -29,7 +29,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-microprofile-health-smallrye @@ -39,9 +39,9 @@ - ${project.groupId} + ${ee.maven.groupId} wildfly-standard-test-bom - ${project.version} + ${ee.maven.version} pom import diff --git a/microprofile/jwt-smallrye/pom.xml b/microprofile/jwt-smallrye/pom.xml index 66478088608d..8b48dd65858a 100644 --- a/microprofile/jwt-smallrye/pom.xml +++ b/microprofile/jwt-smallrye/pom.xml @@ -27,7 +27,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-microprofile-jwt-smallrye diff --git a/microprofile/jwt-smallrye/src/main/java/org/wildfly/extension/microprofile/jwt/smallrye/MicroProfileJWTSubsystemSchema.java b/microprofile/jwt-smallrye/src/main/java/org/wildfly/extension/microprofile/jwt/smallrye/MicroProfileJWTSubsystemSchema.java index 96b398045eb3..d15f55bc5ba0 100644 --- a/microprofile/jwt-smallrye/src/main/java/org/wildfly/extension/microprofile/jwt/smallrye/MicroProfileJWTSubsystemSchema.java +++ b/microprofile/jwt-smallrye/src/main/java/org/wildfly/extension/microprofile/jwt/smallrye/MicroProfileJWTSubsystemSchema.java @@ -26,7 +26,7 @@ import org.jboss.as.controller.PersistentResourceXMLDescription; import org.jboss.as.controller.PersistentSubsystemSchema; -import org.jboss.as.controller.SubsystemURN; +import org.jboss.as.controller.SubsystemSchema; import org.jboss.as.controller.xml.VersionedNamespace; import org.jboss.staxmapper.IntVersion; @@ -43,7 +43,7 @@ public enum MicroProfileJWTSubsystemSchema implements PersistentSubsystemSchema< private final VersionedNamespace namespace; MicroProfileJWTSubsystemSchema(int major) { - this.namespace = new SubsystemURN<>(MicroProfileJWTExtension.SUBSYSTEM_NAME, new IntVersion(major)); + this.namespace = SubsystemSchema.createSubsystemURN(MicroProfileJWTExtension.SUBSYSTEM_NAME, new IntVersion(major)); } @Override diff --git a/microprofile/lra/coordinator/pom.xml b/microprofile/lra/coordinator/pom.xml index bbf53adcf3fb..c05fcdcca5f3 100644 --- a/microprofile/lra/coordinator/pom.xml +++ b/microprofile/lra/coordinator/pom.xml @@ -28,7 +28,7 @@ org.wildfly wildfly-microprofile-lra - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-microprofile-lra-coordinator @@ -36,9 +36,9 @@ - ${project.groupId} + ${ee.maven.groupId} wildfly-standard-test-bom - ${project.version} + ${ee.maven.version} pom import @@ -64,11 +64,11 @@ narayana-jts-idlj - ${full.maven.groupId} + ${ee.maven.groupId} wildfly-undertow - ${full.maven.groupId} + ${ee.maven.groupId} wildfly-clustering-service diff --git a/microprofile/lra/coordinator/src/main/java/org/wildfly/extension/microprofile/lra/coordinator/MicroProfileLRACoordinatorExtension.java b/microprofile/lra/coordinator/src/main/java/org/wildfly/extension/microprofile/lra/coordinator/MicroProfileLRACoordinatorExtension.java index 19deafa5ef43..50c295103dfa 100644 --- a/microprofile/lra/coordinator/src/main/java/org/wildfly/extension/microprofile/lra/coordinator/MicroProfileLRACoordinatorExtension.java +++ b/microprofile/lra/coordinator/src/main/java/org/wildfly/extension/microprofile/lra/coordinator/MicroProfileLRACoordinatorExtension.java @@ -46,7 +46,7 @@ public class MicroProfileLRACoordinatorExtension implements Extension { private static final MicroProfileLRACoordinatorSubsystemModel CURRENT_MODEL = MicroProfileLRACoordinatorSubsystemModel.VERSION_1_0_0; - private static final MicroProfileLRACoordinatorSubsystemSchema CURRENT_SCHEMA = MicroProfileLRACoordinatorSubsystemSchema.VERSION_1_0; + static final MicroProfileLRACoordinatorSubsystemSchema CURRENT_SCHEMA = MicroProfileLRACoordinatorSubsystemSchema.VERSION_1_0; private final PersistentResourceXMLDescription currentDescription = CURRENT_SCHEMA.getXMLDescription(); @@ -58,6 +58,7 @@ public void initialize(ExtensionContext extensionContext) { registration.registerOperationHandler(GenericSubsystemDescribeHandler.DEFINITION, GenericSubsystemDescribeHandler.INSTANCE); } + @Override public void initializeParsers(ExtensionParsingContext context) { for (MicroProfileLRACoordinatorSubsystemSchema schema : EnumSet.allOf(MicroProfileLRACoordinatorSubsystemSchema.class)) { XMLElementReader> reader = (schema == CURRENT_SCHEMA) ? new PersistentResourceXMLDescriptionReader(this.currentDescription) : schema; diff --git a/microprofile/lra/coordinator/src/main/java/org/wildfly/extension/microprofile/lra/coordinator/MicroProfileLRACoordinatorSubsystemSchema.java b/microprofile/lra/coordinator/src/main/java/org/wildfly/extension/microprofile/lra/coordinator/MicroProfileLRACoordinatorSubsystemSchema.java index cf7c50145329..4ce008c86532 100644 --- a/microprofile/lra/coordinator/src/main/java/org/wildfly/extension/microprofile/lra/coordinator/MicroProfileLRACoordinatorSubsystemSchema.java +++ b/microprofile/lra/coordinator/src/main/java/org/wildfly/extension/microprofile/lra/coordinator/MicroProfileLRACoordinatorSubsystemSchema.java @@ -24,7 +24,7 @@ import org.jboss.as.controller.PersistentResourceXMLDescription; import org.jboss.as.controller.PersistentSubsystemSchema; -import org.jboss.as.controller.SubsystemURN; +import org.jboss.as.controller.SubsystemSchema; import org.jboss.as.controller.xml.VersionedNamespace; import org.jboss.staxmapper.IntVersion; @@ -42,7 +42,7 @@ public enum MicroProfileLRACoordinatorSubsystemSchema implements PersistentSubsy private final VersionedNamespace namespace; MicroProfileLRACoordinatorSubsystemSchema(int major) { - this.namespace = new SubsystemURN<>(MicroProfileLRACoordinatorExtension.SUBSYSTEM_NAME, new IntVersion(major)); + this.namespace = SubsystemSchema.createSubsystemURN(MicroProfileLRACoordinatorExtension.SUBSYSTEM_NAME, new IntVersion(major)); } @Override diff --git a/microprofile/lra/coordinator/src/test/java/org/wildfly/extension/microprofile/lra/coordinator/MicroprofileLRACoordinatorSubsystemTestCase.java b/microprofile/lra/coordinator/src/test/java/org/wildfly/extension/microprofile/lra/coordinator/MicroprofileLRACoordinatorSubsystemTestCase.java index 56f0df742698..364302252871 100644 --- a/microprofile/lra/coordinator/src/test/java/org/wildfly/extension/microprofile/lra/coordinator/MicroprofileLRACoordinatorSubsystemTestCase.java +++ b/microprofile/lra/coordinator/src/test/java/org/wildfly/extension/microprofile/lra/coordinator/MicroprofileLRACoordinatorSubsystemTestCase.java @@ -22,35 +22,22 @@ package org.wildfly.extension.microprofile.lra.coordinator; -import org.jboss.as.subsystem.test.AbstractSubsystemBaseTest; +import org.jboss.as.subsystem.test.AbstractSubsystemSchemaTest; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -import java.io.IOException; import java.util.EnumSet; @RunWith(Parameterized.class) -public class MicroprofileLRACoordinatorSubsystemTestCase extends AbstractSubsystemBaseTest { +public class MicroprofileLRACoordinatorSubsystemTestCase extends AbstractSubsystemSchemaTest { @Parameterized.Parameters public static Iterable parameters() { return EnumSet.allOf(MicroProfileLRACoordinatorSubsystemSchema.class); } - private final MicroProfileLRACoordinatorSubsystemSchema schema; - public MicroprofileLRACoordinatorSubsystemTestCase(MicroProfileLRACoordinatorSubsystemSchema schema) { - super(MicroProfileLRACoordinatorExtension.SUBSYSTEM_NAME, new MicroProfileLRACoordinatorExtension()); - this.schema = schema; - } - - @Override - protected String getSubsystemXml() throws IOException { - return readResource(String.format("lra-coordinator-%d.%d.xml", this.schema.getVersion().major(), this.schema.getVersion().minor())); + super(MicroProfileLRACoordinatorExtension.SUBSYSTEM_NAME, new MicroProfileLRACoordinatorExtension(), schema, MicroProfileLRACoordinatorExtension.CURRENT_SCHEMA); } - @Override - protected String getSubsystemXsdPath() throws Exception { - return String.format("schema/wildfly-microprofile-lra-coordinator_%d_%d.xsd", this.schema.getVersion().major(), this.schema.getVersion().minor()); - } } \ No newline at end of file diff --git a/microprofile/lra/coordinator/src/test/resources/org/wildfly/extension/microprofile/lra/coordinator/lra-coordinator-1.0.xml b/microprofile/lra/coordinator/src/test/resources/org/wildfly/extension/microprofile/lra/coordinator/microprofile-lra-coordinator-1.0.xml similarity index 100% rename from microprofile/lra/coordinator/src/test/resources/org/wildfly/extension/microprofile/lra/coordinator/lra-coordinator-1.0.xml rename to microprofile/lra/coordinator/src/test/resources/org/wildfly/extension/microprofile/lra/coordinator/microprofile-lra-coordinator-1.0.xml diff --git a/microprofile/lra/participant/pom.xml b/microprofile/lra/participant/pom.xml index 9d338090f4a2..c635e6a288e5 100644 --- a/microprofile/lra/participant/pom.xml +++ b/microprofile/lra/participant/pom.xml @@ -28,7 +28,7 @@ org.wildfly wildfly-microprofile-lra - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-microprofile-lra-participant @@ -37,9 +37,9 @@ - ${project.groupId} + ${ee.maven.groupId} wildfly-standard-test-bom - ${project.version} + ${ee.maven.version} pom import @@ -47,7 +47,7 @@ - ${project.groupId} + ${ee.maven.groupId} wildfly-web-common @@ -59,7 +59,7 @@ jakarta.enterprise.cdi-api - ${project.groupId} + ${ee.maven.groupId} wildfly-jaxrs @@ -81,7 +81,7 @@ jakarta.ws.rs-api - ${full.maven.groupId} + ${ee.maven.groupId} wildfly-undertow @@ -101,11 +101,11 @@ resteasy-cdi - ${full.maven.groupId} + ${ee.maven.groupId} wildfly-clustering-service - ${project.groupId} + ${ee.maven.groupId} wildfly-weld @@ -114,7 +114,7 @@ - ${project.groupId} + ${ee.maven.groupId} wildfly-ee diff --git a/microprofile/lra/participant/src/main/java/org/wildfly/extension/microprofile/lra/participant/MicroProfileLRAParticipantExtension.java b/microprofile/lra/participant/src/main/java/org/wildfly/extension/microprofile/lra/participant/MicroProfileLRAParticipantExtension.java index 57806f1c63a8..048a540cfd82 100644 --- a/microprofile/lra/participant/src/main/java/org/wildfly/extension/microprofile/lra/participant/MicroProfileLRAParticipantExtension.java +++ b/microprofile/lra/participant/src/main/java/org/wildfly/extension/microprofile/lra/participant/MicroProfileLRAParticipantExtension.java @@ -47,7 +47,7 @@ public class MicroProfileLRAParticipantExtension implements Extension { private static final MicroProfileLRAParticipantSubsystemModel CURRENT_MODEL = MicroProfileLRAParticipantSubsystemModel.VERSION_1_0_0; - private static final MicroProfileLRAParticipantSubsystemSchema CURRENT_SCHEMA = MicroProfileLRAParticipantSubsystemSchema.VERSION_1_0; + static final MicroProfileLRAParticipantSubsystemSchema CURRENT_SCHEMA = MicroProfileLRAParticipantSubsystemSchema.VERSION_1_0; private final PersistentResourceXMLDescription currentDescription = CURRENT_SCHEMA.getXMLDescription(); diff --git a/microprofile/lra/participant/src/main/java/org/wildfly/extension/microprofile/lra/participant/MicroProfileLRAParticipantSubsystemDefinition.java b/microprofile/lra/participant/src/main/java/org/wildfly/extension/microprofile/lra/participant/MicroProfileLRAParticipantSubsystemDefinition.java index a2ab01dc0790..6c6f1418492b 100644 --- a/microprofile/lra/participant/src/main/java/org/wildfly/extension/microprofile/lra/participant/MicroProfileLRAParticipantSubsystemDefinition.java +++ b/microprofile/lra/participant/src/main/java/org/wildfly/extension/microprofile/lra/participant/MicroProfileLRAParticipantSubsystemDefinition.java @@ -87,7 +87,7 @@ public class MicroProfileLRAParticipantSubsystemDefinition extends PersistentRes MicroProfileLRAParticipantSubsystemDefinition() { super(new Parameters(PATH, RESOLVER) .setAddHandler(new MicroProfileLRAParticipantAdd()) - .setRemoveHandler(new ReloadRequiredRemoveStepHandler()) + .setRemoveHandler(ReloadRequiredRemoveStepHandler.INSTANCE) .setCapabilities(LRA_PARTICIPANT_CAPABILITY)); } diff --git a/microprofile/lra/participant/src/main/java/org/wildfly/extension/microprofile/lra/participant/MicroProfileLRAParticipantSubsystemSchema.java b/microprofile/lra/participant/src/main/java/org/wildfly/extension/microprofile/lra/participant/MicroProfileLRAParticipantSubsystemSchema.java index ce80db5a6bde..37d38a96a9b5 100644 --- a/microprofile/lra/participant/src/main/java/org/wildfly/extension/microprofile/lra/participant/MicroProfileLRAParticipantSubsystemSchema.java +++ b/microprofile/lra/participant/src/main/java/org/wildfly/extension/microprofile/lra/participant/MicroProfileLRAParticipantSubsystemSchema.java @@ -24,7 +24,7 @@ import org.jboss.as.controller.PersistentResourceXMLDescription; import org.jboss.as.controller.PersistentSubsystemSchema; -import org.jboss.as.controller.SubsystemURN; +import org.jboss.as.controller.SubsystemSchema; import org.jboss.as.controller.xml.VersionedNamespace; import org.jboss.staxmapper.IntVersion; @@ -39,7 +39,7 @@ enum MicroProfileLRAParticipantSubsystemSchema implements PersistentSubsystemSch private final VersionedNamespace namespace; MicroProfileLRAParticipantSubsystemSchema(int major) { - this.namespace = new SubsystemURN<>(MicroProfileLRAParticipantExtension.SUBSYSTEM_NAME, new IntVersion(major)); + this.namespace = SubsystemSchema.createSubsystemURN(MicroProfileLRAParticipantExtension.SUBSYSTEM_NAME, new IntVersion(major)); } @Override diff --git a/microprofile/lra/participant/src/test/java/org/wildfly/extension/microprofile/lra/participant/MicroprofileLRAParticipantSubsystemTestCase.java b/microprofile/lra/participant/src/test/java/org/wildfly/extension/microprofile/lra/participant/MicroprofileLRAParticipantSubsystemTestCase.java index c34efab0d98e..4c516562dcea 100644 --- a/microprofile/lra/participant/src/test/java/org/wildfly/extension/microprofile/lra/participant/MicroprofileLRAParticipantSubsystemTestCase.java +++ b/microprofile/lra/participant/src/test/java/org/wildfly/extension/microprofile/lra/participant/MicroprofileLRAParticipantSubsystemTestCase.java @@ -22,35 +22,21 @@ package org.wildfly.extension.microprofile.lra.participant; -import org.jboss.as.subsystem.test.AbstractSubsystemBaseTest; +import org.jboss.as.subsystem.test.AbstractSubsystemSchemaTest; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -import java.io.IOException; import java.util.EnumSet; @RunWith(Parameterized.class) -public class MicroprofileLRAParticipantSubsystemTestCase extends AbstractSubsystemBaseTest { +public class MicroprofileLRAParticipantSubsystemTestCase extends AbstractSubsystemSchemaTest { @Parameterized.Parameters public static Iterable parameters() { return EnumSet.allOf(MicroProfileLRAParticipantSubsystemSchema.class); } - private final MicroProfileLRAParticipantSubsystemSchema schema; - public MicroprofileLRAParticipantSubsystemTestCase(MicroProfileLRAParticipantSubsystemSchema schema) { - super(MicroProfileLRAParticipantExtension.SUBSYSTEM_NAME, new MicroProfileLRAParticipantExtension()); - this.schema = schema; - } - - @Override - protected String getSubsystemXml() throws IOException { - return readResource(String.format("lra-participant-%d.%d.xml", this.schema.getVersion().major(), this.schema.getVersion().minor())); - } - - @Override - protected String getSubsystemXsdPath() throws Exception { - return String.format("schema/wildfly-microprofile-lra-participant_%d_%d.xsd", this.schema.getVersion().major(), this.schema.getVersion().minor()); + super(MicroProfileLRAParticipantExtension.SUBSYSTEM_NAME, new MicroProfileLRAParticipantExtension(), schema, MicroProfileLRAParticipantExtension.CURRENT_SCHEMA); } } diff --git a/microprofile/lra/participant/src/test/resources/org/wildfly/extension/microprofile/lra/participant/lra-participant-1.0.xml b/microprofile/lra/participant/src/test/resources/org/wildfly/extension/microprofile/lra/participant/microprofile-lra-participant-1.0.xml similarity index 100% rename from microprofile/lra/participant/src/test/resources/org/wildfly/extension/microprofile/lra/participant/lra-participant-1.0.xml rename to microprofile/lra/participant/src/test/resources/org/wildfly/extension/microprofile/lra/participant/microprofile-lra-participant-1.0.xml diff --git a/microprofile/lra/pom.xml b/microprofile/lra/pom.xml index 334c39188e18..5c2ea7f7491b 100644 --- a/microprofile/lra/pom.xml +++ b/microprofile/lra/pom.xml @@ -29,7 +29,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-microprofile-lra diff --git a/microprofile/metrics-smallrye/pom.xml b/microprofile/metrics-smallrye/pom.xml index 899cb803cf4a..fcfb83421167 100644 --- a/microprofile/metrics-smallrye/pom.xml +++ b/microprofile/metrics-smallrye/pom.xml @@ -29,7 +29,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-microprofile-metrics-smallrye @@ -39,9 +39,9 @@ - ${project.groupId} + ${ee.maven.groupId} wildfly-standard-test-bom - ${project.version} + ${ee.maven.version} pom import diff --git a/microprofile/metrics-smallrye/src/main/java/org/wildfly/extension/microprofile/metrics/MicroProfileMetricsSubsystemDefinition.java b/microprofile/metrics-smallrye/src/main/java/org/wildfly/extension/microprofile/metrics/MicroProfileMetricsSubsystemDefinition.java index d24cda2f9933..2e59399cb417 100644 --- a/microprofile/metrics-smallrye/src/main/java/org/wildfly/extension/microprofile/metrics/MicroProfileMetricsSubsystemDefinition.java +++ b/microprofile/metrics-smallrye/src/main/java/org/wildfly/extension/microprofile/metrics/MicroProfileMetricsSubsystemDefinition.java @@ -76,7 +76,7 @@ protected MicroProfileMetricsSubsystemDefinition() { super(new SimpleResourceDefinition.Parameters(MicroProfileMetricsExtension.SUBSYSTEM_PATH, MicroProfileMetricsExtension.getResourceDescriptionResolver(MicroProfileMetricsExtension.SUBSYSTEM_NAME)) .setAddHandler(new ModelOnlyAddStepHandler(ATTRIBUTES)) - .setRemoveHandler(new ReloadRequiredRemoveStepHandler()) + .setRemoveHandler(ReloadRequiredRemoveStepHandler.INSTANCE) .setCapabilities(MICROPROFILE_METRICS_HTTP_SECURITY_CAPABILITY, MICROPROFILE_METRICS_SCAN)); } diff --git a/microprofile/openapi-smallrye/pom.xml b/microprofile/openapi-smallrye/pom.xml index 36323fc5e811..479b1d574f87 100644 --- a/microprofile/openapi-smallrye/pom.xml +++ b/microprofile/openapi-smallrye/pom.xml @@ -30,7 +30,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-microprofile-openapi-smallrye diff --git a/microprofile/openapi-smallrye/src/main/java/org/wildfly/extension/microprofile/openapi/MicroProfileOpenAPISubsystemSchema.java b/microprofile/openapi-smallrye/src/main/java/org/wildfly/extension/microprofile/openapi/MicroProfileOpenAPISubsystemSchema.java index ab026b18a6b6..935d8bae7714 100644 --- a/microprofile/openapi-smallrye/src/main/java/org/wildfly/extension/microprofile/openapi/MicroProfileOpenAPISubsystemSchema.java +++ b/microprofile/openapi-smallrye/src/main/java/org/wildfly/extension/microprofile/openapi/MicroProfileOpenAPISubsystemSchema.java @@ -26,7 +26,7 @@ import org.jboss.as.controller.PersistentResourceXMLDescription; import org.jboss.as.controller.PersistentSubsystemSchema; -import org.jboss.as.controller.SubsystemURN; +import org.jboss.as.controller.SubsystemSchema; import org.jboss.as.controller.xml.VersionedNamespace; import org.jboss.staxmapper.IntVersion; @@ -43,7 +43,7 @@ public enum MicroProfileOpenAPISubsystemSchema implements PersistentSubsystemSch private final VersionedNamespace namespace; MicroProfileOpenAPISubsystemSchema(int major, int minor) { - this.namespace = new SubsystemURN<>(MicroProfileOpenAPIExtension.SUBSYSTEM_NAME, new IntVersion(major, minor)); + this.namespace = SubsystemSchema.createSubsystemURN(MicroProfileOpenAPIExtension.SUBSYSTEM_NAME, new IntVersion(major, minor)); } @Override diff --git a/microprofile/openapi-smallrye/src/main/java/org/wildfly/extension/microprofile/openapi/deployment/OpenAPIModelServiceConfigurator.java b/microprofile/openapi-smallrye/src/main/java/org/wildfly/extension/microprofile/openapi/deployment/OpenAPIModelServiceConfigurator.java index 3a4db0cd5e47..2b15c41f7eb3 100644 --- a/microprofile/openapi-smallrye/src/main/java/org/wildfly/extension/microprofile/openapi/deployment/OpenAPIModelServiceConfigurator.java +++ b/microprofile/openapi-smallrye/src/main/java/org/wildfly/extension/microprofile/openapi/deployment/OpenAPIModelServiceConfigurator.java @@ -31,6 +31,8 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Collections; +import java.util.Enumeration; +import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; @@ -40,6 +42,15 @@ import java.util.function.Supplier; import java.util.stream.Collectors; +import io.smallrye.openapi.api.OpenApiConfig; +import io.smallrye.openapi.runtime.OpenApiProcessor; +import io.smallrye.openapi.runtime.OpenApiStaticFile; +import io.smallrye.openapi.runtime.io.Format; +import io.smallrye.openapi.runtime.scanner.FilteredIndexView; +import io.smallrye.openapi.runtime.scanner.spi.AnnotationScanner; +import io.smallrye.openapi.spi.OASFactoryResolverImpl; +import io.undertow.servlet.api.DeploymentInfo; + import org.eclipse.microprofile.openapi.OASFactory; import org.eclipse.microprofile.openapi.models.OpenAPI; import org.eclipse.microprofile.openapi.models.info.Info; @@ -74,15 +85,6 @@ import org.wildfly.extension.undertow.UndertowService; import org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService; -import io.smallrye.openapi.api.OpenApiConfig; -import io.smallrye.openapi.runtime.OpenApiProcessor; -import io.smallrye.openapi.runtime.OpenApiStaticFile; -import io.smallrye.openapi.runtime.io.Format; -import io.smallrye.openapi.runtime.scanner.FilteredIndexView; -import io.smallrye.openapi.runtime.scanner.spi.AnnotationScanner; -import io.smallrye.openapi.spi.OASFactoryResolverImpl; -import io.undertow.servlet.api.DeploymentInfo; - /** * Configures a service that provides an OpenAPI model for a deployment. * @author Paul Ferraro @@ -164,7 +166,9 @@ public OpenAPI get() { } } - builder.annotationsModel(OpenApiProcessor.modelFromAnnotations(config, AnnotationScanner.class.getClassLoader(), indexView)); + // Workaround for https://github.com/smallrye/smallrye-open-api/issues/1508 + ClassLoader scannerClassLoader = new CompositeClassLoader(List.of(AnnotationScanner.class.getClassLoader(), this.module.getClassLoader())); + builder.annotationsModel(OpenApiProcessor.modelFromAnnotations(config, scannerClassLoader, indexView)); builder.readerModel(OpenApiProcessor.modelFromReader(config, this.module.getClassLoader())); builder.filter(OpenApiProcessor.getFilter(config, this.module.getClassLoader())); OpenAPI model = builder.build(); @@ -247,4 +251,44 @@ private static Server createServer(String protocol, String host, int port, Strin return null; } } + + private static class CompositeClassLoader extends ClassLoader { + private final List loaders; + + CompositeClassLoader(List loaders) { + this.loaders = loaders; + } + + @Override + public Enumeration getResources(String name) throws IOException { + List result = new LinkedList<>(); + for (ClassLoader loader : this.loaders) { + result.addAll(Collections.list(loader.getResources(name))); + } + return Collections.enumeration(result); + } + + @Override + protected URL findResource(String name) { + for (ClassLoader loader : this.loaders) { + URL url = loader.getResource(name); + if (url != null) { + return url; + } + } + return super.findResource(name); + } + + @Override + protected Class findClass(String name) throws ClassNotFoundException { + for (ClassLoader loader : this.loaders) { + try { + return loader.loadClass(name); + } catch (ClassNotFoundException e) { + // try again + } + } + return super.findClass(name); + } + } } diff --git a/microprofile/pom.xml b/microprofile/pom.xml index d6c2598e98b8..0800846740d7 100644 --- a/microprofile/pom.xml +++ b/microprofile/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-microprofile diff --git a/microprofile/reactive-messaging-smallrye/common/pom.xml b/microprofile/reactive-messaging-smallrye/common/pom.xml index 97be12cb1e3d..6a20c9f37639 100644 --- a/microprofile/reactive-messaging-smallrye/common/pom.xml +++ b/microprofile/reactive-messaging-smallrye/common/pom.xml @@ -32,7 +32,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-microprofile-reactive-messaging-common diff --git a/microprofile/reactive-messaging-smallrye/config/pom.xml b/microprofile/reactive-messaging-smallrye/config/pom.xml index 57f669469cd8..71c59614d294 100644 --- a/microprofile/reactive-messaging-smallrye/config/pom.xml +++ b/microprofile/reactive-messaging-smallrye/config/pom.xml @@ -32,7 +32,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT diff --git a/microprofile/reactive-messaging-smallrye/extension/pom.xml b/microprofile/reactive-messaging-smallrye/extension/pom.xml index 5d1ce8e60854..049295c5c457 100644 --- a/microprofile/reactive-messaging-smallrye/extension/pom.xml +++ b/microprofile/reactive-messaging-smallrye/extension/pom.xml @@ -32,7 +32,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT @@ -42,9 +42,9 @@ - ${project.groupId} + ${ee.maven.groupId} wildfly-standard-test-bom - ${project.version} + ${ee.maven.version} pom import diff --git a/microprofile/reactive-messaging-smallrye/extension/src/main/java/org/wildfly/extension/microprofile/reactive/messaging/MicroProfileReactiveMessagingSubsystemDefinition.java b/microprofile/reactive-messaging-smallrye/extension/src/main/java/org/wildfly/extension/microprofile/reactive/messaging/MicroProfileReactiveMessagingSubsystemDefinition.java index 6a9d226eff1d..193b87e32090 100644 --- a/microprofile/reactive-messaging-smallrye/extension/src/main/java/org/wildfly/extension/microprofile/reactive/messaging/MicroProfileReactiveMessagingSubsystemDefinition.java +++ b/microprofile/reactive-messaging-smallrye/extension/src/main/java/org/wildfly/extension/microprofile/reactive/messaging/MicroProfileReactiveMessagingSubsystemDefinition.java @@ -75,8 +75,8 @@ public MicroProfileReactiveMessagingSubsystemDefinition() { new SimpleResourceDefinition.Parameters( SUBSYSTEM_PATH, MicroProfileReactiveMessagingExtension.SUBSYSTEM_RESOLVER) - .setAddHandler(AddHandler.INSTANCE) - .setRemoveHandler(new ReloadRequiredRemoveStepHandler()) + .setAddHandler(new AddHandler()) + .setRemoveHandler(ReloadRequiredRemoveStepHandler.INSTANCE) .setCapabilities(REACTIVE_STREAMS_OPERATORS_CAPABILITY) ); } @@ -102,12 +102,6 @@ public void registerAdditionalRuntimePackages(ManagementResourceRegistration res static class AddHandler extends AbstractBoottimeAddStepHandler { - static AddHandler INSTANCE = new AddHandler(); - - private AddHandler() { - super(Collections.emptyList()); - } - @Override protected void performBoottime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { super.performBoottime(context, operation, model); @@ -115,6 +109,7 @@ protected void performBoottime(OperationContext context, ModelNode operation, Mo installKafkaElytronSSLContextRegistryServiceIfPresent(context); context.addStep(new AbstractDeploymentChainStep() { + @Override public void execute(DeploymentProcessorTarget processorTarget) { processorTarget.addDeploymentProcessor(SUBSYSTEM_NAME, DEPENDENCIES, DEPENDENCIES_MICROPROFILE_REACTIVE_MESSAGING, new ReactiveMessagingDependencyProcessor()); diff --git a/microprofile/reactive-messaging-smallrye/extension/src/main/java/org/wildfly/extension/microprofile/reactive/messaging/MicroProfileReactiveMessagingSubsystemSchema.java b/microprofile/reactive-messaging-smallrye/extension/src/main/java/org/wildfly/extension/microprofile/reactive/messaging/MicroProfileReactiveMessagingSubsystemSchema.java index eba777b337c2..df41073a8b92 100644 --- a/microprofile/reactive-messaging-smallrye/extension/src/main/java/org/wildfly/extension/microprofile/reactive/messaging/MicroProfileReactiveMessagingSubsystemSchema.java +++ b/microprofile/reactive-messaging-smallrye/extension/src/main/java/org/wildfly/extension/microprofile/reactive/messaging/MicroProfileReactiveMessagingSubsystemSchema.java @@ -26,7 +26,7 @@ import org.jboss.as.controller.PersistentResourceXMLDescription; import org.jboss.as.controller.PersistentSubsystemSchema; -import org.jboss.as.controller.SubsystemURN; +import org.jboss.as.controller.SubsystemSchema; import org.jboss.as.controller.xml.VersionedNamespace; import org.jboss.staxmapper.IntVersion; @@ -43,7 +43,7 @@ public enum MicroProfileReactiveMessagingSubsystemSchema implements PersistentSu private final VersionedNamespace namespace; MicroProfileReactiveMessagingSubsystemSchema(int major) { - this.namespace = new SubsystemURN<>(MicroProfileReactiveMessagingExtension.SUBSYSTEM_NAME, new IntVersion(major)); + this.namespace = SubsystemSchema.createSubsystemURN(MicroProfileReactiveMessagingExtension.SUBSYSTEM_NAME, new IntVersion(major)); } @Override diff --git a/microprofile/reactive-messaging-smallrye/kafka/pom.xml b/microprofile/reactive-messaging-smallrye/kafka/pom.xml index 9b28c8003c93..c86ae5b2cc3b 100644 --- a/microprofile/reactive-messaging-smallrye/kafka/pom.xml +++ b/microprofile/reactive-messaging-smallrye/kafka/pom.xml @@ -32,7 +32,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT diff --git a/microprofile/reactive-messaging-smallrye/pom.xml b/microprofile/reactive-messaging-smallrye/pom.xml index 8c46f43a0b7c..705142f25ca6 100644 --- a/microprofile/reactive-messaging-smallrye/pom.xml +++ b/microprofile/reactive-messaging-smallrye/pom.xml @@ -32,7 +32,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT diff --git a/microprofile/reactive-streams-operators-smallrye/cdi-provider/pom.xml b/microprofile/reactive-streams-operators-smallrye/cdi-provider/pom.xml index 9d21589e1175..02f5ed5cdcc6 100644 --- a/microprofile/reactive-streams-operators-smallrye/cdi-provider/pom.xml +++ b/microprofile/reactive-streams-operators-smallrye/cdi-provider/pom.xml @@ -32,7 +32,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT diff --git a/microprofile/reactive-streams-operators-smallrye/extension/pom.xml b/microprofile/reactive-streams-operators-smallrye/extension/pom.xml index 9f983d1c66c4..3aa486ada14f 100644 --- a/microprofile/reactive-streams-operators-smallrye/extension/pom.xml +++ b/microprofile/reactive-streams-operators-smallrye/extension/pom.xml @@ -32,7 +32,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-microprofile-reactive-streams-operators @@ -41,9 +41,9 @@ - ${project.groupId} + ${ee.maven.groupId} wildfly-standard-test-bom - ${project.version} + ${ee.maven.version} pom import diff --git a/microprofile/reactive-streams-operators-smallrye/extension/src/main/java/org/wildfly/extension/microprofile/reactive/streams/operators/MicroProfileReactiveStreamsOperatorsSubsystemDefinition.java b/microprofile/reactive-streams-operators-smallrye/extension/src/main/java/org/wildfly/extension/microprofile/reactive/streams/operators/MicroProfileReactiveStreamsOperatorsSubsystemDefinition.java index ad985f486c2e..908549c21427 100644 --- a/microprofile/reactive-streams-operators-smallrye/extension/src/main/java/org/wildfly/extension/microprofile/reactive/streams/operators/MicroProfileReactiveStreamsOperatorsSubsystemDefinition.java +++ b/microprofile/reactive-streams-operators-smallrye/extension/src/main/java/org/wildfly/extension/microprofile/reactive/streams/operators/MicroProfileReactiveStreamsOperatorsSubsystemDefinition.java @@ -62,8 +62,8 @@ public MicroProfileReactiveStreamsOperatorsSubsystemDefinition() { new SimpleResourceDefinition.Parameters( MicroProfileReactiveStreamsOperatorsExtension.SUBSYSTEM_PATH, MicroProfileReactiveStreamsOperatorsExtension.SUBSYSTEM_RESOLVER) - .setAddHandler(AddHandler.INSTANCE) - .setRemoveHandler(new ReloadRequiredRemoveStepHandler()) + .setAddHandler(new AddHandler()) + .setRemoveHandler(ReloadRequiredRemoveStepHandler.INSTANCE) .setCapabilities(REACTIVE_STREAMS_OPERATORS_CAPABILITY) ); } @@ -85,17 +85,12 @@ public Collection getAttributes() { static class AddHandler extends AbstractBoottimeAddStepHandler { - static AddHandler INSTANCE = new AddHandler(); - - private AddHandler() { - super(Collections.emptyList()); - } - @Override protected void performBoottime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { super.performBoottime(context, operation, model); context.addStep(new AbstractDeploymentChainStep() { + @Override public void execute(DeploymentProcessorTarget processorTarget) { processorTarget.addDeploymentProcessor(MicroProfileReactiveStreamsOperatorsExtension.SUBSYSTEM_NAME, DEPENDENCIES, DEPENDENCIES_MICROPROFILE_REACTIVE_STREAMS_OPERATORS, new ReactiveStreamsOperatorsDependencyProcessor()); } diff --git a/microprofile/reactive-streams-operators-smallrye/extension/src/main/java/org/wildfly/extension/microprofile/reactive/streams/operators/MicroProfileReactiveStreamsOperatorsSubsystemSchema.java b/microprofile/reactive-streams-operators-smallrye/extension/src/main/java/org/wildfly/extension/microprofile/reactive/streams/operators/MicroProfileReactiveStreamsOperatorsSubsystemSchema.java index edc4a4da5a5e..5a5e45474ce9 100644 --- a/microprofile/reactive-streams-operators-smallrye/extension/src/main/java/org/wildfly/extension/microprofile/reactive/streams/operators/MicroProfileReactiveStreamsOperatorsSubsystemSchema.java +++ b/microprofile/reactive-streams-operators-smallrye/extension/src/main/java/org/wildfly/extension/microprofile/reactive/streams/operators/MicroProfileReactiveStreamsOperatorsSubsystemSchema.java @@ -26,7 +26,7 @@ import org.jboss.as.controller.PersistentResourceXMLDescription; import org.jboss.as.controller.PersistentSubsystemSchema; -import org.jboss.as.controller.SubsystemURN; +import org.jboss.as.controller.SubsystemSchema; import org.jboss.as.controller.xml.VersionedNamespace; import org.jboss.staxmapper.IntVersion; @@ -43,7 +43,7 @@ public enum MicroProfileReactiveStreamsOperatorsSubsystemSchema implements Persi private final VersionedNamespace namespace; MicroProfileReactiveStreamsOperatorsSubsystemSchema(int major) { - this.namespace = new SubsystemURN<>(MicroProfileReactiveStreamsOperatorsExtension.SUBSYSTEM_NAME, new IntVersion(major)); + this.namespace = SubsystemSchema.createSubsystemURN(MicroProfileReactiveStreamsOperatorsExtension.SUBSYSTEM_NAME, new IntVersion(major)); } @Override diff --git a/microprofile/reactive-streams-operators-smallrye/pom.xml b/microprofile/reactive-streams-operators-smallrye/pom.xml index d7fb6353d017..b22e7506a5c8 100644 --- a/microprofile/reactive-streams-operators-smallrye/pom.xml +++ b/microprofile/reactive-streams-operators-smallrye/pom.xml @@ -32,7 +32,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT diff --git a/microprofile/telemetry-smallrye/cdi-provider/pom.xml b/microprofile/telemetry-smallrye/cdi-provider/pom.xml index 779e4c48e0c9..f0cb74525c0a 100644 --- a/microprofile/telemetry-smallrye/cdi-provider/pom.xml +++ b/microprofile/telemetry-smallrye/cdi-provider/pom.xml @@ -32,7 +32,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT diff --git a/microprofile/telemetry-smallrye/extension/pom.xml b/microprofile/telemetry-smallrye/extension/pom.xml index 638f8f3251b5..83ba322af645 100644 --- a/microprofile/telemetry-smallrye/extension/pom.xml +++ b/microprofile/telemetry-smallrye/extension/pom.xml @@ -32,7 +32,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-microprofile-telemetry @@ -41,9 +41,9 @@ - ${project.groupId} + ${ee.maven.groupId} wildfly-standard-test-bom - ${project.version} + ${ee.maven.version} pom import diff --git a/microprofile/telemetry-smallrye/extension/src/main/java/org/wildfly/extension/microprofile/telemetry/MicroProfileTelemetrySubsystemDefinition.java b/microprofile/telemetry-smallrye/extension/src/main/java/org/wildfly/extension/microprofile/telemetry/MicroProfileTelemetrySubsystemDefinition.java index 74930bd5131a..018a0ba155d5 100644 --- a/microprofile/telemetry-smallrye/extension/src/main/java/org/wildfly/extension/microprofile/telemetry/MicroProfileTelemetrySubsystemDefinition.java +++ b/microprofile/telemetry-smallrye/extension/src/main/java/org/wildfly/extension/microprofile/telemetry/MicroProfileTelemetrySubsystemDefinition.java @@ -53,7 +53,7 @@ public class MicroProfileTelemetrySubsystemDefinition extends PersistentResource protected MicroProfileTelemetrySubsystemDefinition() { super(new Parameters(MicroProfileTelemetryExtension.SUBSYSTEM_PATH, MicroProfileTelemetryExtension.SUBSYSTEM_RESOLVER) .setAddHandler(new MicroProfileTelemetrySubsystemAdd()) - .setRemoveHandler(new ReloadRequiredRemoveStepHandler()) + .setRemoveHandler(ReloadRequiredRemoveStepHandler.INSTANCE) .setCapabilities(MICROPROFILE_TELEMETRY_CAPABILITY) ); } diff --git a/microprofile/telemetry-smallrye/extension/src/main/java/org/wildfly/extension/microprofile/telemetry/MicroProfileTelemetrySubsystemSchema.java b/microprofile/telemetry-smallrye/extension/src/main/java/org/wildfly/extension/microprofile/telemetry/MicroProfileTelemetrySubsystemSchema.java index ab43dfc95b86..2a34bbcb4563 100644 --- a/microprofile/telemetry-smallrye/extension/src/main/java/org/wildfly/extension/microprofile/telemetry/MicroProfileTelemetrySubsystemSchema.java +++ b/microprofile/telemetry-smallrye/extension/src/main/java/org/wildfly/extension/microprofile/telemetry/MicroProfileTelemetrySubsystemSchema.java @@ -23,7 +23,7 @@ import org.jboss.as.controller.PersistentResourceXMLDescription; import org.jboss.as.controller.PersistentSubsystemSchema; -import org.jboss.as.controller.SubsystemURN; +import org.jboss.as.controller.SubsystemSchema; import org.jboss.as.controller.xml.VersionedNamespace; import org.jboss.staxmapper.IntVersion; @@ -36,7 +36,7 @@ enum MicroProfileTelemetrySubsystemSchema implements PersistentSubsystemSchema namespace; MicroProfileTelemetrySubsystemSchema(int major, int minor) { - this.namespace = new SubsystemURN<>(MicroProfileTelemetryExtension.SUBSYSTEM_NAME, new IntVersion(major, minor)); + this.namespace = SubsystemSchema.createSubsystemURN(MicroProfileTelemetryExtension.SUBSYSTEM_NAME, new IntVersion(major, minor)); } @Override diff --git a/microprofile/telemetry-smallrye/pom.xml b/microprofile/telemetry-smallrye/pom.xml index 8dbed8da4d65..9acdfcd5dc23 100644 --- a/microprofile/telemetry-smallrye/pom.xml +++ b/microprofile/telemetry-smallrye/pom.xml @@ -32,7 +32,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT @@ -43,9 +43,9 @@ - ${project.groupId} + ${full.maven.groupId} wildfly-standard-expansion-bom - ${ee.maven.version} + ${full.maven.version} pom import diff --git a/mod_cluster/extension/pom.xml b/mod_cluster/extension/pom.xml index fe2373292d96..04cc895bb65c 100644 --- a/mod_cluster/extension/pom.xml +++ b/mod_cluster/extension/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-mod_cluster-extension diff --git a/mod_cluster/extension/src/main/java/org/wildfly/extension/mod_cluster/ModClusterSubsystemSchema.java b/mod_cluster/extension/src/main/java/org/wildfly/extension/mod_cluster/ModClusterSubsystemSchema.java index 7e5b1a465df4..f999c0ca6719 100644 --- a/mod_cluster/extension/src/main/java/org/wildfly/extension/mod_cluster/ModClusterSubsystemSchema.java +++ b/mod_cluster/extension/src/main/java/org/wildfly/extension/mod_cluster/ModClusterSubsystemSchema.java @@ -25,7 +25,6 @@ import javax.xml.stream.XMLStreamException; -import org.jboss.as.controller.LegacySubsystemURN; import org.jboss.as.controller.SubsystemSchema; import org.jboss.as.controller.xml.VersionedNamespace; import org.jboss.dmr.ModelNode; @@ -53,7 +52,7 @@ public enum ModClusterSubsystemSchema implements SubsystemSchema namespace; ModClusterSubsystemSchema(int major, int minor) { - this.namespace = new LegacySubsystemURN<>(ModClusterExtension.SUBSYSTEM_NAME, new IntVersion(major, minor)); + this.namespace = SubsystemSchema.createLegacySubsystemURN(ModClusterExtension.SUBSYSTEM_NAME, new IntVersion(major, minor)); } @Override diff --git a/mod_cluster/pom.xml b/mod_cluster/pom.xml index 0af0c712aab5..13db3112ecec 100644 --- a/mod_cluster/pom.xml +++ b/mod_cluster/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-mod_cluster diff --git a/mod_cluster/undertow/pom.xml b/mod_cluster/undertow/pom.xml index a9d10b6931fd..6313d76ea93c 100644 --- a/mod_cluster/undertow/pom.xml +++ b/mod_cluster/undertow/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-mod_cluster-undertow diff --git a/naming/pom.xml b/naming/pom.xml index 33bd81818657..c4a54269407d 100644 --- a/naming/pom.xml +++ b/naming/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT ../pom.xml diff --git a/observability/micrometer-api/pom.xml b/observability/micrometer-api/pom.xml index 9cbb311a686d..aeaae2814ecd 100644 --- a/observability/micrometer-api/pom.xml +++ b/observability/micrometer-api/pom.xml @@ -30,7 +30,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-micrometer-deployment @@ -39,9 +39,9 @@ - ${project.groupId} + ${full.maven.groupId} wildfly-standard-expansion-bom - ${ee.maven.version} + ${full.maven.version} pom import diff --git a/observability/micrometer/pom.xml b/observability/micrometer/pom.xml index 41a3c784b8ff..81e8dab04c0c 100644 --- a/observability/micrometer/pom.xml +++ b/observability/micrometer/pom.xml @@ -30,7 +30,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-micrometer @@ -39,16 +39,16 @@ - ${project.groupId} + ${full.maven.groupId} wildfly-standard-expansion-bom - ${ee.maven.version} + ${full.maven.version} pom import - ${project.groupId} + ${ee.maven.groupId} wildfly-standard-test-bom - ${project.version} + ${ee.maven.version} pom import @@ -57,7 +57,7 @@ - ${project.groupId} + ${full.maven.groupId} wildfly-micrometer-deployment ${project.version} @@ -152,11 +152,11 @@ jboss-metadata-web - ${project.groupId} + ${ee.maven.groupId} wildfly-web-common - ${project.groupId} + ${ee.maven.groupId} wildfly-jaxrs diff --git a/observability/micrometer/src/main/java/org/wildfly/extension/micrometer/MicrometerSubsystemSchema.java b/observability/micrometer/src/main/java/org/wildfly/extension/micrometer/MicrometerSubsystemSchema.java index 6c30e463d8f5..6178c2c84917 100644 --- a/observability/micrometer/src/main/java/org/wildfly/extension/micrometer/MicrometerSubsystemSchema.java +++ b/observability/micrometer/src/main/java/org/wildfly/extension/micrometer/MicrometerSubsystemSchema.java @@ -22,7 +22,7 @@ import org.jboss.as.controller.PersistentResourceXMLDescription; import org.jboss.as.controller.PersistentSubsystemSchema; -import org.jboss.as.controller.SubsystemURN; +import org.jboss.as.controller.SubsystemSchema; import org.jboss.as.controller.xml.VersionedNamespace; import org.jboss.staxmapper.IntVersion; @@ -36,7 +36,7 @@ public enum MicrometerSubsystemSchema implements PersistentSubsystemSchema namespace; MicrometerSubsystemSchema(int major, int minor) { - this.namespace = new SubsystemURN<>(MicrometerExtension.SUBSYSTEM_NAME, new IntVersion(major, minor)); + this.namespace = SubsystemSchema.createSubsystemURN(MicrometerExtension.SUBSYSTEM_NAME, new IntVersion(major, minor)); } @Override diff --git a/observability/opentelemetry-api/pom.xml b/observability/opentelemetry-api/pom.xml index db3979712ee0..ed46c1de5255 100644 --- a/observability/opentelemetry-api/pom.xml +++ b/observability/opentelemetry-api/pom.xml @@ -30,7 +30,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-opentelemetry-api @@ -40,9 +40,9 @@ - ${project.groupId} + ${full.maven.groupId} wildfly-standard-expansion-bom - ${ee.maven.version} + ${full.maven.version} pom import diff --git a/observability/opentelemetry/pom.xml b/observability/opentelemetry/pom.xml index c82c768687f0..cc1f144dbcd8 100644 --- a/observability/opentelemetry/pom.xml +++ b/observability/opentelemetry/pom.xml @@ -30,7 +30,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-opentelemetry @@ -40,16 +40,16 @@ - ${project.groupId} + ${full.maven.groupId} wildfly-standard-expansion-bom - ${ee.maven.version} + ${full.maven.version} pom import - ${project.groupId} + ${ee.maven.groupId} wildfly-standard-test-bom - ${project.version} + ${ee.maven.version} pom import @@ -65,7 +65,7 @@ - ${project.groupId} + ${full.maven.groupId} wildfly-opentelemetry-api @@ -205,7 +205,7 @@ jboss-metadata-common - ${project.groupId} + ${ee.maven.groupId} wildfly-web-common diff --git a/observability/opentelemetry/src/main/java/org/wildfly/extension/opentelemetry/OpenTelemetrySubsystemSchema.java b/observability/opentelemetry/src/main/java/org/wildfly/extension/opentelemetry/OpenTelemetrySubsystemSchema.java index 1fe9ab47a78a..8397777a01dc 100644 --- a/observability/opentelemetry/src/main/java/org/wildfly/extension/opentelemetry/OpenTelemetrySubsystemSchema.java +++ b/observability/opentelemetry/src/main/java/org/wildfly/extension/opentelemetry/OpenTelemetrySubsystemSchema.java @@ -4,7 +4,7 @@ import org.jboss.as.controller.PersistentResourceXMLDescription; import org.jboss.as.controller.PersistentSubsystemSchema; -import org.jboss.as.controller.SubsystemURN; +import org.jboss.as.controller.SubsystemSchema; import org.jboss.as.controller.xml.VersionedNamespace; import org.jboss.staxmapper.IntVersion; @@ -16,7 +16,7 @@ public enum OpenTelemetrySubsystemSchema implements PersistentSubsystemSchema namespace; OpenTelemetrySubsystemSchema(int major, int minor) { - this.namespace = new SubsystemURN<>(OpenTelemetrySubsystemExtension.SUBSYSTEM_NAME, new IntVersion(major, minor)); + this.namespace = SubsystemSchema.createSubsystemURN(OpenTelemetrySubsystemExtension.SUBSYSTEM_NAME, new IntVersion(major, minor)); } @Override diff --git a/observability/pom.xml b/observability/pom.xml index 7151cdd96a17..aa765bf55921 100644 --- a/observability/pom.xml +++ b/observability/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-observability @@ -51,7 +51,7 @@ - ${project.groupId} + ${ee.maven.groupId} wildfly-standard-ee-bom ${ee.maven.version} pom diff --git a/picketlink/pom.xml b/picketlink/pom.xml index a08fc9b9e22e..c08cd21fbc66 100644 --- a/picketlink/pom.xml +++ b/picketlink/pom.xml @@ -11,7 +11,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-picketlink diff --git a/pojo/pom.xml b/pojo/pom.xml index ed69b8b6b4e7..65aed338856b 100644 --- a/pojo/pom.xml +++ b/pojo/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-pojo diff --git a/pojo/src/main/java/org/jboss/as/pojo/PojoSubsystemSchema.java b/pojo/src/main/java/org/jboss/as/pojo/PojoSubsystemSchema.java index fdb5dbbf8436..e58660be1936 100644 --- a/pojo/src/main/java/org/jboss/as/pojo/PojoSubsystemSchema.java +++ b/pojo/src/main/java/org/jboss/as/pojo/PojoSubsystemSchema.java @@ -24,9 +24,9 @@ import static org.jboss.as.controller.PersistentResourceXMLDescription.builder; -import org.jboss.as.controller.LegacySubsystemURN; import org.jboss.as.controller.PersistentResourceXMLDescription; import org.jboss.as.controller.PersistentSubsystemSchema; +import org.jboss.as.controller.SubsystemSchema; import org.jboss.as.controller.xml.VersionedNamespace; import org.jboss.staxmapper.IntVersion; @@ -43,7 +43,7 @@ public enum PojoSubsystemSchema implements PersistentSubsystemSchema namespace; PojoSubsystemSchema(int major) { - this.namespace = new LegacySubsystemURN<>(PojoExtension.SUBSYSTEM_NAME, new IntVersion(major)); + this.namespace = SubsystemSchema.createLegacySubsystemURN(PojoExtension.SUBSYSTEM_NAME, new IntVersion(major)); } @Override diff --git a/pojo/src/main/java/org/jboss/as/pojo/descriptor/BeanDeploymentSchema.java b/pojo/src/main/java/org/jboss/as/pojo/descriptor/BeanDeploymentSchema.java index ba9616368fce..9afdfaebe36e 100644 --- a/pojo/src/main/java/org/jboss/as/pojo/descriptor/BeanDeploymentSchema.java +++ b/pojo/src/main/java/org/jboss/as/pojo/descriptor/BeanDeploymentSchema.java @@ -22,10 +22,12 @@ package org.jboss.as.pojo.descriptor; +import java.util.List; + import javax.xml.stream.XMLStreamException; +import org.jboss.as.controller.xml.IntVersionSchema; import org.jboss.as.controller.xml.VersionedNamespace; -import org.jboss.as.controller.xml.VersionedURN; import org.jboss.as.controller.xml.XMLElementSchema; import org.jboss.as.pojo.ParseResult; import org.jboss.as.pojo.logging.PojoLogger; @@ -47,7 +49,7 @@ public enum BeanDeploymentSchema implements XMLElementSchema namespace; BeanDeploymentSchema(String nss, int major) { - this.namespace = new VersionedURN<>(VersionedURN.JBOSS_IDENTIFIER, nss, new IntVersion(major)); + this.namespace = IntVersionSchema.createURN(List.of(IntVersionSchema.JBOSS_IDENTIFIER, nss), new IntVersion(major)); } @Override diff --git a/pom.xml b/pom.xml index 806d819db94e..e4968f0172bb 100644 --- a/pom.xml +++ b/pom.xml @@ -37,7 +37,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT pom @@ -66,6 +66,7 @@ boms/standard-ee boms/standard-expansion boms/standard-test + boms/standard-test-expansion build client/properties client/shade @@ -144,9 +145,11 @@ ${full.dist.product.release.version} ${project.groupId} ${project.version} - 29 + 30 - 29.0 + ${product.docs.server.version}.0 + + ${product.docs.server.version}.0 true @@ -252,6 +255,13 @@ ${full.maven.groupId} wildfly-galleon-pack ${full.maven.version} + + ${full.maven.groupId} + wildfly-galleon-pack + ${full.maven.version} - 1.10.12 + 1.10.13 2.2.2 - 0.8.7 - 5.1.0.Final + 0.8.10 + 5.2.0.Final 2.1.0.Final 1.2.12.Final 1.0.8.Final 1.6.0.Final 6.4.2.Final - 9.0.0.Final + 10.0.0.Final 2.3.1.Final 4.1.0.Final 1.1 - 1.0.1 + 1.0.2 2.0.0 @@ -368,30 +378,28 @@ Properties for dependencies that solely relate to tests go in the test code section above. --> 4.10 - 1.12.284 - 1.0.2 0.8.1 1.5.1 - 2.14.2 + 2.14.3 ${version.com.fasterxml.jackson} ${version.com.fasterxml.jackson} - 3.1.6 + 3.1.8 1.2 1.8 1.9 1.1 2.0.1 2.8.9 - 31.1-jre + 32.1.1-jre 1.0.1 3.19.6 2.1.214 0.1.0 8.6.6 - 9.24.4 + 9.31 4.10.0 3.14.9 - 3.2.0 + 3.4.0 4.0.3 4.1.1 2.1.0 @@ -402,25 +410,25 @@ 2.11.0 1.0.13 2.0 - 1.9.3 - 4.1.94.Final + 1.9.13 + 4.1.97.Final 1.20.0 0.19.0-alpha 0.23.0 2.2.21 3.1.6 - 3.3.4 + 3.5.1 2.6.0 2.1.0 - 3.2.1 - 6.2.4 + 3.3.3 + 6.2.6 4.0.2 4.2.1 2.1.0 3.3.0 1.0.0 2.3.2 - 4.6.0 + 4.9.0 2.2.6.Final 4.4.1 ${version.io.vertx.vertx} @@ -431,7 +439,7 @@ 3.0.2 4.0.1 4.0.1 - 4.0.2 + 4.0.3 2.0.1 3.1.0 3.0.0 @@ -453,23 +461,23 @@ 8.0.0 2.26.0 1.0.2 - 1.11.0 + 1.11.2 4.0.0 4.0.0 4.1.5 0.8.9 - 3.4.0 - 8.11.1 + 3.5.1 + 8.11.2 3.1.1 - 0.34.0 - 3.0.1 + 0.34.1 + 3.0.2 0.14.1 2.3 - 3.0.0 + 3.0.1 2.3.0 2.12.0.SP05 0.9.3 - 1.12.18 + 1.14.7 4.2.1 6.4.0 1.2.5 @@ -489,43 +497,43 @@ 1.0 4.0.0 3.0.2 - 7.16.3 + 8.9.0 5.0.0 3.0.0 4.0.1 ${version.org.glassfish.jaxb} - 3.0.0 + 3.0.3 3.0.0 6.0.6.Final - 6.2.5.Final - 6.1.8.Final + 6.2.8.Final + 6.2.1.Final 8.0.0.Final 2.4.9.Final - 14.0.11.Final + 14.0.14.Final 4.6.2.Final 1.9.3 - 2.1.1.Final + 2.1.2.Final 2.0.0.Final 2.0.1.Final 5.0.5.Final 2.3.0.Final 3.0.0.Final - 3.6.10.Final + 3.6.12.Final 2.0.1.Final - 3.0.2.Final + 3.0.4.Final 8.0.0.Final 16.0.0.Final - 2.0.1.Final - 6.0.1.Final + 2.0.2.Final + 7.0.0.Final 9.0.2.Final - 6.2.4.Final + 6.2.5.Final 2.0.1.Final - 2.1.1.Final + 2.1.3.Final 3.0.3.Final 4.0.1.Final 1.0.0.Final 1.0.0.Final - 5.1.1.Final + 5.1.1.SP2 5.0.SP3 2.0.0.Final 4.0.0.Final @@ -536,23 +544,25 @@ 0.1.9.Final 2.1.2 1.7.10 - 5.2.14.Final - 2.0.1.Final + 5.2.18.Final + 3.0.0.Final 2.0.2.Final 2.0.1.Final 1.0.1.Final 2.1.0 18.0.2 - 1.8 + 1.11 4.2.0 9.5 1.0.4 - 21.1.0.Beta1 + 22.0.0.Beta1 2.0.2.Final 2.0.1.Final 2.0.0.Final 3.0.0.Final 1.0.0.Final + 2.20.126 + 1.0.1 ${version.org.glassfish.jaxb} 1.6.3 1.2 @@ -581,9 +591,9 @@ - ${ee.maven.groupId} + ${full.maven.groupId} wildfly-common-expansion-dependency-management - ${ee.maven.version} + ${full.maven.version} pom @@ -728,9 +738,9 @@ - ${ee.maven.groupId} + ${full.maven.groupId} wildfly-standard-expansion-bom - ${ee.maven.version} + ${full.maven.version} pom @@ -1301,7 +1311,7 @@ ${version.asciidoctor.plugin} - coderay + coderay font ${project.version} @@ -1403,15 +1413,16 @@ - ee9.test.profile + preview.test.profile - ts.ee9 + ts.preview preview/dist/target/${server.output.dir.prefix}-preview-${server.output.dir.version} wildfly-preview-feature-pack + wildfly-preview-feature-pack none @@ -1419,14 +1430,15 @@ - bootable.ee9.test.profile + bootable.preview.test.profile - ts.bootable.ee9 + ts.bootable.preview wildfly-preview-feature-pack + wildfly-preview-feature-pack none @@ -1569,8 +1581,6 @@ - - @@ -1580,8 +1590,14 @@ - - + + + + + + + + diff --git a/preview/build/pom.xml b/preview/build/pom.xml index f3f9844f39aa..2a29148fb43c 100644 --- a/preview/build/pom.xml +++ b/preview/build/pom.xml @@ -29,12 +29,12 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-preview-build - WildFly: EE 9 Preview Thin Server Build + WildFly Preview: Thin Server Build pom diff --git a/preview/dist/pom.xml b/preview/dist/pom.xml index f9826870304a..89a6b9b551bd 100644 --- a/preview/dist/pom.xml +++ b/preview/dist/pom.xml @@ -29,11 +29,11 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-preview-dist - WildFly: EE 9 Preview Distribution + WildFly Preview: Distribution jar diff --git a/preview/feature-pack/pom.xml b/preview/feature-pack/pom.xml index 6b45bbc52d42..6b48f24283a4 100644 --- a/preview/feature-pack/pom.xml +++ b/preview/feature-pack/pom.xml @@ -29,7 +29,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-preview-feature-pack diff --git a/preview/galleon-local/pom.xml b/preview/galleon-local/pom.xml index 769b74d6dc5d..32211e9a142d 100644 --- a/preview/galleon-local/pom.xml +++ b/preview/galleon-local/pom.xml @@ -33,12 +33,12 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-preview-feature-pack-galleon-local - WildFly: Preview Feature Pack Local Galleon Content + WildFly Preview: Feature Pack Local Galleon Content Content for the wildfly-preview feature pack that can only be used in that feature pack and not in the wildfly feature pack @@ -47,6 +47,11 @@ + + org.apache.avro + avro + + org.hibernate.search hibernate-search-mapper-orm-coordination-outbox-polling-orm6 diff --git a/preview/galleon-local/src/main/resources/layers/standalone/hibernate-search/layer-spec.xml b/preview/galleon-local/src/main/resources/layers/standalone/hibernate-search/layer-spec.xml index dd08d0f58277..90c7c1e54768 100644 --- a/preview/galleon-local/src/main/resources/layers/standalone/hibernate-search/layer-spec.xml +++ b/preview/galleon-local/src/main/resources/layers/standalone/hibernate-search/layer-spec.xml @@ -1,5 +1,8 @@ - + + + + diff --git a/preview/galleon-local/src/main/resources/license/licenses.xml b/preview/galleon-local/src/main/resources/license/licenses.xml index 2501feaa4fe3..c6042d476784 100644 --- a/preview/galleon-local/src/main/resources/license/licenses.xml +++ b/preview/galleon-local/src/main/resources/license/licenses.xml @@ -1,6 +1,32 @@ + + org.apache.avro + avro + + + Apache License 2.0 + http://www.apache.org/licenses/LICENSE-2.0 + repo + + + BSD 3-Clause "New" or "Revised" License + http://www.opensource.org/licenses/BSD-3-Clause + repo + + + FSF All Permissive License + http://www.gnu.org/prep/maintain/html_node/License-Notices-for-Other-Files.html + repo + + + MIT License + http://www.opensource.org/licenses/MIT + repo + + + org.hibernate.search hibernate-search-mapper-orm-coordination-outbox-polling-orm6 diff --git a/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/apache/avro/main/module.xml b/preview/galleon-local/src/main/resources/modules/system/layers/base/org/apache/avro/main/module.xml similarity index 100% rename from ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/org/apache/avro/main/module.xml rename to preview/galleon-local/src/main/resources/modules/system/layers/base/org/apache/avro/main/module.xml diff --git a/preview/galleon-local/src/main/resources/packages/docs.licenses/pm/wildfly/tasks.xml b/preview/galleon-local/src/main/resources/packages/docs.licenses/pm/wildfly/tasks.xml index 789d25922606..b8c3c82dee04 100644 --- a/preview/galleon-local/src/main/resources/packages/docs.licenses/pm/wildfly/tasks.xml +++ b/preview/galleon-local/src/main/resources/packages/docs.licenses/pm/wildfly/tasks.xml @@ -4,9 +4,9 @@ - + - + diff --git a/preview/pom.xml b/preview/pom.xml index cee1e599a0f1..027a7c2e66fc 100644 --- a/preview/pom.xml +++ b/preview/pom.xml @@ -29,11 +29,11 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-preview-parent - Parent for EE 9 related modules + Parent for WildFly Preview related modules pom WildFly Preview: Parent diff --git a/release/pom.xml b/release/pom.xml index 4b1097b7742f..14f80fda4e34 100644 --- a/release/pom.xml +++ b/release/pom.xml @@ -34,7 +34,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-release diff --git a/rts/pom.xml b/rts/pom.xml index edd4ea414405..f8f8f9d61b14 100644 --- a/rts/pom.xml +++ b/rts/pom.xml @@ -19,7 +19,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-rts diff --git a/sar/pom.xml b/sar/pom.xml index da166fa17b97..0f6a22415036 100644 --- a/sar/pom.xml +++ b/sar/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-sar diff --git a/sar/src/main/java/org/jboss/as/service/SarSubsystemSchema.java b/sar/src/main/java/org/jboss/as/service/SarSubsystemSchema.java index a7c155d7ec16..b19192978c6b 100644 --- a/sar/src/main/java/org/jboss/as/service/SarSubsystemSchema.java +++ b/sar/src/main/java/org/jboss/as/service/SarSubsystemSchema.java @@ -24,9 +24,9 @@ import static org.jboss.as.controller.PersistentResourceXMLDescription.builder; -import org.jboss.as.controller.LegacySubsystemURN; import org.jboss.as.controller.PersistentResourceXMLDescription; import org.jboss.as.controller.PersistentSubsystemSchema; +import org.jboss.as.controller.SubsystemSchema; import org.jboss.as.controller.xml.VersionedNamespace; import org.jboss.staxmapper.IntVersion; @@ -43,7 +43,7 @@ public enum SarSubsystemSchema implements PersistentSubsystemSchema namespace; SarSubsystemSchema(int major) { - this.namespace = new LegacySubsystemURN<>(SarExtension.SUBSYSTEM_NAME, new IntVersion(major)); + this.namespace = SubsystemSchema.createLegacySubsystemURN(SarExtension.SUBSYSTEM_NAME, new IntVersion(major)); } @Override diff --git a/security/pom.xml b/security/pom.xml index 6e3b30cf2bf4..d258b849d284 100644 --- a/security/pom.xml +++ b/security/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-security-parent diff --git a/security/subsystem/pom.xml b/security/subsystem/pom.xml index 6c30cddbbcd3..a287cd3845d8 100644 --- a/security/subsystem/pom.xml +++ b/security/subsystem/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT ../pom.xml diff --git a/security/subsystem/src/main/java/org/jboss/as/security/MappingModuleDefinition.java b/security/subsystem/src/main/java/org/jboss/as/security/MappingModuleDefinition.java index dd83ffa8de65..8f9f61f7f4d4 100644 --- a/security/subsystem/src/main/java/org/jboss/as/security/MappingModuleDefinition.java +++ b/security/subsystem/src/main/java/org/jboss/as/security/MappingModuleDefinition.java @@ -24,8 +24,8 @@ package org.jboss.as.security; -import org.jboss.as.controller.AbstractAddStepHandler; import org.jboss.as.controller.AttributeDefinition; +import org.jboss.as.controller.ModelOnlyAddStepHandler; import org.jboss.as.controller.ModelOnlyRemoveStepHandler; import org.jboss.as.controller.ModelOnlyWriteAttributeHandler; import org.jboss.as.controller.OperationStepHandler; @@ -72,7 +72,7 @@ class MappingModuleDefinition extends SimpleResourceDefinition { @Override public void registerOperations(ManagementResourceRegistration resourceRegistration) { super.registerOperations(resourceRegistration); - super.registerAddOperation(resourceRegistration, new AbstractAddStepHandler(this.getAttributes()), OperationEntry.Flag.RESTART_NONE); + super.registerAddOperation(resourceRegistration, new ModelOnlyAddStepHandler(this.getAttributes()), OperationEntry.Flag.RESTART_NONE); } @Override @@ -87,6 +87,4 @@ public void registerAttributes(ManagementResourceRegistration resourceRegistrati public AttributeDefinition[] getAttributes() { return ATTRIBUTES; } - - } diff --git a/security/subsystem/src/main/java/org/jboss/as/security/elytron/ElytronIntegrationResourceDefinitions.java b/security/subsystem/src/main/java/org/jboss/as/security/elytron/ElytronIntegrationResourceDefinitions.java index 61e7795e6ee5..d87ff57a4fb2 100644 --- a/security/subsystem/src/main/java/org/jboss/as/security/elytron/ElytronIntegrationResourceDefinitions.java +++ b/security/subsystem/src/main/java/org/jboss/as/security/elytron/ElytronIntegrationResourceDefinitions.java @@ -22,6 +22,7 @@ import org.jboss.as.controller.AbstractAddStepHandler; import org.jboss.as.controller.AttributeDefinition; +import org.jboss.as.controller.ModelOnlyAddStepHandler; import org.jboss.as.controller.ResourceDefinition; import org.jboss.as.controller.SimpleAttributeDefinition; import org.jboss.as.controller.SimpleAttributeDefinitionBuilder; @@ -75,7 +76,7 @@ public class ElytronIntegrationResourceDefinitions { public static ResourceDefinition getElytronRealmResourceDefinition() { final AttributeDefinition[] attributes = new AttributeDefinition[] {LEGACY_JAAS_CONFIG, APPLY_ROLE_MAPPERS}; - final AbstractAddStepHandler addHandler = new AbstractAddStepHandler(attributes); + final AbstractAddStepHandler addHandler = new ModelOnlyAddStepHandler(attributes); return new BasicResourceDefinition(Constants.ELYTRON_REALM, addHandler, attributes, SECURITY_REALM_RUNTIME_CAPABILITY); } @@ -94,7 +95,7 @@ public static ResourceDefinition getElytronRealmResourceDefinition() { */ public static ResourceDefinition getElytronKeyStoreResourceDefinition() { final AttributeDefinition[] attributes = new AttributeDefinition[] {LEGACY_JSSE_CONFIG}; - final AbstractAddStepHandler addHandler = new AbstractAddStepHandler(attributes); + final AbstractAddStepHandler addHandler = new ModelOnlyAddStepHandler(attributes); return new BasicResourceDefinition(Constants.ELYTRON_KEY_STORE, addHandler, attributes, KEY_STORE_RUNTIME_CAPABILITY); } @@ -122,7 +123,7 @@ public static ResourceDefinition getElytronKeyStoreResourceDefinition() { */ public static ResourceDefinition getElytronTrustStoreResourceDefinition() { final AttributeDefinition[] attributes = new AttributeDefinition[] {LEGACY_JSSE_CONFIG}; - final AbstractAddStepHandler addHandler = new AbstractAddStepHandler(attributes); + final AbstractAddStepHandler addHandler = new ModelOnlyAddStepHandler(attributes); return new BasicResourceDefinition(Constants.ELYTRON_TRUST_STORE, addHandler, attributes, KEY_STORE_RUNTIME_CAPABILITY); } @@ -141,7 +142,7 @@ public static ResourceDefinition getElytronTrustStoreResourceDefinition() { */ public static ResourceDefinition getElytronKeyManagersResourceDefinition() { final AttributeDefinition[] attributes = new AttributeDefinition[] {LEGACY_JSSE_CONFIG}; - final AbstractAddStepHandler addHandler = new AbstractAddStepHandler(attributes); + final AbstractAddStepHandler addHandler = new ModelOnlyAddStepHandler(attributes); return new BasicResourceDefinition(Constants.ELYTRON_KEY_MANAGER, addHandler, attributes, KEY_MANAGER_RUNTIME_CAPABILITY); } @@ -165,7 +166,7 @@ public static ResourceDefinition getElytronKeyManagersResourceDefinition() { */ public static ResourceDefinition getElytronTrustManagersResourceDefinition() { final AttributeDefinition[] attributes = new AttributeDefinition[] {LEGACY_JSSE_CONFIG}; - final AbstractAddStepHandler addHandler = new AbstractAddStepHandler(attributes); + final AbstractAddStepHandler addHandler = new ModelOnlyAddStepHandler(attributes); return new BasicResourceDefinition(Constants.ELYTRON_TRUST_MANAGER, addHandler, attributes, TRUST_MANAGER_RUNTIME_CAPABILITY); } diff --git a/spec-api/pom.xml b/spec-api/pom.xml index 871f71d8a69c..d164cacfb91c 100644 --- a/spec-api/pom.xml +++ b/spec-api/pom.xml @@ -32,7 +32,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-spec-api diff --git a/spec-api/test/pom.xml b/spec-api/test/pom.xml index e40165fec430..dff798f710bd 100644 --- a/spec-api/test/pom.xml +++ b/spec-api/test/pom.xml @@ -32,7 +32,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-spec-api-test diff --git a/system-jmx/pom.xml b/system-jmx/pom.xml index edbe08da3cfa..a881c75576f1 100644 --- a/system-jmx/pom.xml +++ b/system-jmx/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT ../pom.xml diff --git a/testsuite/domain/pom.xml b/testsuite/domain/pom.xml index 49ba1579e8d4..fb1d4f5974b1 100644 --- a/testsuite/domain/pom.xml +++ b/testsuite/domain/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-testsuite-integration-domain @@ -83,12 +83,6 @@ org.wildfly.core wildfly-process-controller - - - * - * - - org.wildfly.core @@ -97,12 +91,6 @@ ${project.groupId} wildfly-messaging-activemq-injection - - - * - * - - ${project.groupId} @@ -111,12 +99,6 @@ org.wildfly.core wildfly-host-controller - - - * - * - - org.jboss.shrinkwrap @@ -129,12 +111,6 @@ org.wildfly.core wildfly-controller - - - * - * - - org.wildfly.core @@ -147,12 +123,6 @@ ${project.groupId} wildfly-security - - - * - * - - org.jboss.arquillian.junit @@ -372,10 +342,10 @@ - ee9.profile + preview.profile - ts.ee9 + ts.preview diff --git a/testsuite/domain/src/test/java/org/jboss/as/test/integration/domain/HostExcludesTestCase.java b/testsuite/domain/src/test/java/org/jboss/as/test/integration/domain/HostExcludesTestCase.java index 776f53b44a57..e4af820ade18 100644 --- a/testsuite/domain/src/test/java/org/jboss/as/test/integration/domain/HostExcludesTestCase.java +++ b/testsuite/domain/src/test/java/org/jboss/as/test/integration/domain/HostExcludesTestCase.java @@ -36,7 +36,6 @@ import java.nio.file.Paths; import java.util.ArrayList; import java.util.Arrays; -import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; @@ -90,7 +89,7 @@ public class HostExcludesTestCase extends BuildConfigurationTestBase { private final boolean isFullDistribution = AssumeTestGroupUtil.isFullDistribution(); private final boolean isPreviewGalleonPack = AssumeTestGroupUtil.isWildFlyPreview(); - private static final String MAJOR = "29."; + private static final String MAJOR = "30."; /** * Maintains the list of expected extensions for each host-exclude name for previous releases. @@ -210,14 +209,19 @@ private enum ExtensionConf { "org.wildfly.extension.microprofile.lra-participant", "org.wildfly.extension.microprofile.telemetry" ), true), - CURRENT(MAJOR, WILDFLY_28_0, getCurrentAddedExtensions(), getCurrentRemovedExtensions(), true); + WILDFLY_29_0("WildFly29.0", WILDFLY_28_0, List.of(), List.of( + "org.jboss.as.jacorb", + "org.jboss.as.messaging", + "org.jboss.as.web" + ), true), + CURRENT(MAJOR, WILDFLY_29_0, getCurrentAddedExtensions(), getCurrentRemovedExtensions(), true); private static List getCurrentAddedExtensions() { // If an extension is added to this list, also check if it is supplied only by wildfly-galleon-pack. If so, add it also // to the internal mpExtensions Set defined on this class. // Don't add here extensions supplied only by the wildfly-preview-feature-pack because we are not tracking different releases // of wildfly preview. In such a case, add them to previewExtensions set defined below. - return Collections.emptyList(); + return List.of(); } private static List getCurrentRemovedExtensions() { // TODO If we decide to remove these modules from WFP, uncomment this. @@ -231,7 +235,7 @@ private static List getCurrentRemovedExtensions() { ); } */ - return Arrays.asList("org.jboss.as.jacorb", "org.jboss.as.messaging", "org.jboss.as.web"); + return List.of(); } private final String name; diff --git a/testsuite/galleon/pom.xml b/testsuite/galleon/pom.xml index 7107dce3376b..7e6cab804603 100644 --- a/testsuite/galleon/pom.xml +++ b/testsuite/galleon/pom.xml @@ -11,7 +11,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-ts-galleon-parent diff --git a/testsuite/galleon/update/pom.xml b/testsuite/galleon/update/pom.xml index 909de8027199..3db8bc45bf1d 100644 --- a/testsuite/galleon/update/pom.xml +++ b/testsuite/galleon/update/pom.xml @@ -11,7 +11,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-ts-galleon-update @@ -66,6 +66,7 @@ + @@ -74,6 +75,7 @@ + @@ -82,6 +84,7 @@ + diff --git a/testsuite/galleon/update/run-test.sh b/testsuite/galleon/update/run-test.sh index 27ca6dabebab..b05af129d8ae 100755 --- a/testsuite/galleon/update/run-test.sh +++ b/testsuite/galleon/update/run-test.sh @@ -27,7 +27,7 @@ echo "Testing update of ${WILDFLY_PRODUCER} from ${WF_BASE_VERSION} to ${WILDFLY wildflyDir="${BASE_DIR}"/target/${WILDFLY_PRODUCER} rm -rf "${wildflyDir}" -"${BASE_DIR}"/target/galleon/galleon-${GALLEON_VERSION}/bin/galleon.sh install ${WILDFLY_PRODUCER}:current/snapshot#${WF_BASE_VERSION} \ +"${BASE_DIR}"/target/galleon/galleon-${GALLEON_VERSION}/bin/galleon.sh install ${WILDFLY_PRODUCER}:${WILDFLY_CHANNEL}/snapshot#${WF_BASE_VERSION} \ --dir="${wildflyDir}" "${BASE_DIR}"/target/galleon/galleon-${GALLEON_VERSION}/bin/galleon.sh update --yes --dir="${wildflyDir}" "${BASE_DIR}"/target/galleon/galleon-${GALLEON_VERSION}/bin/galleon.sh get-info --type=configs --dir="${wildflyDir}" @@ -37,7 +37,7 @@ echo "Testing update of ${WILDFLY_PRODUCER} with Galleon layers from ${WF_BASE_V # Layers base update wildflyLayersDir="${BASE_DIR}"/target/${WILDFLY_PRODUCER}-layers rm -rf "${wildflyLayersDir}" -"${BASE_DIR}"/target/galleon/galleon-${GALLEON_VERSION}/bin/galleon.sh install ${WILDFLY_PRODUCER}:current/snapshot#${WF_BASE_VERSION} \ +"${BASE_DIR}"/target/galleon/galleon-${GALLEON_VERSION}/bin/galleon.sh install ${WILDFLY_PRODUCER}:${WILDFLY_CHANNEL}/snapshot#${WF_BASE_VERSION} \ --dir="${wildflyLayersDir}" --layers=${GALLEON_LAYERS} "${BASE_DIR}"/target/galleon/galleon-${GALLEON_VERSION}/bin/galleon.sh update --yes --dir="${wildflyLayersDir}" "${BASE_DIR}"/target/galleon/galleon-${GALLEON_VERSION}/bin/galleon.sh get-info --type=configs --dir="${wildflyLayersDir}" diff --git a/testsuite/integration/basic/pom.xml b/testsuite/integration/basic/pom.xml index 9ba30e60cc52..69016a82f1fe 100644 --- a/testsuite/integration/basic/pom.xml +++ b/testsuite/integration/basic/pom.xml @@ -11,7 +11,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT @@ -3593,12 +3593,12 @@ - + - bootablejar.ee9.profile + bootablejar.preview.profile - DISABLED.ts.bootable.ee9 + DISABLED.ts.bootable.preview @@ -3698,7 +3698,7 @@ which is not sustainable for all tests. --> org/jboss/as/test/integration/weld/modules/deployment/ModuleBeanDiscoveryModeTest.java org/jboss/as/test/integration/weld/modules/export/ExportedModuleTestCase.java - + org/jboss/as/test/integration/beanvalidation/hibernate/validator/deprecated/SafeHtmlValidationTestCase org/jboss/as/test/integration/management/cli/DeploymentOverlayCLITestCase.java org/jboss/as/test/integration/management/deploy/runtime/JaxrsRuntimeNameTestCase.java @@ -3745,10 +3745,10 @@ - ee9.test.profile + preview.test.profile - DISABLED.ts.ee9 + DISABLED.ts.preview @@ -3777,6 +3777,7 @@ org/jboss/as/test/integration/ejb/transaction/mdb/timeout/MessageDriven*TimeoutTestCase.java org/jboss/as/test/integration/management/cli/JmsTestCase.java org/jboss/as/test/integration/messaging/**/*TestCase.java + org/jboss/as/test/integration/ejb/management/deployments/*TestCase.java org/jboss/as/test/integration/ejb/pool/lifecycle/PooledEJBLifecycleTestCase.java @@ -3827,7 +3828,7 @@ org/jboss/as/test/integration/weld/context/application/lifecycle/ApplicationContextLifecycleTestCase.java org/jboss/as/test/integration/jaxrs/cfg/**/ResteasyAttributeTestCase.java - + org/jboss/as/test/integration/ee/globalmodules/GlobalModulesTestCase.java org/jboss/as/test/integration/ejb/interceptor/serverside/**/*TestCase.java @@ -3859,12 +3860,13 @@ org/jboss/as/test/integration/weld/ejb/SessionObjectReferenceTestCase.java org/wildfly/test/integration/web/annotationsmodule/EarModuleDeploymentTestCase.java - + + so we still test Hibernate Search with EE 9. --> org/jboss/as/test/integration/hibernate/search/** diff --git a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/Hibernate2LCacheStatsTestCase.java b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/Hibernate2LCacheStatsTestCase.java index b3148f3f8ee0..1c6558e0e1d9 100644 --- a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/Hibernate2LCacheStatsTestCase.java +++ b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/Hibernate2LCacheStatsTestCase.java @@ -25,7 +25,6 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; -import static org.junit.Assume.assumeTrue; import java.sql.Connection; import java.util.HashSet; @@ -91,8 +90,6 @@ public class Hibernate2LCacheStatsTestCase { public static void beforeClass() throws NamingException { // TODO This can be re-looked at once HHH-13188 is resolved. This may require further changes in Hibernate. AssumeTestGroupUtil.assumeSecurityManagerDisabled(); - // This test needs to be recompiled against Hibernate ORM 6 (WFLY-16178) in order to pass. - assumeTrue(System.getProperty("ts.ee9") == null && System.getProperty("ts.bootable.ee9") == null); iniCtx = new InitialContext(); } diff --git a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/Hibernate4NativeAPIProviderTestCase.java b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/Hibernate4NativeAPIProviderTestCase.java index 46df5ec4fcbd..d62a9f495475 100644 --- a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/Hibernate4NativeAPIProviderTestCase.java +++ b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/Hibernate4NativeAPIProviderTestCase.java @@ -23,7 +23,6 @@ package org.jboss.as.test.integration.hibernate; import static org.junit.Assert.assertTrue; -import static org.junit.Assume.assumeTrue; import javax.naming.InitialContext; import javax.naming.NamingException; @@ -80,8 +79,6 @@ public class Hibernate4NativeAPIProviderTestCase { public static void beforeClass() throws NamingException { // TODO This can be re-looked at once HHH-13188 is resolved. This may require further changes in Hibernate. AssumeTestGroupUtil.assumeSecurityManagerDisabled(); - // This test needs to be recompiled against Hibernate ORM 6 (WFLY-16178) in order to pass. - assumeTrue(System.getProperty("ts.ee9") == null && System.getProperty("ts.bootable.ee9") == null); iniCtx = new InitialContext(); } diff --git a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/HibernateNativeAPITransactionTestCase.java b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/HibernateNativeAPITransactionTestCase.java index 8538074a210e..1a737218646d 100644 --- a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/HibernateNativeAPITransactionTestCase.java +++ b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/HibernateNativeAPITransactionTestCase.java @@ -23,7 +23,6 @@ package org.jboss.as.test.integration.hibernate; import static org.junit.Assert.assertTrue; -import static org.junit.Assume.assumeTrue; import javax.naming.InitialContext; import javax.naming.NamingException; @@ -80,8 +79,6 @@ public class HibernateNativeAPITransactionTestCase { public static void beforeClass() throws NamingException { // TODO This can be re-looked at once HHH-13188 is resolved. This may require further changes in Hibernate. AssumeTestGroupUtil.assumeSecurityManagerDisabled(); - // This test needs to be recompiled against Hibernate ORM 6 (WFLY-16178) in order to pass. - assumeTrue(System.getProperty("ts.ee9") == null && System.getProperty("ts.bootable.ee9") == null); iniCtx = new InitialContext(); } diff --git a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/envers/Hibernate4NativeAPIEnversTestCase.java b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/envers/Hibernate4NativeAPIEnversTestCase.java index 8359e610e2cf..48c4c7a03604 100644 --- a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/envers/Hibernate4NativeAPIEnversTestCase.java +++ b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/envers/Hibernate4NativeAPIEnversTestCase.java @@ -23,7 +23,6 @@ package org.jboss.as.test.integration.hibernate.envers; import static org.junit.Assert.assertTrue; -import static org.junit.Assume.assumeTrue; import javax.naming.InitialContext; import javax.naming.NamingException; @@ -79,8 +78,6 @@ public class Hibernate4NativeAPIEnversTestCase { public static void beforeClass() throws NamingException { // TODO This can be re-looked at once HHH-13188 is resolved. This may require further changes in Hibernate. AssumeTestGroupUtil.assumeSecurityManagerDisabled(); - // This test needs to be recompiled against Hibernate ORM 6 (WFLY-16178) in order to pass. - assumeTrue(System.getProperty("ts.ee9") == null && System.getProperty("ts.bootable.ee9") == null); iniCtx = new InitialContext(); } diff --git a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/naturalid/HibernateNativeAPINaturalIdTestCase.java b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/naturalid/HibernateNativeAPINaturalIdTestCase.java index 00b078d3f18d..0a4c81802237 100644 --- a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/naturalid/HibernateNativeAPINaturalIdTestCase.java +++ b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/naturalid/HibernateNativeAPINaturalIdTestCase.java @@ -23,7 +23,6 @@ package org.jboss.as.test.integration.hibernate.naturalid; import static org.junit.Assert.assertEquals; -import static org.junit.Assume.assumeTrue; import jakarta.ejb.EJB; import javax.naming.InitialContext; @@ -94,8 +93,6 @@ public class HibernateNativeAPINaturalIdTestCase { public static void beforeClass() throws NamingException { // TODO This can be re-looked at once HHH-13188 is resolved. This may require further changes in Hibernate. AssumeTestGroupUtil.assumeSecurityManagerDisabled(); - // This test needs to be recompiled against Hibernate ORM 6 (WFLY-16178) in order to pass. - assumeTrue(System.getProperty("ts.ee9") == null && System.getProperty("ts.bootable.ee9") == null); iniCtx = new InitialContext(); } diff --git a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jpa/webtxem/entity/WebTxEmTicket.java b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/search/backend/elasticsearch/projectionconstructor/Author.java similarity index 52% rename from testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jpa/webtxem/entity/WebTxEmTicket.java rename to testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/search/backend/elasticsearch/projectionconstructor/Author.java index 65f0f1a71f1b..9344aa3b456f 100644 --- a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jpa/webtxem/entity/WebTxEmTicket.java +++ b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/search/backend/elasticsearch/projectionconstructor/Author.java @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2011, Red Hat, Inc., and individual contributors + * Copyright 2023, Red Hat, Inc., and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * @@ -19,59 +19,62 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ +package org.jboss.as.test.integration.hibernate.search.backend.elasticsearch.projectionconstructor; -package org.jboss.as.test.integration.jpa.webtxem.entity; - -import jakarta.persistence.CascadeType; import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue; -import jakarta.persistence.GenerationType; import jakarta.persistence.Id; -import jakarta.persistence.JoinColumn; -import jakarta.persistence.ManyToOne; +import jakarta.persistence.ManyToMany; +import org.hibernate.search.mapper.pojo.mapping.definition.annotation.FullTextField; + +import java.util.ArrayList; +import java.util.List; -/** - * Ticket entity class - * - * @author Zbyněk Roubalík - */ @Entity -public class WebTxEmTicket { +public class Author { - Long id; - String number; - WebTxEmCustomer customer; + @Id + @GeneratedValue + private Long id; - public WebTxEmTicket() { - } + @FullTextField + private String firstName; + + @FullTextField + private String lastName; + + @ManyToMany(mappedBy = "authors") + private List books = new ArrayList<>(); - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) public Long getId() { return id; } - public void setId(Long long1) { - id = long1; + public void setId(Long id) { + this.id = id; } - public String getNumber() { - return number; + public String getFirstName() { + return firstName; } - public void setNumber(String string) { - number = string; + public void setFirstName(String firstName) { + this.firstName = firstName; } - @ManyToOne(cascade = CascadeType.ALL) - @JoinColumn(name = "CUSTOMER_ID") - public WebTxEmCustomer getCustomer() { - return customer; + public String getLastName() { + return lastName; } - public void setCustomer(WebTxEmCustomer customer) { - this.customer = customer; + public void setLastName(String lastName) { + this.lastName = lastName; } -} + public List getBooks() { + return books; + } + public void setBooks(List books) { + this.books = books; + } +} diff --git a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/search/backend/elasticsearch/projectionconstructor/AuthorDTO.java b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/search/backend/elasticsearch/projectionconstructor/AuthorDTO.java new file mode 100644 index 000000000000..6dff04a1a2df --- /dev/null +++ b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/search/backend/elasticsearch/projectionconstructor/AuthorDTO.java @@ -0,0 +1,50 @@ +/* + * JBoss, Home of Professional Open Source. + * Copyright 2023, Red Hat, Inc., and individual contributors + * as indicated by the @author tags. See the copyright.txt file in the + * distribution for a full listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.jboss.as.test.integration.hibernate.search.backend.elasticsearch.projectionconstructor; + +import org.hibernate.search.mapper.pojo.mapping.definition.annotation.FieldProjection; +import org.hibernate.search.mapper.pojo.mapping.definition.annotation.ObjectProjection; +import org.hibernate.search.mapper.pojo.mapping.definition.annotation.ProjectionConstructor; + +import java.util.Collections; +import java.util.List; + +public class AuthorDTO { + public final String firstName; + public final String lastName; + public final List books; + + public AuthorDTO(String firstName, String lastName) { + this(firstName, lastName, Collections.emptyList()); + } + + @ProjectionConstructor + public AuthorDTO(// These @FieldProjection annotations and @ObjectProjection.path wouldn't be necessary + // with a record or a class compiled with -parameters + @FieldProjection(path = "firstName") String firstName, + @FieldProjection(path = "lastName") String lastName, + @ObjectProjection(path = "books", includeDepth = 1) List books) { + this.firstName = firstName; + this.lastName = lastName; + this.books = books; + } +} diff --git a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/search/backend/elasticsearch/projectionconstructor/Book.java b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/search/backend/elasticsearch/projectionconstructor/Book.java new file mode 100644 index 000000000000..745a9c5dadfe --- /dev/null +++ b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/search/backend/elasticsearch/projectionconstructor/Book.java @@ -0,0 +1,73 @@ +/* + * JBoss, Home of Professional Open Source. + * Copyright 2023, Red Hat, Inc., and individual contributors + * as indicated by the @author tags. See the copyright.txt file in the + * distribution for a full listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.jboss.as.test.integration.hibernate.search.backend.elasticsearch.projectionconstructor; + +import jakarta.persistence.Entity; +import jakarta.persistence.Id; +import jakarta.persistence.ManyToMany; +import jakarta.persistence.OrderColumn; +import org.hibernate.search.mapper.pojo.mapping.definition.annotation.FullTextField; +import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; +import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexedEmbedded; + +import java.util.ArrayList; +import java.util.List; + +@Entity +@Indexed +public class Book { + + @Id + private Long id; + + @FullTextField + private String title; + + @IndexedEmbedded(includeDepth = 1) + @ManyToMany + @OrderColumn + private List authors = new ArrayList<>(); + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public List getAuthors() { + return authors; + } + + public void setAuthors(List authors) { + this.authors = authors; + } +} diff --git a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/search/backend/elasticsearch/projectionconstructor/BookDTO.java b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/search/backend/elasticsearch/projectionconstructor/BookDTO.java new file mode 100644 index 000000000000..dab5441f0a7a --- /dev/null +++ b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/search/backend/elasticsearch/projectionconstructor/BookDTO.java @@ -0,0 +1,46 @@ +/* + * JBoss, Home of Professional Open Source. + * Copyright 2023, Red Hat, Inc., and individual contributors + * as indicated by the @author tags. See the copyright.txt file in the + * distribution for a full listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.jboss.as.test.integration.hibernate.search.backend.elasticsearch.projectionconstructor; + +import org.hibernate.search.mapper.pojo.mapping.definition.annotation.FieldProjection; +import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IdProjection; +import org.hibernate.search.mapper.pojo.mapping.definition.annotation.ObjectProjection; +import org.hibernate.search.mapper.pojo.mapping.definition.annotation.ProjectionConstructor; + +import java.util.List; + +public class BookDTO { + public final long id; + public final String title; + public final List authors; + + @ProjectionConstructor + public BookDTO(@IdProjection long id, + // This @FieldProjection and @ObjectProjection.path wouldn't be necessary + // with a record or a class compiled with -parameters + @FieldProjection(path = "title") String title, + @ObjectProjection(path = "authors", includeDepth = 1) List authors) { + this.id = id; + this.title = title; + this.authors = authors; + } +} diff --git a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/search/backend/elasticsearch/projectionconstructor/HibernateSearchElasticsearchProjectionConstructorTestCase.java b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/search/backend/elasticsearch/projectionconstructor/HibernateSearchElasticsearchProjectionConstructorTestCase.java new file mode 100644 index 000000000000..cfa7eee146b8 --- /dev/null +++ b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/search/backend/elasticsearch/projectionconstructor/HibernateSearchElasticsearchProjectionConstructorTestCase.java @@ -0,0 +1,146 @@ +/* + * JBoss, Home of Professional Open Source. + * Copyright 2023, Red Hat, Inc., and individual contributors + * as indicated by the @author tags. See the copyright.txt file in the + * distribution for a full listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.jboss.as.test.integration.hibernate.search.backend.elasticsearch.projectionconstructor; + +import jakarta.inject.Inject; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.core.api.annotation.Observer; +import org.jboss.arquillian.junit.Arquillian; +import org.jboss.as.test.integration.hibernate.search.backend.elasticsearch.util.ElasticsearchServerSetupObserver; +import org.jboss.as.test.shared.util.AssumeTestGroupUtil; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.Asset; +import org.jboss.shrinkwrap.api.asset.EmptyAsset; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.jboss.shrinkwrap.descriptor.api.Descriptors; +import org.jboss.shrinkwrap.descriptor.api.persistence20.PersistenceDescriptor; +import org.junit.After; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; + +import java.util.Arrays; +import java.util.List; + +import static org.junit.Assert.assertEquals; + +/** + * Verify deployed applications can use Hibernate Search's @ProjectionConstructor with Lucene. + */ +@RunWith(Arquillian.class) +@Observer(ElasticsearchServerSetupObserver.class) +public class HibernateSearchElasticsearchProjectionConstructorTestCase { + + private static final String NAME = HibernateSearchElasticsearchProjectionConstructorTestCase.class.getSimpleName(); + private static final String WAR_ARCHIVE_NAME = NAME + ".war"; + + @BeforeClass + public static void testRequiresDocker() { + AssumeTestGroupUtil.assumeDockerAvailable(); + } + + @BeforeClass + public static void securityManagerNotSupportedInHibernateSearch() { + AssumeTestGroupUtil.assumeSecurityManagerDisabled(); + } + + @Deployment + public static WebArchive createArchive() { + + // TODO maybe just use managed=false and deploy in the @BeforeClass / undeploy in an @AfterClass + if (!AssumeTestGroupUtil.isDockerAvailable() || AssumeTestGroupUtil.isSecurityManagerEnabled()) { + return AssumeTestGroupUtil.emptyWar(WAR_ARCHIVE_NAME); + } + + return ShrinkWrap + .create(WebArchive.class, WAR_ARCHIVE_NAME) + .addClasses(HibernateSearchElasticsearchProjectionConstructorTestCase.class, + SearchBean.class, Book.class, Author.class, BookDTO.class, AuthorDTO.class, + AssumeTestGroupUtil.class) + .addAsResource(persistenceXml(), "META-INF/persistence.xml") + .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); + } + + private static Asset persistenceXml() { + String persistenceXml = Descriptors.create(PersistenceDescriptor.class) + .version("2.0") + .createPersistenceUnit() + .name("jpa-search-test-pu") + .jtaDataSource("java:jboss/datasources/ExampleDS") + .clazz(Book.class.getName()) + .clazz(Author.class.getName()) + .getOrCreateProperties() + .createProperty().name("hibernate.hbm2ddl.auto").value("create-drop").up() + .createProperty().name("hibernate.search.schema_management.strategy").value("drop-and-create-and-drop").up() + .createProperty().name("hibernate.search.automatic_indexing.synchronization.strategy").value("sync").up() + .createProperty().name("hibernate.search.backend.type").value("elasticsearch").up() + .createProperty().name("hibernate.search.backend.hosts").value(ElasticsearchServerSetupObserver.getHttpHostAddress()).up() + .up().up() + .exportAsString(); + return new StringAsset(persistenceXml); + } + + @Inject + private SearchBean searchBean; + + @Before + @After + public void cleanupDatabase() { + searchBean.deleteAll(); + } + + @Test + public void testProjection() { + BookDTO book1 = new BookDTO(1, "Hello world", + Arrays.asList(new AuthorDTO("John", "Smith"))); + searchBean.storeNewBook(book1); + BookDTO book2 = new BookDTO(2, "Hello planet Mars", + Arrays.asList(new AuthorDTO("Jane", "Green"), + new AuthorDTO("John", "Doe"))); + searchBean.storeNewBook(book2); + + List hits = searchBean.findByKeyword("world"); + assertEquals(1, hits.size()); + assertSearchHit(book1, hits.get(0)); + + hits = searchBean.findByKeyword("mars"); + assertEquals(1, hits.size()); + assertSearchHit(book2, hits.get(0)); + } + + private static void assertSearchHit(BookDTO expected, BookDTO hit) { + assertEquals(expected.id, hit.id); + assertEquals(expected.title, hit.title); + assertEquals(expected.authors.size(), hit.authors.size()); + for (int i = 0; i < expected.authors.size(); i++) { + AuthorDTO expectedAuthor = expected.authors.get(i); + AuthorDTO hitAuthor = hit.authors.get(i); + assertEquals(expectedAuthor.firstName, hitAuthor.firstName); + assertEquals(expectedAuthor.lastName, hitAuthor.lastName); + // We use includeDepth = 1 on BookDTO#authors, so book.authors.books should be empty + assertEquals(0, hitAuthor.books.size()); + } + } + +} diff --git a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/search/backend/elasticsearch/projectionconstructor/SearchBean.java b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/search/backend/elasticsearch/projectionconstructor/SearchBean.java new file mode 100644 index 000000000000..669cb58d6bdf --- /dev/null +++ b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/search/backend/elasticsearch/projectionconstructor/SearchBean.java @@ -0,0 +1,76 @@ +/* + * JBoss, Home of Professional Open Source. + * Copyright 2023, Red Hat, Inc., and individual contributors + * as indicated by the @author tags. See the copyright.txt file in the + * distribution for a full listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.jboss.as.test.integration.hibernate.search.backend.elasticsearch.projectionconstructor; + +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.persistence.EntityManager; +import jakarta.persistence.PersistenceContext; +import jakarta.persistence.criteria.CriteriaDelete; +import jakarta.transaction.Transactional; +import org.hibernate.search.mapper.orm.Search; + +import java.util.List; + +@ApplicationScoped +@Transactional +public class SearchBean { + + @PersistenceContext + EntityManager em; + + public void storeNewBook(BookDTO bookDTO) { + Book book = new Book(); + book.setId(bookDTO.id); + book.setTitle(bookDTO.title); + for (AuthorDTO authorDTO : bookDTO.authors) { + Author author = new Author(); + author.setFirstName(authorDTO.firstName); + author.setLastName(authorDTO.lastName); + author.getBooks().add(book); + book.getAuthors().add(author); + em.persist(author); + } + em.persist(book); + } + + public void deleteAll() { + CriteriaDelete deleteBooks = em.getCriteriaBuilder() + .createCriteriaDelete(Book.class); + deleteBooks.from(Book.class); + em.createQuery(deleteBooks).executeUpdate(); + + CriteriaDelete deleteAuthors = em.getCriteriaBuilder() + .createCriteriaDelete(Author.class); + deleteAuthors.from(Author.class); + em.createQuery(deleteAuthors).executeUpdate(); + + Search.session(em).workspace(Book.class).purge(); + } + + public List findByKeyword(String keyword) { + return Search.session(em).search(Book.class) + .select(BookDTO.class) + .where(f -> f.match().field("title").matching(keyword)) + .fetchAllHits(); + } + +} diff --git a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/search/backend/elasticsearch/util/ElasticsearchServerSetupObserver.java b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/search/backend/elasticsearch/util/ElasticsearchServerSetupObserver.java index 2489932d4acd..09cb90b3a0bf 100644 --- a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/search/backend/elasticsearch/util/ElasticsearchServerSetupObserver.java +++ b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/search/backend/elasticsearch/util/ElasticsearchServerSetupObserver.java @@ -9,7 +9,7 @@ import java.util.concurrent.atomic.AtomicReference; public class ElasticsearchServerSetupObserver { - private static final String ELASTICSEARCH_IMAGE = "docker.elastic.co/elasticsearch/elasticsearch:7.16.3"; + private static final String ELASTICSEARCH_IMAGE = "docker.elastic.co/elasticsearch/elasticsearch:8.9.0"; private static final AtomicReference httpHostAddress = new AtomicReference<>(); @@ -49,7 +49,9 @@ public ElasticsearchServerSetupObserver() { // Recent versions of ES limit themselves to 50% of the total available RAM, // but on CI this can be too much, as we also have the Maven JVM // and the JVMs that runs tests taking up a significant amount of RAM. - .withEnv("ES_JAVA_OPTS", "-Xms1g -Xmx1g"); + .withEnv("ES_JAVA_OPTS", "-Xms1g -Xmx1g") + .withEnv("xpack.security.enabled", "false") + .withEnv("cluster.routing.allocation.disk.threshold_enabled", "false"); } public void startElasticsearch(@Observes StartClassContainers event) { diff --git a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jpa/webtxem/entity/WebTxEmCompany.java b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/search/backend/lucene/projectionconstructor/Author.java similarity index 51% rename from testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jpa/webtxem/entity/WebTxEmCompany.java rename to testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/search/backend/lucene/projectionconstructor/Author.java index 3a98ae38ac74..e544ea195548 100644 --- a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jpa/webtxem/entity/WebTxEmCompany.java +++ b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/search/backend/lucene/projectionconstructor/Author.java @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2011, Red Hat, Inc., and individual contributors + * Copyright 2023, Red Hat, Inc., and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * @@ -19,63 +19,63 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ +package org.jboss.as.test.integration.hibernate.search.backend.lucene.projectionconstructor; -package org.jboss.as.test.integration.jpa.webtxem.entity; - -import jakarta.persistence.CascadeType; -import jakarta.persistence.Column; import jakarta.persistence.Entity; -import jakarta.persistence.FetchType; import jakarta.persistence.GeneratedValue; -import jakarta.persistence.GenerationType; import jakarta.persistence.Id; -import jakarta.persistence.OneToMany; +import jakarta.persistence.ManyToMany; +import org.hibernate.search.engine.backend.types.Projectable; +import org.hibernate.search.mapper.pojo.mapping.definition.annotation.FullTextField; -import java.util.HashSet; -import java.util.Set; +import java.util.ArrayList; +import java.util.List; -/** - * Company entity class - * - * @author Zbyněk Roubalík - */ @Entity -public class WebTxEmCompany { +public class Author { + @Id + @GeneratedValue private Long id; - private String name; - private Set flights = new HashSet(); - public WebTxEmCompany() { - } + @FullTextField(projectable = Projectable.YES) + private String firstName; + + @FullTextField(projectable = Projectable.YES) + private String lastName; + + @ManyToMany(mappedBy = "authors") + private List books = new ArrayList<>(); - @Id - @GeneratedValue(strategy = GenerationType.AUTO) - @Column(name = "comp_id") public Long getId() { return id; } - public String getName() { - return name; + public void setId(Long id) { + this.id = id; } - public void setId(Long newId) { - id = newId; + public String getFirstName() { + return firstName; } - public void setName(String string) { - name = string; + public void setFirstName(String firstName) { + this.firstName = firstName; } - @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "company") - @Column(name = "flight_id") - public Set getFlights() { - return flights; + public String getLastName() { + return lastName; } - public void setFlights(Set flights) { - this.flights = flights; + public void setLastName(String lastName) { + this.lastName = lastName; } + public List getBooks() { + return books; + } + + public void setBooks(List books) { + this.books = books; + } } diff --git a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/search/backend/lucene/projectionconstructor/AuthorDTO.java b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/search/backend/lucene/projectionconstructor/AuthorDTO.java new file mode 100644 index 000000000000..2712cb970d8e --- /dev/null +++ b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/search/backend/lucene/projectionconstructor/AuthorDTO.java @@ -0,0 +1,50 @@ +/* + * JBoss, Home of Professional Open Source. + * Copyright 2023, Red Hat, Inc., and individual contributors + * as indicated by the @author tags. See the copyright.txt file in the + * distribution for a full listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.jboss.as.test.integration.hibernate.search.backend.lucene.projectionconstructor; + +import org.hibernate.search.mapper.pojo.mapping.definition.annotation.FieldProjection; +import org.hibernate.search.mapper.pojo.mapping.definition.annotation.ObjectProjection; +import org.hibernate.search.mapper.pojo.mapping.definition.annotation.ProjectionConstructor; + +import java.util.Collections; +import java.util.List; + +public class AuthorDTO { + public final String firstName; + public final String lastName; + public final List books; + + public AuthorDTO(String firstName, String lastName) { + this(firstName, lastName, Collections.emptyList()); + } + + @ProjectionConstructor + public AuthorDTO(// These @FieldProjection annotations and @ObjectProjection.path wouldn't be necessary + // with a record or a class compiled with -parameters + @FieldProjection(path = "firstName") String firstName, + @FieldProjection(path = "lastName") String lastName, + @ObjectProjection(path = "books", includeDepth = 1) List books) { + this.firstName = firstName; + this.lastName = lastName; + this.books = books; + } +} diff --git a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/search/backend/lucene/projectionconstructor/Book.java b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/search/backend/lucene/projectionconstructor/Book.java new file mode 100644 index 000000000000..f4e3f3bfa53b --- /dev/null +++ b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/search/backend/lucene/projectionconstructor/Book.java @@ -0,0 +1,75 @@ +/* + * JBoss, Home of Professional Open Source. + * Copyright 2023, Red Hat, Inc., and individual contributors + * as indicated by the @author tags. See the copyright.txt file in the + * distribution for a full listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.jboss.as.test.integration.hibernate.search.backend.lucene.projectionconstructor; + +import jakarta.persistence.Entity; +import jakarta.persistence.Id; +import jakarta.persistence.ManyToMany; +import jakarta.persistence.OrderColumn; +import org.hibernate.search.engine.backend.types.ObjectStructure; +import org.hibernate.search.engine.backend.types.Projectable; +import org.hibernate.search.mapper.pojo.mapping.definition.annotation.FullTextField; +import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; +import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexedEmbedded; + +import java.util.ArrayList; +import java.util.List; + +@Entity +@Indexed +public class Book { + + @Id + private Long id; + + @FullTextField(projectable = Projectable.YES) + private String title; + + @IndexedEmbedded(includeDepth = 1, structure = ObjectStructure.NESTED) + @ManyToMany + @OrderColumn + private List authors = new ArrayList<>(); + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public List getAuthors() { + return authors; + } + + public void setAuthors(List authors) { + this.authors = authors; + } +} diff --git a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/search/backend/lucene/projectionconstructor/BookDTO.java b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/search/backend/lucene/projectionconstructor/BookDTO.java new file mode 100644 index 000000000000..f30fe6039284 --- /dev/null +++ b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/search/backend/lucene/projectionconstructor/BookDTO.java @@ -0,0 +1,46 @@ +/* + * JBoss, Home of Professional Open Source. + * Copyright 2023, Red Hat, Inc., and individual contributors + * as indicated by the @author tags. See the copyright.txt file in the + * distribution for a full listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.jboss.as.test.integration.hibernate.search.backend.lucene.projectionconstructor; + +import org.hibernate.search.mapper.pojo.mapping.definition.annotation.FieldProjection; +import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IdProjection; +import org.hibernate.search.mapper.pojo.mapping.definition.annotation.ObjectProjection; +import org.hibernate.search.mapper.pojo.mapping.definition.annotation.ProjectionConstructor; + +import java.util.List; + +public class BookDTO { + public final long id; + public final String title; + public final List authors; + + @ProjectionConstructor + public BookDTO(@IdProjection long id, + // This @FieldProjection annotations and @ObjectProjection.path wouldn't be necessary + // with a record or a class compiled with -parameters + @FieldProjection(path = "title") String title, + @ObjectProjection(path = "authors", includeDepth = 1) List authors) { + this.id = id; + this.title = title; + this.authors = authors; + } +} diff --git a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/search/backend/lucene/projectionconstructor/HibernateSearchLuceneProjectionConstructorTestCase.java b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/search/backend/lucene/projectionconstructor/HibernateSearchLuceneProjectionConstructorTestCase.java new file mode 100644 index 000000000000..105084ba8e7e --- /dev/null +++ b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/search/backend/lucene/projectionconstructor/HibernateSearchLuceneProjectionConstructorTestCase.java @@ -0,0 +1,118 @@ +/* + * JBoss, Home of Professional Open Source. + * Copyright 2023, Red Hat, Inc., and individual contributors + * as indicated by the @author tags. See the copyright.txt file in the + * distribution for a full listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.jboss.as.test.integration.hibernate.search.backend.lucene.projectionconstructor; + +import jakarta.inject.Inject; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.junit.Arquillian; +import org.jboss.as.test.shared.util.AssumeTestGroupUtil; +import org.jboss.shrinkwrap.api.Archive; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.junit.After; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; + +import java.util.Arrays; +import java.util.List; + +import static org.junit.Assert.assertEquals; + +/** + * Verify deployed applications can use Hibernate Search's @ProjectionConstructor with Lucene. + */ +@RunWith(Arquillian.class) +public class HibernateSearchLuceneProjectionConstructorTestCase { + + private static final String NAME = HibernateSearchLuceneProjectionConstructorTestCase.class.getSimpleName(); + private static final String JAR_ARCHIVE_NAME = NAME + ".jar"; + + @BeforeClass + public static void securityManagerNotSupportedInHibernateSearch() { + AssumeTestGroupUtil.assumeSecurityManagerDisabled(); + } + + @Inject + private SearchBean searchBean; + + @Before + @After + public void cleanupDatabase() { + searchBean.deleteAll(); + } + + @Test + public void testProjection() { + BookDTO book1 = new BookDTO(1, "Hello world", + Arrays.asList(new AuthorDTO("John", "Smith"))); + searchBean.storeNewBook(book1); + BookDTO book2 = new BookDTO(2, "Hello planet Mars", + Arrays.asList(new AuthorDTO("Jane", "Green"), + new AuthorDTO("John", "Doe"))); + searchBean.storeNewBook(book2); + + List hits = searchBean.findByKeyword("world"); + assertEquals(1, hits.size()); + assertSearchHit(book1, hits.get(0)); + + hits = searchBean.findByKeyword("mars"); + assertEquals(1, hits.size()); + assertSearchHit(book2, hits.get(0)); + } + + private static void assertSearchHit(BookDTO expected, BookDTO hit) { + assertEquals(expected.id, hit.id); + assertEquals(expected.title, hit.title); + assertEquals(expected.authors.size(), hit.authors.size()); + for (int i = 0; i < expected.authors.size(); i++) { + AuthorDTO expectedAuthor = expected.authors.get(i); + AuthorDTO hitAuthor = hit.authors.get(i); + assertEquals(expectedAuthor.firstName, hitAuthor.firstName); + assertEquals(expectedAuthor.lastName, hitAuthor.lastName); + // We use includeDepth = 1 on BookDTO#authors, so book.authors.books should be empty + assertEquals(0, hitAuthor.books.size()); + } + } + + @Deployment + public static Archive deploy() throws Exception { + + // TODO maybe just use managed=false and deploy in the @BeforeClass / undeploy in an @AfterClass + // see HibernateSearchLuceneSimpleTestCase + if (AssumeTestGroupUtil.isSecurityManagerEnabled()) { + return AssumeTestGroupUtil.emptyJar(JAR_ARCHIVE_NAME); + } + + JavaArchive jar = ShrinkWrap.create(JavaArchive.class, JAR_ARCHIVE_NAME); + // add Jakarta Persistence configuration + jar.addAsManifestResource(HibernateSearchLuceneProjectionConstructorTestCase.class.getPackage(), + "persistence.xml", "persistence.xml"); + // add testing Bean and entities + jar.addClasses(SearchBean.class, Book.class, Author.class, BookDTO.class, AuthorDTO.class, + HibernateSearchLuceneProjectionConstructorTestCase.class); + + return jar; + } + +} diff --git a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/search/backend/lucene/projectionconstructor/SearchBean.java b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/search/backend/lucene/projectionconstructor/SearchBean.java new file mode 100644 index 000000000000..1bcdf8d9ea0d --- /dev/null +++ b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/search/backend/lucene/projectionconstructor/SearchBean.java @@ -0,0 +1,76 @@ +/* + * JBoss, Home of Professional Open Source. + * Copyright 2023, Red Hat, Inc., and individual contributors + * as indicated by the @author tags. See the copyright.txt file in the + * distribution for a full listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.jboss.as.test.integration.hibernate.search.backend.lucene.projectionconstructor; + +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.persistence.EntityManager; +import jakarta.persistence.PersistenceContext; +import jakarta.persistence.criteria.CriteriaDelete; +import jakarta.transaction.Transactional; +import org.hibernate.search.mapper.orm.Search; + +import java.util.List; + +@ApplicationScoped +@Transactional +public class SearchBean { + + @PersistenceContext + EntityManager em; + + public void storeNewBook(BookDTO bookDTO) { + Book book = new Book(); + book.setId(bookDTO.id); + book.setTitle(bookDTO.title); + for (AuthorDTO authorDTO : bookDTO.authors) { + Author author = new Author(); + author.setFirstName(authorDTO.firstName); + author.setLastName(authorDTO.lastName); + author.getBooks().add(book); + book.getAuthors().add(author); + em.persist(author); + } + em.persist(book); + } + + public void deleteAll() { + CriteriaDelete deleteBooks = em.getCriteriaBuilder() + .createCriteriaDelete(Book.class); + deleteBooks.from(Book.class); + em.createQuery(deleteBooks).executeUpdate(); + + CriteriaDelete deleteAuthors = em.getCriteriaBuilder() + .createCriteriaDelete(Author.class); + deleteAuthors.from(Author.class); + em.createQuery(deleteAuthors).executeUpdate(); + + Search.session(em).workspace(Book.class).purge(); + } + + public List findByKeyword(String keyword) { + return Search.session(em).search(Book.class) + .select(BookDTO.class) + .where(f -> f.match().field("title").matching(keyword)) + .fetchAllHits(); + } + +} diff --git a/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/com/amazon/aws/kms/main/module.xml b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/search/backend/lucene/projectionconstructor/persistence.xml similarity index 56% rename from ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/com/amazon/aws/kms/main/module.xml rename to testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/search/backend/lucene/projectionconstructor/persistence.xml index 7f9332d9dc16..e71e3f58fdee 100644 --- a/ee-feature-pack/galleon-shared/src/main/resources/modules/system/layers/base/com/amazon/aws/kms/main/module.xml +++ b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/search/backend/lucene/projectionconstructor/persistence.xml @@ -1,8 +1,7 @@ - - - - - - - - - - - - - - - - - - - + + + java:jboss/datasources/ExampleDS + + + + + + + + + diff --git a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/secondlevelcache/HibernateSecondLevelCacheTestCase.java b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/secondlevelcache/HibernateSecondLevelCacheTestCase.java index 8ee3fbd97c14..579012585b73 100644 --- a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/secondlevelcache/HibernateSecondLevelCacheTestCase.java +++ b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/secondlevelcache/HibernateSecondLevelCacheTestCase.java @@ -24,7 +24,6 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; -import static org.junit.Assume.assumeTrue; import java.sql.Connection; import javax.naming.InitialContext; @@ -85,8 +84,6 @@ public class HibernateSecondLevelCacheTestCase { public static void beforeClass() throws NamingException { // TODO This can be re-looked at once HHH-13188 is resolved. This may require further changes in Hibernate. AssumeTestGroupUtil.assumeSecurityManagerDisabled(); - // This test needs to be recompiled against Hibernate ORM 6 (WFLY-16178) in order to pass. - assumeTrue(System.getProperty("ts.ee9") == null && System.getProperty("ts.bootable.ee9") == null); iniCtx = new InitialContext(); } diff --git a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/metrics/data-sources/basic-attributes.xml b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/metrics/data-sources/basic-attributes.xml index d00d066a957e..a209f6496089 100644 --- a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/metrics/data-sources/basic-attributes.xml +++ b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/metrics/data-sources/basic-attributes.xml @@ -1,4 +1,4 @@ - + diff --git a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/metrics/data-sources/complex-driver.xml b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/metrics/data-sources/complex-driver.xml index 476ec7b689d0..cd9b83227c2b 100644 --- a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/metrics/data-sources/complex-driver.xml +++ b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/metrics/data-sources/complex-driver.xml @@ -1,4 +1,4 @@ - + diff --git a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/metrics/data-sources/empty-driver.xml b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/metrics/data-sources/empty-driver.xml index 343d0c77c488..eb335795ccfd 100644 --- a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/metrics/data-sources/empty-driver.xml +++ b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/metrics/data-sources/empty-driver.xml @@ -1,4 +1,4 @@ - + diff --git a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/metrics/data-sources/statement-properties.xml b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/metrics/data-sources/statement-properties.xml index 53d235a6130f..d9177a892f1b 100644 --- a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/metrics/data-sources/statement-properties.xml +++ b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/metrics/data-sources/statement-properties.xml @@ -1,4 +1,4 @@ - + diff --git a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/metrics/data-sources/timeout-properties.xml b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/metrics/data-sources/timeout-properties.xml index 4ed91a4038bb..560aa0a9895c 100644 --- a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/metrics/data-sources/timeout-properties.xml +++ b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/metrics/data-sources/timeout-properties.xml @@ -1,4 +1,4 @@ - + diff --git a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/metrics/data-sources/validation-properties.xml b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/metrics/data-sources/validation-properties.xml index f3304784a7b1..18b6f467a581 100644 --- a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/metrics/data-sources/validation-properties.xml +++ b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/metrics/data-sources/validation-properties.xml @@ -1,4 +1,4 @@ - + diff --git a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/moduledeployment/basic.xml b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/moduledeployment/basic.xml index 6c0def2046f9..141baf237d21 100644 --- a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/moduledeployment/basic.xml +++ b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/moduledeployment/basic.xml @@ -1,4 +1,4 @@ - + diff --git a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/moduledeployment/double.xml b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/moduledeployment/double.xml index 0afebd041903..6f23de9e0bb5 100644 --- a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/moduledeployment/double.xml +++ b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/moduledeployment/double.xml @@ -1,4 +1,4 @@ - + overRA diff --git a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/moduledeployment/inflow.xml b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/moduledeployment/inflow.xml index 220d147b3bf4..1fa7db281d41 100644 --- a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/moduledeployment/inflow.xml +++ b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/moduledeployment/inflow.xml @@ -1,4 +1,4 @@ - + diff --git a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/moduledeployment/mod-2.xml b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/moduledeployment/mod-2.xml index b30a6e9c58bb..9a08fe742261 100644 --- a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/moduledeployment/mod-2.xml +++ b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/moduledeployment/mod-2.xml @@ -1,4 +1,4 @@ - + diff --git a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/moduledeployment/multi.xml b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/moduledeployment/multi.xml index eeea1e1bdc73..421a67dc7f82 100644 --- a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/moduledeployment/multi.xml +++ b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/moduledeployment/multi.xml @@ -1,4 +1,4 @@ - + diff --git a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/moduledeployment/pure.xml b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/moduledeployment/pure.xml index ea6de3fcfff9..d73965551305 100644 --- a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/moduledeployment/pure.xml +++ b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/moduledeployment/pure.xml @@ -1,4 +1,4 @@ - + diff --git a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/moduledeployment/second.xml b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/moduledeployment/second.xml index 24528cd1e8cd..93927c6cf92c 100644 --- a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/moduledeployment/second.xml +++ b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/moduledeployment/second.xml @@ -1,4 +1,4 @@ - + diff --git a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jpa/hibernate/entitytest/EntityTestCase.java b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jpa/hibernate/entitytest/EntityTestCase.java index 253001bcb2b9..f1bbbe94184d 100644 --- a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jpa/hibernate/entitytest/EntityTestCase.java +++ b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jpa/hibernate/entitytest/EntityTestCase.java @@ -25,7 +25,6 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; -import static org.junit.Assume.assumeTrue; import java.util.Set; import javax.naming.InitialContext; @@ -43,7 +42,6 @@ import org.jboss.shrinkwrap.api.Archive; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.JavaArchive; -import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; @@ -72,13 +70,6 @@ protected T rawLookup(String name, Class interfaceType) throws NamingExce return interfaceType.cast(iniCtx.lookup(name)); } - // This test needs to be recompiled against Hibernate ORM 6 (WFLY-16178) in order to pass. - @BeforeClass - public static void beforeClass() { - - assumeTrue(System.getProperty("ts.ee9") == null && System.getProperty("ts.bootable.ee9") == null); - } - @Deployment public static Archive deploy() { diff --git a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jpa/hibernate/sessionfactorytest/SessionFactoryTestCase.java b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jpa/hibernate/sessionfactorytest/SessionFactoryTestCase.java index 8485f84aac77..a13dad283566 100644 --- a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jpa/hibernate/sessionfactorytest/SessionFactoryTestCase.java +++ b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jpa/hibernate/sessionfactorytest/SessionFactoryTestCase.java @@ -24,7 +24,6 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; -import static org.junit.Assume.assumeTrue; import javax.naming.InitialContext; import javax.naming.NamingException; @@ -41,7 +40,6 @@ import org.jboss.shrinkwrap.api.Archive; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.JavaArchive; -import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; @@ -55,13 +53,6 @@ public class SessionFactoryTestCase { private static final String ARCHIVE_NAME = "jpa_sessionfactory"; - // This test needs to be recompiled against Hibernate ORM 6 (WFLY-16178) in order to pass. - @BeforeClass - public static void beforeClass() { - - assumeTrue(System.getProperty("ts.ee9") == null && System.getProperty("ts.bootable.ee9") == null); - } - @Deployment public static Archive deploy() { diff --git a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jpa/webtxem/TestServlet.java b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jpa/webtxem/TestServlet.java index eaf51ad80afa..81141a059a24 100644 --- a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jpa/webtxem/TestServlet.java +++ b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jpa/webtxem/TestServlet.java @@ -35,10 +35,10 @@ import jakarta.transaction.Status; import jakarta.transaction.UserTransaction; -import org.jboss.as.test.integration.jpa.webtxem.entity.WebTxEmFlight; +import org.jboss.as.test.integration.jpa.hibernate.entity.Flight; /** - * Test servlet used by {@link WebJPATestCase}. Entity {@link WebTxEmFlight} is read or written, type of operation depends on + * Test servlet used by {@link WebJPATestCase}. Entity {@link Flight} is read or written, type of operation depends on * parameter: mode=write or mode=read. * * @author Zbyněk Roubalík @@ -64,14 +64,14 @@ protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws Se String mode = req.getParameter("mode"); if (mode.equals("write")) { - WebTxEmFlight f = new WebTxEmFlight(); + Flight f = new Flight(); f.setId(new Long(1)); f.setName("Flight number one"); em.merge(f); } else if (mode.equals("read")) { - WebTxEmFlight f = em.find(WebTxEmFlight.class, Long.valueOf(1)); + Flight f = em.find(Flight.class, Long.valueOf(1)); resp.setContentType("text/plain"); PrintWriter out = resp.getWriter(); out.print(f.getName()); diff --git a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jpa/webtxem/WebJPATestCase.java b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jpa/webtxem/WebJPATestCase.java index a4d9c16e2cc3..5400743ba4b2 100644 --- a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jpa/webtxem/WebJPATestCase.java +++ b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jpa/webtxem/WebJPATestCase.java @@ -32,10 +32,10 @@ import org.jboss.arquillian.junit.Arquillian; import org.jboss.arquillian.test.api.ArquillianResource; import org.jboss.as.test.integration.common.HttpRequest; -import org.jboss.as.test.integration.jpa.webtxem.entity.WebTxEmCompany; -import org.jboss.as.test.integration.jpa.webtxem.entity.WebTxEmCustomer; -import org.jboss.as.test.integration.jpa.webtxem.entity.WebTxEmFlight; -import org.jboss.as.test.integration.jpa.webtxem.entity.WebTxEmTicket; +import org.jboss.as.test.integration.jpa.hibernate.entity.Company; +import org.jboss.as.test.integration.jpa.hibernate.entity.Customer; +import org.jboss.as.test.integration.jpa.hibernate.entity.Flight; +import org.jboss.as.test.integration.jpa.hibernate.entity.Ticket; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.WebArchive; import org.junit.Test; @@ -61,8 +61,8 @@ public class WebJPATestCase { public static WebArchive deployment() { WebArchive war = ShrinkWrap.create(WebArchive.class, ARCHIVE_NAME + ".war"); war.addClasses(WebJPATestCase.class, TestServlet.class, - HttpRequest.class, WebTxEmFlight.class, WebTxEmCompany.class, WebTxEmCustomer.class, - WebTxEmTicket.class); + HttpRequest.class, Flight.class, Company.class, Customer.class, + Ticket.class); // WEB-INF/classes/ is implied war.addAsResource(WebJPATestCase.class.getPackage(), "persistence.xml", "META-INF/persistence.xml"); return war; diff --git a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jpa/webtxem/entity/WebTxEmCustomer.java b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jpa/webtxem/entity/WebTxEmCustomer.java deleted file mode 100644 index 21409933392b..000000000000 --- a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jpa/webtxem/entity/WebTxEmCustomer.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2011, Red Hat, Inc., and individual contributors - * as indicated by the @author tags. See the copyright.txt file in the - * distribution for a full listing of individual contributors. - * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ - -package org.jboss.as.test.integration.jpa.webtxem.entity; - -import jakarta.persistence.CascadeType; -import jakarta.persistence.Entity; -import jakarta.persistence.FetchType; -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.GenerationType; -import jakarta.persistence.Id; -import jakarta.persistence.ManyToMany; -import jakarta.persistence.NamedQueries; -import jakarta.persistence.NamedQuery; -import jakarta.persistence.OneToMany; - -import java.util.Set; - -/** - * Customer entity class - * - * @author Zbyněk Roubalík - */ -@Entity -@NamedQueries( - {@NamedQuery(name = "allCustomers", query = "select c from WebTxEmCustomer c"), - @NamedQuery(name = "customerById", query = "select c from WebTxEmCustomer c where c.id=:id")}) -public class WebTxEmCustomer { - - private Long id; - private String name; - private String address; - private Set tickets; - private Set flights; - - // Address address; - - public WebTxEmCustomer() { - } - - @Id - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getAddress() { - return address; - } - - public void setAddress(String address) { - this.address = address; - } - - @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "customer") - public Set getTickets() { - return tickets; - } - - public void setTickets(Set tickets) { - this.tickets = tickets; - } - - @ManyToMany(cascade = {CascadeType.PERSIST, CascadeType.MERGE}, fetch = FetchType.EAGER, mappedBy = "customers") - public Set getFlights() { - return flights; - } - - public void setFlights(Set flights) { - this.flights = flights; - } - - -} diff --git a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jpa/webtxem/entity/WebTxEmFlight.java b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jpa/webtxem/entity/WebTxEmFlight.java deleted file mode 100644 index 38dd872dc1e4..000000000000 --- a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jpa/webtxem/entity/WebTxEmFlight.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2011, Red Hat, Inc., and individual contributors - * as indicated by the @author tags. See the copyright.txt file in the - * distribution for a full listing of individual contributors. - * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ - -package org.jboss.as.test.integration.jpa.webtxem.entity; - -import jakarta.persistence.CascadeType; -import jakarta.persistence.Column; -import jakarta.persistence.Entity; -import jakarta.persistence.FetchType; -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.GenerationType; -import jakarta.persistence.Id; -import jakarta.persistence.JoinColumn; -import jakarta.persistence.ManyToMany; -import jakarta.persistence.ManyToOne; - -import java.util.Set; - -/** - * Flight entity class - * - * @author Zbyněk Roubalík - */ -@Entity -public class WebTxEmFlight { - - private Long id; - private String name; - private WebTxEmCompany company; - private Set customers; - - public WebTxEmFlight() { - } - - @Id - @Column(name = "flight_id") - @GeneratedValue(strategy = GenerationType.IDENTITY) - public Long getId() { - return id; - } - - public void setId(Long long1) { - id = long1; - } - - @Column(updatable = false, name = "flight_name", nullable = false, length = 50) - public String getName() { - return name; - } - - public void setName(String string) { - name = string; - } - - - @ManyToOne(cascade = {CascadeType.ALL}) - @JoinColumn(name = "comp_id") - public WebTxEmCompany getCompany() { - return company; - } - - public void setCompany(WebTxEmCompany company) { - this.company = company; - } - - @ManyToMany(cascade = {CascadeType.PERSIST, CascadeType.MERGE}, fetch = FetchType.EAGER) - public Set getCustomers() { - return customers; - } - - public void setCustomers(Set customers) { - this.customers = customers; - } - -} diff --git a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jsf/flash/getvar.xhtml b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jsf/flash/getvar.xhtml index e8adb5a57d47..02fd76e16d5a 100644 --- a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jsf/flash/getvar.xhtml +++ b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jsf/flash/getvar.xhtml @@ -7,9 +7,6 @@ - - - Flash Variable: #{flash.get("var")} diff --git a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jsf/version/JSFDeploymentProcessorTestCase.java b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jsf/version/JSFDeploymentProcessorTestCase.java index 85e1651e03b1..b57ee390c2af 100644 --- a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jsf/version/JSFDeploymentProcessorTestCase.java +++ b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jsf/version/JSFDeploymentProcessorTestCase.java @@ -29,7 +29,6 @@ import java.util.Arrays; import java.util.Collection; import java.util.PropertyPermission; - import jakarta.faces.context.FacesContext; import org.apache.http.client.methods.CloseableHttpResponse; @@ -53,7 +52,6 @@ import org.jboss.as.test.integration.jsf.version.war.JSFMyFaces; import org.jboss.as.test.integration.jsf.version.war.JSFVersion; import org.jboss.as.test.shared.TestLogHandlerSetupTask; -import org.jboss.as.test.shared.util.AssumeTestGroupUtil; import org.jboss.as.test.shared.util.LoggingUtil; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; @@ -63,12 +61,9 @@ import org.jboss.shrinkwrap.resolver.api.maven.PomEquippedResolveStage; import org.junit.Assert; import org.junit.Assume; -import org.junit.BeforeClass; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; - /** * Tests different ways to add Jakarta Server Faces implementation in ear files * @@ -77,7 +72,6 @@ @RunWith(Arquillian.class) @ServerSetup({JSFDeploymentProcessorTestCase.TestLogHandlerSetup.class}) @RunAsClient -@Ignore("WFLY-16528") public class JSFDeploymentProcessorTestCase { private static final String WEB_BUNDLED_JSF = "bundled-jsf"; @@ -99,12 +93,6 @@ public class JSFDeploymentProcessorTestCase { @OperateOnDeployment(WEB_FACES_CONFIG_XML) private URL facesConfigXml; - @BeforeClass - public static void beforeClass() { - // https://issues.redhat.com/browse/WFLY-15367 - AssumeTestGroupUtil.assumeSecurityManagerDisabledOrAssumeJDKVersionBefore(11); - } - /** * Creates a war with all the libraries needed in the war/lib folder, this sample does not call the * ejb as it is not necessary to test if the bundled Jakarta Server Faces is loaded diff --git a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/management/api/ClientCompatibilityUnitTestCase.java b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/management/api/ClientCompatibilityUnitTestCase.java index ffa184e99760..f76b48c3b515 100644 --- a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/management/api/ClientCompatibilityUnitTestCase.java +++ b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/management/api/ClientCompatibilityUnitTestCase.java @@ -53,7 +53,6 @@ import org.jboss.shrinkwrap.api.spec.JavaArchive; import org.jboss.shrinkwrap.api.spec.WebArchive; import org.junit.Assert; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; @@ -114,9 +113,7 @@ public static Archive fakeDeployment() { private static final String CONTROLLER_ADDRESS = System.getProperty("node0", "localhost"); - private static final String WF_CLIENT = "org.wildfly:wildfly-controller-client"; private static final String WFCORE_CLIENT = "org.wildfly.core:wildfly-controller-client"; - private static final String AS7_CLIENT = "org.jboss.as:jboss-as-controller-client"; private static final String[] excludes = new String[]{"org.jboss.threads:jboss-threads", "org.jboss:jboss-dmr", "org.jboss.logging:jboss-logging"}; private static final Archive deployment; @@ -132,109 +129,124 @@ public static Archive fakeDeployment() { deployment = archive; } + @Test + public void testCore101Final() throws Exception { + testWF("1.0.1.Final", 9999); + } @Test - public void test711Final() throws Exception { - testAS7("7.1.1.Final"); + public void testCore101FinalHttp() throws Exception { + testWF("1.0.1.Final", 9990); } @Test - public void test720Final() throws Exception { - testAS7("7.2.0.Final"); + public void testCore210Final() throws Exception { + testWF("2.1.0.Final", 9999); } @Test - public void test800Final() throws Exception { - test(createClient(WF_CLIENT, "8.0.0.Final", CONTROLLER_ADDRESS, 9999)); + public void testCore210FinalHttp() throws Exception { + testWF("2.1.0.Final", 9990); } - @Ignore("http upgrade compat issue") @Test - public void test800FinalHttp() throws Exception { - test(createClient(WF_CLIENT, "8.0.0.Final", CONTROLLER_ADDRESS, 9990)); + public void testCore221Final() throws Exception { + testWF("2.2.1.Final", 9999); } @Test - public void test810Final() throws Exception { - test(createClient(WF_CLIENT, "8.1.0.Final", CONTROLLER_ADDRESS, 9999)); + public void testCore221FinalHttp() throws Exception { + testWF("2.2.1.Final", 9990); } - @Ignore("http upgrade compat issue") @Test - public void test810FinalHttp() throws Exception { - test(createClient(WF_CLIENT, "8.1.0.Final", CONTROLLER_ADDRESS, 9990)); + public void testCore3010Final() throws Exception { + testWF("3.0.10.Final", 9999); } @Test - public void test820Final() throws Exception { - test(createClient(WF_CLIENT, "8.2.0.Final", CONTROLLER_ADDRESS, 9999)); + public void testCore3010FinalHttp() throws Exception { + testWF("3.0.10.Final", 9990); } - @Ignore("http upgrade compat issue") + // https://issues.redhat.com/browse/WFLY-18171 + // Test WF Core versions that went into WildFly 23 and later (latest micro for each major/minor release) + // Tests WF Core 15.0.1.Final for WildFly 23.0.2.Final. @Test - public void test820FinalHttp() throws Exception { - test(createClient(WF_CLIENT, "8.2.0.Final", CONTROLLER_ADDRESS, 9990)); + public void testCore1501Final() throws Exception { + testWF("15.0.1.Final", 9999); } @Test - public void test821Final() throws Exception { - test(createClient(WF_CLIENT, "8.2.1.Final", CONTROLLER_ADDRESS, 9999)); + public void testCore1501FinalHttp() throws Exception { + testWF("15.0.1.Final", 9990); } - @Ignore("http upgrade compat issue") + // Tests WF Core 16.0.1.Final for WildFly 24.0.1.Final. WildFly 24 was the last release that supported Picketbox @Test - public void test821FinalHttp() throws Exception { - test(createClient(WF_CLIENT, "8.2.1.Final", CONTROLLER_ADDRESS, 9990)); + public void testCore1601Final() throws Exception { + testWF("16.0.1.Final", 9999); } @Test - public void testCore100Final() throws Exception { - testWF("1.0.0.Final", 9999); + public void testCore1601FinalHttp() throws Exception { + testWF("16.0.1.Final", 9990); } + // Tests WF Core 17.0.3.Final for WildFly 25.0.1.Final @Test - public void testCore100FinalHttp() throws Exception { - testWF("1.0.0.Final", 9990); + public void testCore1703Final() throws Exception { + testWF("17.0.3.Final", 9999); } @Test - public void testCore101Final() throws Exception { - testWF("1.0.1.Final", 9999); + public void testCore1703FinalHttp() throws Exception { + testWF("17.0.3.Final", 9990); } + // WildFly 26.0 is skipped as it was soon followed up by WildFly 26.1 + // Tests WF Core 18.1.2.Final for WildFly 26.1.3.Final. @Test - public void testCore101FinalHttp() throws Exception { - testWF("1.0.1.Final", 9990); + public void testCore1812Final() throws Exception { + testWF("18.1.2.Final", 9999); } @Test - public void testCore210Final() throws Exception { - testWF("2.1.0.Final", 9999); + public void testCore1812FinalHttp() throws Exception { + testWF("18.1.2.Final", 9990); } + // Tests WF Core 19.0.1.Final for WildFly 27.0.1.Final @Test - public void testCore210FinalHttp() throws Exception { - testWF("2.1.0.Final", 9990); + public void testCore1901Final() throws Exception { + testWF("19.0.1.Final", 9999); } @Test - public void testCore221Final() throws Exception { - testWF("2.2.1.Final", 9999); + public void testCore1901FinalHttp() throws Exception { + testWF("19.0.1.Final", 9990); } + // Tests WF Core 20.0.2.Final for WildFly 28.0.1.Final @Test - public void testCore221FinalHttp() throws Exception { - testWF("2.2.1.Final", 9990); + public void testCore2002Final() throws Exception { + testWF("20.0.2.Final", 9999); } @Test - public void testCore3010Final() throws Exception { - testWF("3.0.10.Final", 9999); + public void testCore2002FinalHttp() throws Exception { + testWF("20.0.2.Final", 9990); } + // Tests WF Core 21.1.0.Final for WildFly 29.0.0.Final @Test - public void testCore3010FinalHttp() throws Exception { - testWF("3.0.10.Final", 9990); + public void testCore2110Final() throws Exception { + testWF("21.1.0.Final", 9999); + } + + @Test + public void testCore2110FinalHttp() throws Exception { + testWF("21.1.0.Final", 9990); } @Test @@ -247,12 +259,8 @@ public void testCurrentHttp() throws Exception { test(ModelControllerClient.Factory.create(CONTROLLER_ADDRESS, 9990)); } - private void testAS7(final String version) throws Exception { - test(createClient(AS7_CLIENT, version, CONTROLLER_ADDRESS, 9999)); - } - private void testWF(final String version, int port) throws Exception { - test(createClient(WFCORE_CLIENT, version, CONTROLLER_ADDRESS, port)); + test(createClient(version, port)); } private void test(final ModelControllerClient client) throws Exception { @@ -297,10 +305,10 @@ private void test(final ModelControllerClient client) throws Exception { } } - protected static ModelControllerClient createClient(final String artifact, final String version, final String host, final int port) throws Exception { + protected static ModelControllerClient createClient(final String version, final int port) throws Exception { final ChildFirstClassLoaderBuilder classLoaderBuilder = new ChildFirstClassLoaderBuilder(false); - classLoaderBuilder.addRecursiveMavenResourceURL(artifact + ":" + version, excludes); + classLoaderBuilder.addRecursiveMavenResourceURL(WFCORE_CLIENT + ":" + version, excludes); classLoaderBuilder.addParentFirstClassPattern("org.jboss.as.controller.client.ModelControllerClient"); classLoaderBuilder.addParentFirstClassPattern("org.jboss.as.controller.client.OperationMessageHandler"); classLoaderBuilder.addParentFirstClassPattern("org.jboss.as.controller.client.Operation"); @@ -310,7 +318,7 @@ protected static ModelControllerClient createClient(final String artifact, final final Class factoryClass = classLoader.loadClass("org.jboss.as.controller.client.ModelControllerClient$Factory"); final Method factory = factoryClass.getMethod("create", String.class, int.class); try { - final Object client = factory.invoke(null, host, port); + final Object client = factory.invoke(null, CONTROLLER_ADDRESS, port); final InvocationHandler invocationHandler = new InvocationHandler() { @Override diff --git a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/messaging/mgmt/ConnectionFactoryClientMappingTestCase.java b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/messaging/mgmt/ConnectionFactoryClientMappingTestCase.java index f77537f37abf..9ef53a52945f 100644 --- a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/messaging/mgmt/ConnectionFactoryClientMappingTestCase.java +++ b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/messaging/mgmt/ConnectionFactoryClientMappingTestCase.java @@ -25,7 +25,6 @@ import org.jboss.as.controller.client.helpers.ClientConstants; import org.jboss.as.test.integration.common.jms.JMSOperations; import org.jboss.as.test.integration.common.jms.JMSOperationsProvider; -import org.jboss.as.test.shared.ServerReload; import org.jboss.as.test.shared.SnapshotRestoreSetupTask; import org.jboss.dmr.ModelNode; import org.jboss.logging.Logger; @@ -73,8 +72,6 @@ public void doSetup(org.jboss.as.arquillian.container.ManagementClient managemen ModelNode attr = new ModelNode(); attr.get("connectors").add("http-test-connector"); ops.addJmsConnectionFactory("TestConnectionFactory", CONNECTION_FACTORY_JNDI_NAME, attr); - - ServerReload.executeReloadAndWaitForCompletion(managementClient); } private ModelNode clientMapping(String destAddr, String destPort) { diff --git a/testsuite/integration/basic/src/test/java/org/wildfly/test/integration/health/HealthHTTPEndpointTestCase.java b/testsuite/integration/basic/src/test/java/org/wildfly/test/integration/health/HealthHTTPEndpointTestCase.java index 820297d77e99..bef73e6ca507 100644 --- a/testsuite/integration/basic/src/test/java/org/wildfly/test/integration/health/HealthHTTPEndpointTestCase.java +++ b/testsuite/integration/basic/src/test/java/org/wildfly/test/integration/health/HealthHTTPEndpointTestCase.java @@ -35,6 +35,8 @@ import org.jboss.arquillian.junit.Arquillian; import org.jboss.as.arquillian.api.ContainerResource; import org.jboss.as.arquillian.container.ManagementClient; +import org.jboss.as.controller.client.helpers.Operations; +import org.jboss.dmr.ModelNode; import org.junit.Test; import org.junit.runner.RunWith; @@ -50,26 +52,60 @@ public class HealthHTTPEndpointTestCase { @Test public void testHealthEndpoint() throws Exception { - testHealthEndpoint("/health"); + testHealthEndpoint("/health", 200); } @Test public void testHealthLiveEndpoint() throws Exception { - testHealthEndpoint("/health/live"); + testHealthEndpoint("/health/live", 200); } @Test public void testHealthReadyEndpoint() throws Exception { - testHealthEndpoint("/health/ready"); + testHealthEndpoint("/health/ready", 200); } - private void testHealthEndpoint(String requestPath) throws IOException { + /** + * Test that when a server is suspended, its readiness probe starts to fail (until it is resumed). + * Test also that suspending a server has no impact on its liveness probe. + * @throws Exception + */ + @Test + public void testHealthReadyEndpointWhenServerIsSuspended() throws Exception { + // server is live + testHealthEndpoint("/health/live", 200); + // and ready + testHealthEndpoint("/health/ready", 200); + + // suspend the server + changeSuspendState("suspend"); + + // server is still live + testHealthEndpoint("/health/live", 200); + // but no longer ready + testHealthEndpoint("/health/ready", 503); + + // resume the server + changeSuspendState("resume"); + + // server is still live + testHealthEndpoint("/health/live", 200); + // and ready again + testHealthEndpoint("/health/ready", 200); + } + + private void testHealthEndpoint(String requestPath, int expectedStatusCode) throws IOException { final String healthURL = "http://" + managementClient.getMgmtAddress() + ":" + managementClient.getMgmtPort() + requestPath; try (CloseableHttpClient client = HttpClientBuilder.create().build()) { CloseableHttpResponse resp = client.execute(new HttpGet(healthURL)); String content = EntityUtils.toString(resp.getEntity()); - assertEquals(200, resp.getStatusLine().getStatusCode()); + assertEquals(expectedStatusCode, resp.getStatusLine().getStatusCode()); resp.close(); } } + + private void changeSuspendState(String operation) throws IOException { + final ModelNode op = Operations.createOperation(operation, new ModelNode().add("")); + managementClient.getControllerClient().execute(op); + } } diff --git a/testsuite/integration/basic/src/test/resources/arquillian.xml b/testsuite/integration/basic/src/test/resources/arquillian.xml index 3181fba1745e..9c44e4c5a482 100644 --- a/testsuite/integration/basic/src/test/resources/arquillian.xml +++ b/testsuite/integration/basic/src/test/resources/arquillian.xml @@ -19,6 +19,7 @@ ${as.debug.port:8787} ${as.managementPort:9990} 8 + ${container.java.home} diff --git a/testsuite/integration/clustering/pom.xml b/testsuite/integration/clustering/pom.xml index 9715821cfa4e..d24c2e06d747 100644 --- a/testsuite/integration/clustering/pom.xml +++ b/testsuite/integration/clustering/pom.xml @@ -32,7 +32,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-ts-integ-clustering @@ -2795,10 +2795,10 @@ - bootablejar.ee9.profile + bootablejar.preview.profile - DISABLED.ts.bootable.ee9 + DISABLED.ts.bootable.preview @@ -2947,12 +2947,12 @@ - + - ee9.profile + preview.profile - DISABLED.ts.ee9 + DISABLED.ts.preview diff --git a/testsuite/integration/clustering/src/test/java/org/jboss/as/test/clustering/cluster/ejb/timer/remote/HotRodPersistentTimerServiceTestCase.java b/testsuite/integration/clustering/src/test/java/org/jboss/as/test/clustering/cluster/ejb/timer/remote/HotRodPersistentTimerServiceTestCase.java index 0353a7e9c461..15c6257b0db1 100644 --- a/testsuite/integration/clustering/src/test/java/org/jboss/as/test/clustering/cluster/ejb/timer/remote/HotRodPersistentTimerServiceTestCase.java +++ b/testsuite/integration/clustering/src/test/java/org/jboss/as/test/clustering/cluster/ejb/timer/remote/HotRodPersistentTimerServiceTestCase.java @@ -28,10 +28,8 @@ import org.jboss.arquillian.container.test.api.TargetsContainer; import org.jboss.as.arquillian.api.ServerSetup; import org.jboss.as.test.clustering.cluster.ejb.timer.AbstractTimerServiceTestCase; -import org.jboss.as.test.shared.IntermittentFailure; import org.jboss.as.test.shared.ManagementServerSetupTask; import org.jboss.shrinkwrap.api.Archive; -import org.junit.BeforeClass; import org.junit.ClassRule; import org.junit.rules.TestRule; @@ -41,11 +39,6 @@ @ServerSetup({ InfinispanServerSetupTask.class, HotRodPersistentTimerServiceTestCase.TimerManagementSetupTask.class }) public class HotRodPersistentTimerServiceTestCase extends AbstractTimerServiceTestCase { - @BeforeClass - public static void beforeClass() { - IntermittentFailure.thisTestIsFailingIntermittently("https://issues.redhat.com/browse/WFLY-17801 Intermittent failures in HotRodPersistentTimerServiceTestCase"); - } - @ClassRule public static final TestRule INFINISPAN_SERVER_RULE = infinispanServerTestRule(); diff --git a/testsuite/integration/clustering/src/test/java/org/jboss/as/test/clustering/cluster/web/expiration/SessionExpirationTestCase.java b/testsuite/integration/clustering/src/test/java/org/jboss/as/test/clustering/cluster/web/expiration/SessionExpirationTestCase.java index 43e89ea80ccf..7edf415c38d6 100644 --- a/testsuite/integration/clustering/src/test/java/org/jboss/as/test/clustering/cluster/web/expiration/SessionExpirationTestCase.java +++ b/testsuite/integration/clustering/src/test/java/org/jboss/as/test/clustering/cluster/web/expiration/SessionExpirationTestCase.java @@ -24,14 +24,15 @@ import java.io.IOException; import java.net.URISyntaxException; import java.net.URL; +import java.time.Duration; +import java.time.Instant; import java.util.Arrays; import java.util.concurrent.TimeUnit; import jakarta.servlet.http.HttpServletResponse; -import org.apache.http.HttpResponse; +import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpGet; -import org.apache.http.client.utils.HttpClientUtils; import org.apache.http.impl.client.CloseableHttpClient; import org.infinispan.transaction.TransactionMode; import org.jboss.arquillian.container.test.api.OperateOnDeployment; @@ -57,6 +58,8 @@ @RunWith(Arquillian.class) public abstract class SessionExpirationTestCase extends AbstractClusteringTestCase { + private static final Duration EXPIRATION_DURATION = Duration.ofSeconds(2); + public static WebArchive getBaseDeployment(String moduleName) { WebArchive war = ShrinkWrap.create(WebArchive.class, moduleName + ".war"); war.addClasses(SessionOperationServlet.class, RecordingWebListener.class); @@ -75,14 +78,13 @@ protected SessionExpirationTestCase(TransactionMode mode) { public void test(@ArquillianResource(SessionOperationServlet.class) @OperateOnDeployment(DEPLOYMENT_1) URL baseURL1, @ArquillianResource(SessionOperationServlet.class) @OperateOnDeployment(DEPLOYMENT_2) URL baseURL2) throws IOException, URISyntaxException, InterruptedException { - - HttpResponse response; String sessionId; try (CloseableHttpClient client = TestHttpClientUtils.promiscuousCookieHttpClient()) { // This should trigger session creation event, but not added attribute event - response = client.execute(new HttpGet(SessionOperationServlet.createSetURI(baseURL1, "a"))); - try { + try (CloseableHttpResponse response = client.execute(new HttpGet(SessionOperationServlet.createSetURI(baseURL1, "a")))) { + Assert.assertTrue(response.containsHeader(SessionOperationServlet.SESSION_ID)); + sessionId = response.getFirstHeader(SessionOperationServlet.SESSION_ID).getValue(); Assert.assertTrue(response.containsHeader(SessionOperationServlet.CREATED_SESSIONS)); Assert.assertFalse(response.containsHeader(SessionOperationServlet.DESTROYED_SESSIONS)); Assert.assertFalse(response.containsHeader(SessionOperationServlet.ADDED_ATTRIBUTES)); @@ -90,16 +92,14 @@ public void test(@ArquillianResource(SessionOperationServlet.class) @OperateOnDe Assert.assertFalse(response.containsHeader(SessionOperationServlet.REMOVED_ATTRIBUTES)); Assert.assertFalse(response.containsHeader(SessionOperationServlet.BOUND_ATTRIBUTES)); Assert.assertFalse(response.containsHeader(SessionOperationServlet.UNBOUND_ATTRIBUTES)); - Assert.assertEquals(response.getFirstHeader(SessionOperationServlet.SESSION_ID).getValue(), response.getFirstHeader(SessionOperationServlet.CREATED_SESSIONS).getValue()); - } finally { - HttpClientUtils.closeQuietly(response); + Assert.assertEquals(sessionId, response.getFirstHeader(SessionOperationServlet.CREATED_SESSIONS).getValue()); } // This should trigger attribute added event and bound binding event - response = client.execute(new HttpGet(SessionOperationServlet.createSetURI(baseURL1, "a", "1"))); - try { + try (CloseableHttpResponse response = client.execute(new HttpGet(SessionOperationServlet.createSetURI(baseURL1, "a", "1")))) { Assert.assertEquals(HttpServletResponse.SC_OK, response.getStatusLine().getStatusCode()); Assert.assertTrue(response.containsHeader(SessionOperationServlet.SESSION_ID)); + Assert.assertEquals(sessionId, response.getFirstHeader(SessionOperationServlet.SESSION_ID).getValue()); Assert.assertFalse(response.containsHeader(SessionOperationServlet.CREATED_SESSIONS)); Assert.assertFalse(response.containsHeader(SessionOperationServlet.DESTROYED_SESSIONS)); Assert.assertTrue(response.containsHeader(SessionOperationServlet.ADDED_ATTRIBUTES)); @@ -109,8 +109,6 @@ public void test(@ArquillianResource(SessionOperationServlet.class) @OperateOnDe Assert.assertFalse(response.containsHeader(SessionOperationServlet.UNBOUND_ATTRIBUTES)); Assert.assertEquals("a", response.getFirstHeader(SessionOperationServlet.ADDED_ATTRIBUTES).getValue()); Assert.assertEquals("1", response.getFirstHeader(SessionOperationServlet.BOUND_ATTRIBUTES).getValue()); - } finally { - HttpClientUtils.closeQuietly(response); } if (!this.transactional) { @@ -118,9 +116,10 @@ public void test(@ArquillianResource(SessionOperationServlet.class) @OperateOnDe } // No events should have been triggered on remote node - response = client.execute(new HttpGet(SessionOperationServlet.createGetURI(baseURL2, "a"))); - try { + try (CloseableHttpResponse response = client.execute(new HttpGet(SessionOperationServlet.createGetURI(baseURL2, "a")))) { Assert.assertEquals(HttpServletResponse.SC_OK, response.getStatusLine().getStatusCode()); + Assert.assertTrue(response.containsHeader(SessionOperationServlet.SESSION_ID)); + Assert.assertEquals(sessionId, response.getFirstHeader(SessionOperationServlet.SESSION_ID).getValue()); Assert.assertTrue(response.containsHeader(SessionOperationServlet.RESULT)); Assert.assertEquals("1", response.getFirstHeader(SessionOperationServlet.RESULT).getValue()); Assert.assertFalse(response.containsHeader(SessionOperationServlet.CREATED_SESSIONS)); @@ -130,14 +129,13 @@ public void test(@ArquillianResource(SessionOperationServlet.class) @OperateOnDe Assert.assertFalse(response.containsHeader(SessionOperationServlet.REMOVED_ATTRIBUTES)); Assert.assertFalse(response.containsHeader(SessionOperationServlet.BOUND_ATTRIBUTES)); Assert.assertFalse(response.containsHeader(SessionOperationServlet.UNBOUND_ATTRIBUTES)); - } finally { - HttpClientUtils.closeQuietly(response); } // Make sure remove attribute event is not fired since attribute does not exist - response = client.execute(new HttpGet(SessionOperationServlet.createRemoveURI(baseURL2, "b"))); - try { + try (CloseableHttpResponse response = client.execute(new HttpGet(SessionOperationServlet.createRemoveURI(baseURL2, "b")))) { Assert.assertEquals(HttpServletResponse.SC_OK, response.getStatusLine().getStatusCode()); + Assert.assertTrue(response.containsHeader(SessionOperationServlet.SESSION_ID)); + Assert.assertEquals(sessionId, response.getFirstHeader(SessionOperationServlet.SESSION_ID).getValue()); Assert.assertFalse(response.containsHeader(SessionOperationServlet.RESULT)); Assert.assertFalse(response.containsHeader(SessionOperationServlet.CREATED_SESSIONS)); Assert.assertFalse(response.containsHeader(SessionOperationServlet.DESTROYED_SESSIONS)); @@ -146,8 +144,6 @@ public void test(@ArquillianResource(SessionOperationServlet.class) @OperateOnDe Assert.assertFalse(response.containsHeader(SessionOperationServlet.REMOVED_ATTRIBUTES)); Assert.assertFalse(response.containsHeader(SessionOperationServlet.BOUND_ATTRIBUTES)); Assert.assertFalse(response.containsHeader(SessionOperationServlet.UNBOUND_ATTRIBUTES)); - } finally { - HttpClientUtils.closeQuietly(response); } if (!this.transactional) { @@ -155,9 +151,10 @@ public void test(@ArquillianResource(SessionOperationServlet.class) @OperateOnDe } // This should trigger attribute replaced event, as well as valueBound/valueUnbound binding events - response = client.execute(new HttpGet(SessionOperationServlet.createSetURI(baseURL1, "a", "2"))); - try { + try (CloseableHttpResponse response = client.execute(new HttpGet(SessionOperationServlet.createSetURI(baseURL1, "a", "2")))) { Assert.assertEquals(HttpServletResponse.SC_OK, response.getStatusLine().getStatusCode()); + Assert.assertTrue(response.containsHeader(SessionOperationServlet.SESSION_ID)); + Assert.assertEquals(sessionId, response.getFirstHeader(SessionOperationServlet.SESSION_ID).getValue()); Assert.assertFalse(response.containsHeader(SessionOperationServlet.CREATED_SESSIONS)); Assert.assertFalse(response.containsHeader(SessionOperationServlet.DESTROYED_SESSIONS)); Assert.assertFalse(response.containsHeader(SessionOperationServlet.ADDED_ATTRIBUTES)); @@ -168,8 +165,6 @@ public void test(@ArquillianResource(SessionOperationServlet.class) @OperateOnDe Assert.assertEquals("a", response.getFirstHeader(SessionOperationServlet.REPLACED_ATTRIBUTES).getValue()); Assert.assertEquals("2", response.getFirstHeader(SessionOperationServlet.BOUND_ATTRIBUTES).getValue()); Assert.assertEquals("1", response.getFirstHeader(SessionOperationServlet.UNBOUND_ATTRIBUTES).getValue()); - } finally { - HttpClientUtils.closeQuietly(response); } if (!this.transactional) { @@ -177,9 +172,10 @@ public void test(@ArquillianResource(SessionOperationServlet.class) @OperateOnDe } // No events should have been triggered on remote node - response = client.execute(new HttpGet(SessionOperationServlet.createGetURI(baseURL2, "a"))); - try { + try (CloseableHttpResponse response = client.execute(new HttpGet(SessionOperationServlet.createGetURI(baseURL2, "a")))) { Assert.assertEquals(HttpServletResponse.SC_OK, response.getStatusLine().getStatusCode()); + Assert.assertTrue(response.containsHeader(SessionOperationServlet.SESSION_ID)); + Assert.assertEquals(sessionId, response.getFirstHeader(SessionOperationServlet.SESSION_ID).getValue()); Assert.assertTrue(response.containsHeader(SessionOperationServlet.RESULT)); Assert.assertEquals("2", response.getFirstHeader(SessionOperationServlet.RESULT).getValue()); Assert.assertFalse(response.containsHeader(SessionOperationServlet.CREATED_SESSIONS)); @@ -189,8 +185,6 @@ public void test(@ArquillianResource(SessionOperationServlet.class) @OperateOnDe Assert.assertFalse(response.containsHeader(SessionOperationServlet.REMOVED_ATTRIBUTES)); Assert.assertFalse(response.containsHeader(SessionOperationServlet.BOUND_ATTRIBUTES)); Assert.assertFalse(response.containsHeader(SessionOperationServlet.UNBOUND_ATTRIBUTES)); - } finally { - HttpClientUtils.closeQuietly(response); } if (!this.transactional) { @@ -198,9 +192,10 @@ public void test(@ArquillianResource(SessionOperationServlet.class) @OperateOnDe } // This should trigger attribute removed event and valueUnbound binding event - response = client.execute(new HttpGet(SessionOperationServlet.createSetURI(baseURL1, "a"))); - try { + try (CloseableHttpResponse response = client.execute(new HttpGet(SessionOperationServlet.createSetURI(baseURL1, "a")))) { Assert.assertEquals(HttpServletResponse.SC_OK, response.getStatusLine().getStatusCode()); + Assert.assertTrue(response.containsHeader(SessionOperationServlet.SESSION_ID)); + Assert.assertEquals(sessionId, response.getFirstHeader(SessionOperationServlet.SESSION_ID).getValue()); Assert.assertFalse(response.containsHeader(SessionOperationServlet.CREATED_SESSIONS)); Assert.assertFalse(response.containsHeader(SessionOperationServlet.DESTROYED_SESSIONS)); Assert.assertFalse(response.containsHeader(SessionOperationServlet.ADDED_ATTRIBUTES)); @@ -210,8 +205,6 @@ public void test(@ArquillianResource(SessionOperationServlet.class) @OperateOnDe Assert.assertTrue(response.containsHeader(SessionOperationServlet.UNBOUND_ATTRIBUTES)); Assert.assertEquals("a", response.getFirstHeader(SessionOperationServlet.REMOVED_ATTRIBUTES).getValue()); Assert.assertEquals("2", response.getFirstHeader(SessionOperationServlet.UNBOUND_ATTRIBUTES).getValue()); - } finally { - HttpClientUtils.closeQuietly(response); } if (!this.transactional) { @@ -219,9 +212,10 @@ public void test(@ArquillianResource(SessionOperationServlet.class) @OperateOnDe } // No events should have been triggered on remote node - response = client.execute(new HttpGet(SessionOperationServlet.createGetURI(baseURL2, "a"))); - try { + try (CloseableHttpResponse response = client.execute(new HttpGet(SessionOperationServlet.createGetURI(baseURL2, "a")))) { Assert.assertEquals(HttpServletResponse.SC_OK, response.getStatusLine().getStatusCode()); + Assert.assertTrue(response.containsHeader(SessionOperationServlet.SESSION_ID)); + Assert.assertEquals(sessionId, response.getFirstHeader(SessionOperationServlet.SESSION_ID).getValue()); Assert.assertFalse(response.containsHeader(SessionOperationServlet.RESULT)); Assert.assertFalse(response.containsHeader(SessionOperationServlet.CREATED_SESSIONS)); Assert.assertFalse(response.containsHeader(SessionOperationServlet.DESTROYED_SESSIONS)); @@ -230,8 +224,6 @@ public void test(@ArquillianResource(SessionOperationServlet.class) @OperateOnDe Assert.assertFalse(response.containsHeader(SessionOperationServlet.REMOVED_ATTRIBUTES)); Assert.assertFalse(response.containsHeader(SessionOperationServlet.BOUND_ATTRIBUTES)); Assert.assertFalse(response.containsHeader(SessionOperationServlet.UNBOUND_ATTRIBUTES)); - } finally { - HttpClientUtils.closeQuietly(response); } if (!this.transactional) { @@ -239,9 +231,10 @@ public void test(@ArquillianResource(SessionOperationServlet.class) @OperateOnDe } // This should trigger attribute added event and valueBound binding event - response = client.execute(new HttpGet(SessionOperationServlet.createSetURI(baseURL1, "a", "3", "4"))); - try { + try (CloseableHttpResponse response = client.execute(new HttpGet(SessionOperationServlet.createSetURI(baseURL1, "a", "3", "4")))) { Assert.assertEquals(HttpServletResponse.SC_OK, response.getStatusLine().getStatusCode()); + Assert.assertTrue(response.containsHeader(SessionOperationServlet.SESSION_ID)); + Assert.assertEquals(sessionId, response.getFirstHeader(SessionOperationServlet.SESSION_ID).getValue()); Assert.assertFalse(response.containsHeader(SessionOperationServlet.CREATED_SESSIONS)); Assert.assertFalse(response.containsHeader(SessionOperationServlet.DESTROYED_SESSIONS)); Assert.assertTrue(response.containsHeader(SessionOperationServlet.ADDED_ATTRIBUTES)); @@ -251,8 +244,6 @@ public void test(@ArquillianResource(SessionOperationServlet.class) @OperateOnDe Assert.assertFalse(response.containsHeader(SessionOperationServlet.UNBOUND_ATTRIBUTES)); Assert.assertEquals("a", response.getFirstHeader(SessionOperationServlet.ADDED_ATTRIBUTES).getValue()); Assert.assertEquals("3", response.getFirstHeader(SessionOperationServlet.BOUND_ATTRIBUTES).getValue()); - } finally { - HttpClientUtils.closeQuietly(response); } if (!this.transactional) { @@ -260,9 +251,10 @@ public void test(@ArquillianResource(SessionOperationServlet.class) @OperateOnDe } // No events should have been triggered on remote node - response = client.execute(new HttpGet(SessionOperationServlet.createGetURI(baseURL2, "a"))); - try { + try (CloseableHttpResponse response = client.execute(new HttpGet(SessionOperationServlet.createGetURI(baseURL2, "a")))) { Assert.assertEquals(HttpServletResponse.SC_OK, response.getStatusLine().getStatusCode()); + Assert.assertTrue(response.containsHeader(SessionOperationServlet.SESSION_ID)); + Assert.assertEquals(sessionId, response.getFirstHeader(SessionOperationServlet.SESSION_ID).getValue()); Assert.assertTrue(response.containsHeader(SessionOperationServlet.RESULT)); Assert.assertEquals("4", response.getFirstHeader(SessionOperationServlet.RESULT).getValue()); Assert.assertFalse(response.containsHeader(SessionOperationServlet.CREATED_SESSIONS)); @@ -272,8 +264,6 @@ public void test(@ArquillianResource(SessionOperationServlet.class) @OperateOnDe Assert.assertFalse(response.containsHeader(SessionOperationServlet.REMOVED_ATTRIBUTES)); Assert.assertFalse(response.containsHeader(SessionOperationServlet.BOUND_ATTRIBUTES)); Assert.assertFalse(response.containsHeader(SessionOperationServlet.UNBOUND_ATTRIBUTES)); - } finally { - HttpClientUtils.closeQuietly(response); } if (!this.transactional) { @@ -281,9 +271,10 @@ public void test(@ArquillianResource(SessionOperationServlet.class) @OperateOnDe } // This should trigger attribute removed event and valueUnbound binding event - response = client.execute(new HttpGet(SessionOperationServlet.createRemoveURI(baseURL1, "a"))); - try { + try (CloseableHttpResponse response = client.execute(new HttpGet(SessionOperationServlet.createRemoveURI(baseURL1, "a")))) { Assert.assertEquals(HttpServletResponse.SC_OK, response.getStatusLine().getStatusCode()); + Assert.assertTrue(response.containsHeader(SessionOperationServlet.SESSION_ID)); + Assert.assertEquals(sessionId, response.getFirstHeader(SessionOperationServlet.SESSION_ID).getValue()); Assert.assertFalse(response.containsHeader(SessionOperationServlet.CREATED_SESSIONS)); Assert.assertFalse(response.containsHeader(SessionOperationServlet.DESTROYED_SESSIONS)); Assert.assertFalse(response.containsHeader(SessionOperationServlet.ADDED_ATTRIBUTES)); @@ -293,8 +284,6 @@ public void test(@ArquillianResource(SessionOperationServlet.class) @OperateOnDe Assert.assertTrue(response.containsHeader(SessionOperationServlet.UNBOUND_ATTRIBUTES)); Assert.assertEquals("a", response.getFirstHeader(SessionOperationServlet.REMOVED_ATTRIBUTES).getValue()); Assert.assertEquals("4", response.getFirstHeader(SessionOperationServlet.UNBOUND_ATTRIBUTES).getValue()); - } finally { - HttpClientUtils.closeQuietly(response); } if (!this.transactional) { @@ -302,9 +291,10 @@ public void test(@ArquillianResource(SessionOperationServlet.class) @OperateOnDe } // No events should have been triggered on remote node - response = client.execute(new HttpGet(SessionOperationServlet.createGetURI(baseURL2, "a"))); - try { + try (CloseableHttpResponse response = client.execute(new HttpGet(SessionOperationServlet.createGetURI(baseURL2, "a")))) { Assert.assertEquals(HttpServletResponse.SC_OK, response.getStatusLine().getStatusCode()); + Assert.assertTrue(response.containsHeader(SessionOperationServlet.SESSION_ID)); + Assert.assertEquals(sessionId, response.getFirstHeader(SessionOperationServlet.SESSION_ID).getValue()); Assert.assertFalse(response.containsHeader(SessionOperationServlet.RESULT)); Assert.assertFalse(response.containsHeader(SessionOperationServlet.CREATED_SESSIONS)); Assert.assertFalse(response.containsHeader(SessionOperationServlet.DESTROYED_SESSIONS)); @@ -313,15 +303,13 @@ public void test(@ArquillianResource(SessionOperationServlet.class) @OperateOnDe Assert.assertFalse(response.containsHeader(SessionOperationServlet.REMOVED_ATTRIBUTES)); Assert.assertFalse(response.containsHeader(SessionOperationServlet.BOUND_ATTRIBUTES)); Assert.assertFalse(response.containsHeader(SessionOperationServlet.UNBOUND_ATTRIBUTES)); - } finally { - HttpClientUtils.closeQuietly(response); } // This should trigger attribute added event and valueBound binding event - response = client.execute(new HttpGet(SessionOperationServlet.createSetURI(baseURL2, "a", "5"))); - try { + try (CloseableHttpResponse response = client.execute(new HttpGet(SessionOperationServlet.createSetURI(baseURL2, "a", "5")))) { Assert.assertEquals(HttpServletResponse.SC_OK, response.getStatusLine().getStatusCode()); Assert.assertTrue(response.containsHeader(SessionOperationServlet.SESSION_ID)); + Assert.assertEquals(sessionId, response.getFirstHeader(SessionOperationServlet.SESSION_ID).getValue()); Assert.assertFalse(response.containsHeader(SessionOperationServlet.CREATED_SESSIONS)); Assert.assertFalse(response.containsHeader(SessionOperationServlet.DESTROYED_SESSIONS)); Assert.assertTrue(response.containsHeader(SessionOperationServlet.ADDED_ATTRIBUTES)); @@ -331,8 +319,6 @@ public void test(@ArquillianResource(SessionOperationServlet.class) @OperateOnDe Assert.assertFalse(response.containsHeader(SessionOperationServlet.UNBOUND_ATTRIBUTES)); Assert.assertEquals("a", response.getFirstHeader(SessionOperationServlet.ADDED_ATTRIBUTES).getValue()); Assert.assertEquals("5", response.getFirstHeader(SessionOperationServlet.BOUND_ATTRIBUTES).getValue()); - } finally { - HttpClientUtils.closeQuietly(response); } if (!this.transactional) { @@ -340,10 +326,10 @@ public void test(@ArquillianResource(SessionOperationServlet.class) @OperateOnDe } // This should trigger session destroyed event, attribute removed event, and valueUnbound binding event - response = client.execute(new HttpGet(SessionOperationServlet.createInvalidateURI(baseURL1))); - try { + try (CloseableHttpResponse response = client.execute(new HttpGet(SessionOperationServlet.createInvalidateURI(baseURL1)))) { Assert.assertEquals(HttpServletResponse.SC_OK, response.getStatusLine().getStatusCode()); Assert.assertTrue(response.containsHeader(SessionOperationServlet.SESSION_ID)); + Assert.assertEquals(sessionId, response.getFirstHeader(SessionOperationServlet.SESSION_ID).getValue()); Assert.assertFalse(response.containsHeader(SessionOperationServlet.CREATED_SESSIONS)); Assert.assertTrue(response.containsHeader(SessionOperationServlet.DESTROYED_SESSIONS)); Assert.assertFalse(response.containsHeader(SessionOperationServlet.ADDED_ATTRIBUTES)); @@ -354,8 +340,6 @@ public void test(@ArquillianResource(SessionOperationServlet.class) @OperateOnDe Assert.assertEquals(response.getFirstHeader(SessionOperationServlet.SESSION_ID).getValue(), response.getFirstHeader(SessionOperationServlet.DESTROYED_SESSIONS).getValue()); Assert.assertEquals("a", response.getFirstHeader(SessionOperationServlet.REMOVED_ATTRIBUTES).getValue()); Assert.assertEquals("5", response.getFirstHeader(SessionOperationServlet.UNBOUND_ATTRIBUTES).getValue()); - } finally { - HttpClientUtils.closeQuietly(response); } if (!this.transactional) { @@ -363,10 +347,10 @@ public void test(@ArquillianResource(SessionOperationServlet.class) @OperateOnDe } // This should trigger attribute added event and valueBound binding event - response = client.execute(new HttpGet(SessionOperationServlet.createSetURI(baseURL2, "a", "6"))); - try { + try (CloseableHttpResponse response = client.execute(new HttpGet(SessionOperationServlet.createSetURI(baseURL2, "a", "6")))) { Assert.assertEquals(HttpServletResponse.SC_OK, response.getStatusLine().getStatusCode()); Assert.assertTrue(response.containsHeader(SessionOperationServlet.SESSION_ID)); + sessionId = response.getFirstHeader(SessionOperationServlet.SESSION_ID).getValue(); Assert.assertTrue(response.containsHeader(SessionOperationServlet.CREATED_SESSIONS)); Assert.assertFalse(response.containsHeader(SessionOperationServlet.DESTROYED_SESSIONS)); Assert.assertTrue(response.containsHeader(SessionOperationServlet.ADDED_ATTRIBUTES)); @@ -377,17 +361,15 @@ public void test(@ArquillianResource(SessionOperationServlet.class) @OperateOnDe Assert.assertEquals(response.getFirstHeader(SessionOperationServlet.SESSION_ID).getValue(), response.getFirstHeader(SessionOperationServlet.CREATED_SESSIONS).getValue()); Assert.assertEquals("a", response.getFirstHeader(SessionOperationServlet.ADDED_ATTRIBUTES).getValue()); Assert.assertEquals("6", response.getFirstHeader(SessionOperationServlet.BOUND_ATTRIBUTES).getValue()); - } finally { - HttpClientUtils.closeQuietly(response); } // This should not trigger any events - response = client.execute(new HttpGet(SessionOperationServlet.createGetAndSetURI(baseURL2, "a", "7"))); - try { + try (CloseableHttpResponse response = client.execute(new HttpGet(SessionOperationServlet.createGetAndSetURI(baseURL2, "a", "7")))) { Assert.assertEquals(HttpServletResponse.SC_OK, response.getStatusLine().getStatusCode()); + Assert.assertTrue(response.containsHeader(SessionOperationServlet.SESSION_ID)); + Assert.assertEquals(sessionId, response.getFirstHeader(SessionOperationServlet.SESSION_ID).getValue()); Assert.assertTrue(response.containsHeader(SessionOperationServlet.RESULT)); Assert.assertEquals("6", response.getFirstHeader(SessionOperationServlet.RESULT).getValue()); - Assert.assertTrue(response.containsHeader(SessionOperationServlet.SESSION_ID)); Assert.assertFalse(response.containsHeader(SessionOperationServlet.CREATED_SESSIONS)); Assert.assertFalse(response.containsHeader(SessionOperationServlet.DESTROYED_SESSIONS)); Assert.assertFalse(response.containsHeader(SessionOperationServlet.ADDED_ATTRIBUTES)); @@ -395,17 +377,15 @@ public void test(@ArquillianResource(SessionOperationServlet.class) @OperateOnDe Assert.assertFalse(response.containsHeader(SessionOperationServlet.REMOVED_ATTRIBUTES)); Assert.assertFalse(response.containsHeader(SessionOperationServlet.BOUND_ATTRIBUTES)); Assert.assertFalse(response.containsHeader(SessionOperationServlet.UNBOUND_ATTRIBUTES)); - } finally { - HttpClientUtils.closeQuietly(response); } // This should not trigger any events - response = client.execute(new HttpGet(SessionOperationServlet.createGetURI(baseURL2, "a"))); - try { + try (CloseableHttpResponse response = client.execute(new HttpGet(SessionOperationServlet.createGetURI(baseURL2, "a")))) { Assert.assertEquals(HttpServletResponse.SC_OK, response.getStatusLine().getStatusCode()); + Assert.assertTrue(response.containsHeader(SessionOperationServlet.SESSION_ID)); + Assert.assertEquals(sessionId, response.getFirstHeader(SessionOperationServlet.SESSION_ID).getValue()); Assert.assertTrue(response.containsHeader(SessionOperationServlet.RESULT)); Assert.assertEquals("7", response.getFirstHeader(SessionOperationServlet.RESULT).getValue()); - Assert.assertTrue(response.containsHeader(SessionOperationServlet.SESSION_ID)); Assert.assertFalse(response.containsHeader(SessionOperationServlet.CREATED_SESSIONS)); Assert.assertFalse(response.containsHeader(SessionOperationServlet.DESTROYED_SESSIONS)); Assert.assertFalse(response.containsHeader(SessionOperationServlet.ADDED_ATTRIBUTES)); @@ -413,8 +393,6 @@ public void test(@ArquillianResource(SessionOperationServlet.class) @OperateOnDe Assert.assertFalse(response.containsHeader(SessionOperationServlet.REMOVED_ATTRIBUTES)); Assert.assertFalse(response.containsHeader(SessionOperationServlet.BOUND_ATTRIBUTES)); Assert.assertFalse(response.containsHeader(SessionOperationServlet.UNBOUND_ATTRIBUTES)); - } finally { - HttpClientUtils.closeQuietly(response); } if (!this.transactional) { @@ -422,11 +400,11 @@ public void test(@ArquillianResource(SessionOperationServlet.class) @OperateOnDe } // Trigger session timeout in 1 second - response = client.execute(new HttpGet(SessionOperationServlet.createTimeoutURI(baseURL1, 1))); - try { + try (CloseableHttpResponse response = client.execute(new HttpGet(SessionOperationServlet.createTimeoutURI(baseURL1, 1)))) { Assert.assertEquals(HttpServletResponse.SC_OK, response.getStatusLine().getStatusCode()); - Assert.assertFalse(response.containsHeader(SessionOperationServlet.RESULT)); Assert.assertTrue(response.containsHeader(SessionOperationServlet.SESSION_ID)); + Assert.assertEquals(sessionId, response.getFirstHeader(SessionOperationServlet.SESSION_ID).getValue()); + Assert.assertFalse(response.containsHeader(SessionOperationServlet.RESULT)); Assert.assertFalse(response.containsHeader(SessionOperationServlet.CREATED_SESSIONS)); Assert.assertFalse(response.containsHeader(SessionOperationServlet.DESTROYED_SESSIONS)); Assert.assertFalse(response.containsHeader(SessionOperationServlet.ADDED_ATTRIBUTES)); @@ -435,14 +413,23 @@ public void test(@ArquillianResource(SessionOperationServlet.class) @OperateOnDe Assert.assertFalse(response.containsHeader(SessionOperationServlet.BOUND_ATTRIBUTES)); Assert.assertFalse(response.containsHeader(SessionOperationServlet.UNBOUND_ATTRIBUTES)); sessionId = response.getFirstHeader(SessionOperationServlet.SESSION_ID).getValue(); - } finally { - HttpClientUtils.closeQuietly(response); + } + + Instant start = Instant.now(); + // Verify that the session does not expire until it is sufficiently idle + while (Instant.now().isBefore(start.plus(EXPIRATION_DURATION))) { + try (CloseableHttpResponse response = client.execute(new HttpGet(SessionOperationServlet.createGetURI(baseURL1, "a")))) { + Assert.assertEquals(HttpServletResponse.SC_OK, response.getStatusLine().getStatusCode()); + Assert.assertTrue(response.containsHeader(SessionOperationServlet.SESSION_ID)); + Assert.assertEquals(sessionId, response.getFirstHeader(SessionOperationServlet.SESSION_ID).getValue()); + } + Thread.sleep(100); } } // Trigger timeout of sessionId - accounts for session timeout (1s) and infinispan reaper thread interval (1s) // so that test conditions are typically met within the first attempt - Thread.sleep(TimeUnit.SECONDS.toMillis(2)); + Thread.sleep(EXPIRATION_DURATION.toMillis()); // Use a new session for awaiting expiration notification of the previous session scheduled to expire try (CloseableHttpClient client = TestHttpClientUtils.promiscuousCookieHttpClient()) { @@ -457,8 +444,7 @@ public void test(@ArquillianResource(SessionOperationServlet.class) @OperateOnDe // Timeout should trigger session destroyed event, attribute removed event, and valueUnbound binding event for (URL baseURL : Arrays.asList(baseURL1, baseURL2)) { if (!destroyed) { - response = client.execute(new HttpGet(SessionOperationServlet.createGetURI(baseURL, "a", sessionId))); - try { + try (CloseableHttpResponse response = client.execute(new HttpGet(SessionOperationServlet.createGetURI(baseURL, "a", sessionId)))) { Assert.assertEquals(HttpServletResponse.SC_OK, response.getStatusLine().getStatusCode()); Assert.assertFalse(response.containsHeader(SessionOperationServlet.RESULT)); Assert.assertTrue(response.containsHeader(SessionOperationServlet.SESSION_ID)); @@ -480,8 +466,6 @@ public void test(@ArquillianResource(SessionOperationServlet.class) @OperateOnDe Assert.assertEquals("7", response.getFirstHeader(SessionOperationServlet.UNBOUND_ATTRIBUTES).getValue()); log.infof("Session destroyed within %d attempts.", attempt); } - } finally { - HttpClientUtils.closeQuietly(response); } } } diff --git a/testsuite/integration/clustering/src/test/java/org/jboss/as/test/clustering/cluster/web/remote/CoarseHotRodSessionExpirationTestCase.java b/testsuite/integration/clustering/src/test/java/org/jboss/as/test/clustering/cluster/web/remote/CoarseHotRodSessionExpirationTestCase.java index d2c83e90e7c0..bf5142b4b6c8 100644 --- a/testsuite/integration/clustering/src/test/java/org/jboss/as/test/clustering/cluster/web/remote/CoarseHotRodSessionExpirationTestCase.java +++ b/testsuite/integration/clustering/src/test/java/org/jboss/as/test/clustering/cluster/web/remote/CoarseHotRodSessionExpirationTestCase.java @@ -49,6 +49,9 @@ public static Archive deployment1() { } static WebArchive getDeployment() { - return getBaseDeployment(MODULE_NAME).addAsWebInfResource(CoarseHotRodSessionExpirationTestCase.class.getPackage(), "jboss-all_coarse_transactional.xml", "jboss-all.xml"); + return getBaseDeployment(MODULE_NAME) + .addAsWebInfResource(CoarseHotRodSessionExpirationTestCase.class.getPackage(), "jboss-all_coarse_transactional.xml", "jboss-all.xml") + .addAsWebInfResource(CoarseHotRodSessionExpirationTestCase.class.getPackage(), "jboss-web.xml", "jboss-web.xml") + ; } } diff --git a/testsuite/integration/clustering/src/test/java/org/jboss/as/test/clustering/cluster/web/remote/FineHotRodSessionExpirationTestCase.java b/testsuite/integration/clustering/src/test/java/org/jboss/as/test/clustering/cluster/web/remote/FineHotRodSessionExpirationTestCase.java index 3483fed66022..8a6f82a31cac 100644 --- a/testsuite/integration/clustering/src/test/java/org/jboss/as/test/clustering/cluster/web/remote/FineHotRodSessionExpirationTestCase.java +++ b/testsuite/integration/clustering/src/test/java/org/jboss/as/test/clustering/cluster/web/remote/FineHotRodSessionExpirationTestCase.java @@ -49,6 +49,9 @@ public static Archive deployment1() { } static WebArchive getDeployment() { - return getBaseDeployment(MODULE_NAME).addAsWebInfResource(FineHotRodSessionExpirationTestCase.class.getPackage(), "jboss-all_fine_transactional.xml", "jboss-all.xml"); + return getBaseDeployment(MODULE_NAME) + .addAsWebInfResource(FineHotRodSessionExpirationTestCase.class.getPackage(), "jboss-all_fine_transactional.xml", "jboss-all.xml") + .addAsWebInfResource(FineHotRodSessionExpirationTestCase.class.getPackage(), "jboss-web.xml", "jboss-web.xml") + ; } } diff --git a/testsuite/integration/clustering/src/test/java/org/jboss/as/test/clustering/single/web/NonHaWebSessionPersistenceTestCase.java b/testsuite/integration/clustering/src/test/java/org/jboss/as/test/clustering/single/web/NonHaWebSessionPersistenceTestCase.java index 7bbcbb55ee7b..7bc5265525be 100644 --- a/testsuite/integration/clustering/src/test/java/org/jboss/as/test/clustering/single/web/NonHaWebSessionPersistenceTestCase.java +++ b/testsuite/integration/clustering/src/test/java/org/jboss/as/test/clustering/single/web/NonHaWebSessionPersistenceTestCase.java @@ -23,6 +23,7 @@ import static org.jboss.as.test.clustering.cluster.AbstractClusteringTestCase.CONTAINER_SINGLE; import static org.jboss.as.test.clustering.cluster.AbstractClusteringTestCase.DEPLOYMENT_1; +import static org.jboss.as.test.shared.util.AssumeTestGroupUtil.isBootableJar; import java.net.URI; import java.net.URL; @@ -110,7 +111,7 @@ public void testSessionPersistence(@ArquillianResource(SimpleServlet.class) @Ope NodeUtil.stop(this.controller, CONTAINER_SINGLE); NodeUtil.start(this.controller, CONTAINER_SINGLE); - if (Boolean.getBoolean("ts.bootable") || Boolean.getBoolean("ts.bootable.ee9")) { + if (isBootableJar()) { NodeUtil.deploy(this.deployer, DEPLOYMENT_1); } diff --git a/testsuite/integration/clustering/src/test/resources/arquillian.xml b/testsuite/integration/clustering/src/test/resources/arquillian.xml index aaa5c09cbba4..3a6514dfa5b2 100644 --- a/testsuite/integration/clustering/src/test/resources/arquillian.xml +++ b/testsuite/integration/clustering/src/test/resources/arquillian.xml @@ -39,6 +39,7 @@ ${as.managementPort:9990} ${as.debug.port:8787} ${as.managementPort:9990} 8 + ${container.java.home} @@ -52,6 +53,7 @@ ${as.managementPort:9990} ${as.debug.port:8787} ${as.managementPort:9990} 8 + ${container.java.home} @@ -68,6 +70,7 @@ ${as.debug.port:8787} ${as.managementPort:9990} 8 + ${container.java.home} @@ -80,6 +83,7 @@ 10090 ${as.debug.port.node1} 10090 8 + ${container.java.home} @@ -92,6 +96,7 @@ 10190 ${as.debug.port.node2} 10190 8 + ${container.java.home} @@ -104,6 +109,7 @@ 10290 ${as.debug.port.node3} 10290 8 + ${container.java.home} @@ -116,6 +122,7 @@ 10490 10490 8 + ${container.java.home} diff --git a/testsuite/integration/elytron-oidc-client/pom.xml b/testsuite/integration/elytron-oidc-client/pom.xml index a19a86832655..5b174aa4fff8 100644 --- a/testsuite/integration/elytron-oidc-client/pom.xml +++ b/testsuite/integration/elytron-oidc-client/pom.xml @@ -34,7 +34,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-ts-integ-elytron-oidc-client @@ -369,10 +369,10 @@ - ee9.test.profile + preview.test.profile - ts.ee9 + ts.preview @@ -662,10 +662,10 @@ - bootablejar.ee9.profile + bootablejar.preview.profile - ts.bootable.ee9 + ts.bootable.preview diff --git a/testsuite/integration/elytron-oidc-client/src/test/resources/arquillian.xml b/testsuite/integration/elytron-oidc-client/src/test/resources/arquillian.xml index bf3eaf86ff93..65e7e5c16f70 100644 --- a/testsuite/integration/elytron-oidc-client/src/test/resources/arquillian.xml +++ b/testsuite/integration/elytron-oidc-client/src/test/resources/arquillian.xml @@ -12,6 +12,7 @@ true ${node0:127.0.0.1} ${as.managementPort:9990} + ${container.java.home} diff --git a/testsuite/integration/elytron/pom.xml b/testsuite/integration/elytron/pom.xml index 896fef24ce61..63f7e016eafa 100644 --- a/testsuite/integration/elytron/pom.xml +++ b/testsuite/integration/elytron/pom.xml @@ -34,7 +34,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT ../pom.xml @@ -269,11 +269,6 @@ wildfly-cli test - - org.wildfly.core - wildfly-elytron-integration - test - org.wildfly.arquillian @@ -984,10 +979,10 @@ - ee9.profile + preview.profile - ts.ee9 + ts.preview diff --git a/testsuite/integration/elytron/src/test/java/org/wildfly/test/integration/elytron/application/CredentialStoreI18NTestCase.java b/testsuite/integration/elytron/src/test/java/org/wildfly/test/integration/elytron/application/CredentialStoreI18NTestCase.java index 84de2fd56319..1e3d322b1e97 100644 --- a/testsuite/integration/elytron/src/test/java/org/wildfly/test/integration/elytron/application/CredentialStoreI18NTestCase.java +++ b/testsuite/integration/elytron/src/test/java/org/wildfly/test/integration/elytron/application/CredentialStoreI18NTestCase.java @@ -31,7 +31,6 @@ import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; -import org.wildfly.extension.elytron._private.ElytronSubsystemMessages; import org.wildfly.security.credential.PasswordCredential; import org.wildfly.test.security.common.AbstractElytronSetupTask; import org.wildfly.test.security.common.elytron.ConfigurableElement; @@ -99,7 +98,7 @@ public void testAliasesCaseSensitive() throws Exception { Assert.assertFalse(cli.sendLine("/subsystem=elytron/credential-store=CredentialStoreI18NTestCase:add-alias(alias=LOWER, secret-value=password)", true)); ModelNode result = ModelNode.fromString(cli.readOutput()); assertEquals("result " + result, result.get(ModelDescriptionConstants.FAILURE_DESCRIPTION).asString(), - ElytronSubsystemMessages.ROOT_LOGGER.credentialAlreadyExists("LOWER", PasswordCredential.class.getName()).getMessage()); + String.format("WFLYELY00913: Credential alias '%s' of credential type '%s' already exists in the store", "LOWER", PasswordCredential.class.getName())); } } diff --git a/testsuite/integration/elytron/src/test/java/org/wildfly/test/integration/elytron/application/CredentialStoreTestCase.java b/testsuite/integration/elytron/src/test/java/org/wildfly/test/integration/elytron/application/CredentialStoreTestCase.java index 410b64571590..e7be895333ae 100644 --- a/testsuite/integration/elytron/src/test/java/org/wildfly/test/integration/elytron/application/CredentialStoreTestCase.java +++ b/testsuite/integration/elytron/src/test/java/org/wildfly/test/integration/elytron/application/CredentialStoreTestCase.java @@ -37,7 +37,6 @@ import org.jboss.dmr.ModelNode; import org.junit.Test; import org.junit.runner.RunWith; -import org.wildfly.extension.elytron._private.ElytronSubsystemMessages; import org.wildfly.security.credential.PasswordCredential; import org.wildfly.test.security.common.AbstractElytronSetupTask; import org.wildfly.test.security.common.elytron.ConfigurableElement; @@ -148,7 +147,7 @@ public void testAddRemoveAddAlias() throws Exception { CS_NAME_MODIFIABLE, alias, alias), true); ModelNode result = ModelNode.fromString(cli.readOutput()); assertEquals("result " + result, result.get(ModelDescriptionConstants.FAILURE_DESCRIPTION).asString(), - ElytronSubsystemMessages.ROOT_LOGGER.credentialAlreadyExists(alias, PasswordCredential.class.getName()).getMessage()); + String.format("WFLYELY00913: Credential alias '%s' of credential type '%s' already exists in the store", alias, PasswordCredential.class.getName())); } finally { cli.sendLine( String.format("/subsystem=elytron/credential-store=%s:remove-alias(alias=%s)", CS_NAME_MODIFIABLE, alias)); diff --git a/testsuite/integration/elytron/src/test/java/org/wildfly/test/integration/elytron/securityapi/TestCustomPrincipalTransformer.java b/testsuite/integration/elytron/src/test/java/org/wildfly/test/integration/elytron/securityapi/TestCustomPrincipalTransformer.java index e27c66c56327..91b61642cb0a 100644 --- a/testsuite/integration/elytron/src/test/java/org/wildfly/test/integration/elytron/securityapi/TestCustomPrincipalTransformer.java +++ b/testsuite/integration/elytron/src/test/java/org/wildfly/test/integration/elytron/securityapi/TestCustomPrincipalTransformer.java @@ -16,19 +16,17 @@ package org.wildfly.test.integration.elytron.securityapi; import java.security.Principal; - -import org.wildfly.extension.elytron.capabilities.PrincipalTransformer; +import java.util.function.Function; /** - * A simple {@link PrincipalTransformer} that also converts into a {@link TestCustomPrincipal custom principal}. + * A simple principal transformer that converts into a {@link TestCustomPrincipal custom principal}. * * @author Cameron Rodriguez */ -public class TestCustomPrincipalTransformer implements PrincipalTransformer { +public class TestCustomPrincipalTransformer implements Function { @Override public Principal apply(Principal principal) { return new TestCustomPrincipal(principal); } - } diff --git a/testsuite/integration/elytron/src/test/resources/arquillian.xml b/testsuite/integration/elytron/src/test/resources/arquillian.xml index bf3eaf86ff93..65e7e5c16f70 100644 --- a/testsuite/integration/elytron/src/test/resources/arquillian.xml +++ b/testsuite/integration/elytron/src/test/resources/arquillian.xml @@ -12,6 +12,7 @@ true ${node0:127.0.0.1} ${as.managementPort:9990} + ${container.java.home} diff --git a/testsuite/integration/iiop/pom.xml b/testsuite/integration/iiop/pom.xml index 1c8c5d29e96f..3818c0779ac6 100644 --- a/testsuite/integration/iiop/pom.xml +++ b/testsuite/integration/iiop/pom.xml @@ -10,7 +10,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT diff --git a/testsuite/integration/iiop/src/test/resources/arquillian.xml b/testsuite/integration/iiop/src/test/resources/arquillian.xml index be266b6bc3b6..ac06ca74a44c 100644 --- a/testsuite/integration/iiop/src/test/resources/arquillian.xml +++ b/testsuite/integration/iiop/src/test/resources/arquillian.xml @@ -19,6 +19,7 @@ ${as.debug.port:8787} ${as.managementPort:9990} 8 + ${container.java.home} @@ -35,6 +36,7 @@ ${as.debug.port.node1:10090} 8 + ${container.java.home} @@ -53,6 +55,7 @@ ${as.debug.port:8787} ${as.managementPort:9990} 8 + ${container.java.home} @@ -67,6 +70,7 @@ ${as.debug.port.node1:10090} 8 + ${container.java.home} diff --git a/testsuite/integration/legacy/pom.xml b/testsuite/integration/legacy/pom.xml index 55c0312a41c9..5f33539da59a 100644 --- a/testsuite/integration/legacy/pom.xml +++ b/testsuite/integration/legacy/pom.xml @@ -11,7 +11,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT diff --git a/testsuite/integration/legacy/src/test/resources/arquillian.xml b/testsuite/integration/legacy/src/test/resources/arquillian.xml index 151e19d03bc7..122348a3ea8a 100644 --- a/testsuite/integration/legacy/src/test/resources/arquillian.xml +++ b/testsuite/integration/legacy/src/test/resources/arquillian.xml @@ -19,6 +19,7 @@ ${as.debug.port:8787} ${as.managementPort:9990} 8 + ${container.java.home} diff --git a/testsuite/integration/manualmode-expansion/pom.xml b/testsuite/integration/manualmode-expansion/pom.xml index 39058cca60c2..43fcd085faf7 100644 --- a/testsuite/integration/manualmode-expansion/pom.xml +++ b/testsuite/integration/manualmode-expansion/pom.xml @@ -11,7 +11,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT @@ -34,6 +34,18 @@ wildfly-standard-expansion-bom + + + + org.wildfly + wildfly-standard-test-expansion-bom + ${project.version} + pom + import + + + + jakarta.inject diff --git a/testsuite/integration/manualmode-expansion/src/test/resources/arquillian.xml b/testsuite/integration/manualmode-expansion/src/test/resources/arquillian.xml index 425525126c46..96208637afe6 100644 --- a/testsuite/integration/manualmode-expansion/src/test/resources/arquillian.xml +++ b/testsuite/integration/manualmode-expansion/src/test/resources/arquillian.xml @@ -21,6 +21,7 @@ ${as.debug.port:8787} ${as.managementPort:9990} 8 ${basedir}/target/wildfly/modules + ${container.java.home} @@ -38,6 +39,7 @@ ${as.debug.port:8787} ${as.managementPort:9990} 8 ${basedir}/target/wildfly/modules + ${container.java.home} diff --git a/testsuite/integration/manualmode/pom.xml b/testsuite/integration/manualmode/pom.xml index 10e6d100a2ff..c31f81010485 100644 --- a/testsuite/integration/manualmode/pom.xml +++ b/testsuite/integration/manualmode/pom.xml @@ -11,7 +11,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT diff --git a/testsuite/integration/manualmode/src/test/resources/arquillian.xml b/testsuite/integration/manualmode/src/test/resources/arquillian.xml index 5c5d7f5f90a4..220e37871faf 100644 --- a/testsuite/integration/manualmode/src/test/resources/arquillian.xml +++ b/testsuite/integration/manualmode/src/test/resources/arquillian.xml @@ -19,6 +19,7 @@ ${as.debug.port:8787} ${as.managementPort:9990} 8 ${basedir}/target/wildfly/modules + ${container.java.home} @@ -36,6 +37,7 @@ ${as.debug.port:8787} ${as.managementPort:9990} 8 ${basedir}/target/wildfly/modules + ${container.java.home} @@ -53,6 +55,7 @@ ${as.debug.port:8787} ${as.managementPort:9990} 8 ${basedir}/target/wildfly/modules + ${container.java.home} @@ -69,6 +72,7 @@ ${as.debug.port:8787} ${as.managementPort:9990} 8 + ${container.java.home} @@ -85,6 +89,7 @@ ${as.debug.port.node1} 10090 8 + ${container.java.home} @@ -101,6 +106,7 @@ ${as.debug.port:8787} ${as.managementPort:9990} 8 + ${container.java.home} @@ -117,6 +123,7 @@ ${as.debug.port.node1} 10090 8 + ${container.java.home} @@ -133,6 +140,7 @@ ${as.debug.port:8787} ${as.managementPort:9990} 8 + ${container.java.home} @@ -148,6 +156,7 @@ 11990 8 + ${container.java.home} @@ -164,6 +173,7 @@ ${as.debug.port.node1} 10090 8 + ${container.java.home} @@ -180,6 +190,7 @@ ${as.debug.port.node1} 10240 8 + ${container.java.home} @@ -196,6 +207,7 @@ ${as.debug.port.node1} 10090 8 + ${container.java.home} @@ -213,6 +225,7 @@ ${as.debug.port.node1} 10090 8 + ${container.java.home} @@ -229,6 +242,7 @@ ${as.debug.port:8787} ${as.managementPort:9990} 8 + ${container.java.home} @@ -245,6 +259,7 @@ ${as.debug.port:8987} ${as.managementPort:10090} 8 + ${container.java.home} @@ -262,6 +277,7 @@ ${as.debug.port:8787} ${as.managementPort:9990} 8 + ${container.java.home} @@ -279,6 +295,7 @@ ${as.debug.port:8787} ${as.managementPort:9990} 8 + ${container.java.home} @@ -295,6 +312,7 @@ ${as.debug.port.node1:8887} ${as.managementPort.node1:10090} 8 + ${container.java.home} @@ -312,6 +330,7 @@ ${as.debug.port:8787} ${as.managementPort:9990} 8 ${basedir}/target/wildfly/modules + ${container.java.home} @@ -329,6 +348,7 @@ ${as.debug.port:8787} ${as.managementPort:9990} 8 ${basedir}/target/wildfly/modules + ${container.java.home} @@ -347,6 +367,7 @@ ${as.debug.port:8787} ${as.managementPort:9990} 8 ${basedir}/target/wildfly/modules + ${container.java.home} @@ -365,6 +386,7 @@ ${as.debug.port:8787} ${as.managementPort:9990} 8 ${basedir}/target/wildfly/modules + ${container.java.home} @@ -383,6 +405,7 @@ ${as.debug.port:8787} ${as.managementPort:9990} 8 ${basedir}/target/wildfly/modules + ${container.java.home} @@ -401,6 +424,7 @@ ${as.debug.port:8787} ${as.managementPort:9990} 8 ${basedir}/target/wildfly/modules + ${container.java.home} @@ -419,6 +443,7 @@ ${as.debug.port:8787} ${as.managementPort:9990} 8 ${basedir}/target/wildfly/modules + ${container.java.home} @@ -437,6 +462,7 @@ ${as.debug.port:8787} ${as.managementPort:9990} 8 ${basedir}/target/wildfly/modules + ${container.java.home} @@ -455,6 +481,7 @@ ${as.debug.port:8787} ${as.managementPort:9990} 8 ${basedir}/target/wildfly/modules + ${container.java.home} @@ -473,6 +500,7 @@ ${as.debug.port:8787} ${as.managementPort:9990} 8 ${basedir}/target/wildfly/modules + ${container.java.home} diff --git a/testsuite/integration/microprofile-tck/certification/pom.xml b/testsuite/integration/microprofile-tck/certification/pom.xml index f04d0cf0de99..c64966476b2f 100644 --- a/testsuite/integration/microprofile-tck/certification/pom.xml +++ b/testsuite/integration/microprofile-tck/certification/pom.xml @@ -32,7 +32,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-ts-integ-mp-certification diff --git a/testsuite/integration/microprofile-tck/config/pom.xml b/testsuite/integration/microprofile-tck/config/pom.xml index fcabcc93bcc9..d0c5822e92fc 100644 --- a/testsuite/integration/microprofile-tck/config/pom.xml +++ b/testsuite/integration/microprofile-tck/config/pom.xml @@ -32,7 +32,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-ts-integ-mp-config @@ -206,10 +206,10 @@ - bootablejar.ee9.profile + bootablejar.preview.profile - ts.bootable.ee9 + ts.bootable.preview @@ -243,10 +243,10 @@ - ee9.test.profile + preview.test.profile - ts.ee9 + ts.preview diff --git a/testsuite/integration/microprofile-tck/config/src/test/resources/arquillian.xml b/testsuite/integration/microprofile-tck/config/src/test/resources/arquillian.xml index aa282e2b30a3..aa29f79adcf1 100644 --- a/testsuite/integration/microprofile-tck/config/src/test/resources/arquillian.xml +++ b/testsuite/integration/microprofile-tck/config/src/test/resources/arquillian.xml @@ -12,6 +12,7 @@ 9990 true 10 + ${container.java.home} \ No newline at end of file diff --git a/testsuite/integration/microprofile-tck/fault-tolerance/pom.xml b/testsuite/integration/microprofile-tck/fault-tolerance/pom.xml index d9c713b04d27..64dba58594c7 100644 --- a/testsuite/integration/microprofile-tck/fault-tolerance/pom.xml +++ b/testsuite/integration/microprofile-tck/fault-tolerance/pom.xml @@ -30,7 +30,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-ts-integ-mp-fault-tolerance @@ -134,10 +134,10 @@ - bootablejar.ee9.profile + bootablejar.preview.profile - ts.bootable.ee9 + ts.bootable.preview @@ -147,10 +147,10 @@ - ee9.test.profile + preview.test.profile - ts.ee9 + ts.preview diff --git a/testsuite/integration/microprofile-tck/fault-tolerance/src/test/resources/arquillian.xml b/testsuite/integration/microprofile-tck/fault-tolerance/src/test/resources/arquillian.xml index abc4e517ea0d..7b5fb4480eb9 100644 --- a/testsuite/integration/microprofile-tck/fault-tolerance/src/test/resources/arquillian.xml +++ b/testsuite/integration/microprofile-tck/fault-tolerance/src/test/resources/arquillian.xml @@ -35,6 +35,7 @@ true 9990 10 + ${container.java.home} \ No newline at end of file diff --git a/testsuite/integration/microprofile-tck/health/pom.xml b/testsuite/integration/microprofile-tck/health/pom.xml index df5db4113574..64356ceb05b5 100644 --- a/testsuite/integration/microprofile-tck/health/pom.xml +++ b/testsuite/integration/microprofile-tck/health/pom.xml @@ -32,7 +32,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-ts-integ-mp-health @@ -146,10 +146,10 @@ - bootablejar.ee9.profile + bootablejar.preview.profile - ts.bootable.ee9 + ts.bootable.preview @@ -159,10 +159,10 @@ - ee9.test.profile + preview.test.profile - ts.ee9 + ts.preview diff --git a/testsuite/integration/microprofile-tck/health/src/test/resources/arquillian.xml b/testsuite/integration/microprofile-tck/health/src/test/resources/arquillian.xml index d9ca0703b875..83c9a1ddecf1 100644 --- a/testsuite/integration/microprofile-tck/health/src/test/resources/arquillian.xml +++ b/testsuite/integration/microprofile-tck/health/src/test/resources/arquillian.xml @@ -12,6 +12,7 @@ true 9990 10 + ${container.java.home} \ No newline at end of file diff --git a/testsuite/integration/microprofile-tck/jwt/pom.xml b/testsuite/integration/microprofile-tck/jwt/pom.xml index 43b7fc5d5c98..e825cfa662dd 100644 --- a/testsuite/integration/microprofile-tck/jwt/pom.xml +++ b/testsuite/integration/microprofile-tck/jwt/pom.xml @@ -28,7 +28,7 @@ org.wildfly wildfly-ts-integ-mp - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-ts-integ-mp-jwt @@ -242,10 +242,10 @@ - bootablejar.ee9.profile + bootablejar.preview.profile - ts.bootable.ee9 + ts.bootable.preview @@ -282,10 +282,10 @@ - ee9.test.profile + preview.test.profile - ts.ee9 + ts.preview diff --git a/testsuite/integration/microprofile-tck/jwt/src/test/resources/arquillian.xml b/testsuite/integration/microprofile-tck/jwt/src/test/resources/arquillian.xml index a947d2c05993..788f140431bb 100644 --- a/testsuite/integration/microprofile-tck/jwt/src/test/resources/arquillian.xml +++ b/testsuite/integration/microprofile-tck/jwt/src/test/resources/arquillian.xml @@ -12,6 +12,7 @@ true 9990 10 + ${container.java.home} \ No newline at end of file diff --git a/testsuite/integration/microprofile-tck/lra/pom.xml b/testsuite/integration/microprofile-tck/lra/pom.xml index 0e16d4ff8cfc..bab98f46425a 100644 --- a/testsuite/integration/microprofile-tck/lra/pom.xml +++ b/testsuite/integration/microprofile-tck/lra/pom.xml @@ -32,7 +32,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-ts-integ-mp-lra @@ -98,6 +98,11 @@ resteasy-client test + + io.smallrye.config + smallrye-config + test + junit @@ -154,10 +159,9 @@ - - ${ts.microprofile-tck-provisioning.fp.groupId} - ${ts.microprofile-tck-provisioning.fp.artifactId} - ${ts.microprofile-tck-provisioning.fp.version} + ${testsuite.full.galleon.pack.groupId} + ${testsuite.full.galleon.pack.artifactId} + ${testsuite.full.galleon.pack.version} false false @@ -203,10 +207,9 @@ - - ${ts.microprofile-tck-provisioning.fp.groupId} - ${ts.microprofile-tck-provisioning.fp.artifactId} - ${ts.microprofile-tck-provisioning.fp.version} + ${testsuite.full.galleon.pack.groupId} + ${testsuite.full.galleon.pack.artifactId} + ${testsuite.full.galleon.pack.version} @@ -251,10 +254,10 @@ - bootablejar.ee9.profile + bootablejar.preview.profile - ts.bootable.ee9 + ts.bootable.preview @@ -264,10 +267,10 @@ - ee9.test.profile + preview.test.profile - ts.ee9 + ts.preview diff --git a/testsuite/integration/microprofile-tck/lra/src/test/resources/arquillian.xml b/testsuite/integration/microprofile-tck/lra/src/test/resources/arquillian.xml index aa741fa6aaab..e4bb61e4c8d5 100644 --- a/testsuite/integration/microprofile-tck/lra/src/test/resources/arquillian.xml +++ b/testsuite/integration/microprofile-tck/lra/src/test/resources/arquillian.xml @@ -12,6 +12,7 @@ true 9990 10 + ${container.java.home} \ No newline at end of file diff --git a/testsuite/integration/microprofile-tck/openapi/pom.xml b/testsuite/integration/microprofile-tck/openapi/pom.xml index 638dc8c8148c..e93d6d04dfd2 100644 --- a/testsuite/integration/microprofile-tck/openapi/pom.xml +++ b/testsuite/integration/microprofile-tck/openapi/pom.xml @@ -32,7 +32,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-ts-integ-mp-openapi @@ -184,10 +184,10 @@ - bootablejar.ee9.profile + bootablejar.preview.profile - ts.bootable.ee9 + ts.bootable.preview @@ -197,10 +197,10 @@ - ee9.test.profile + preview.test.profile - ts.ee9 + ts.preview diff --git a/testsuite/integration/microprofile-tck/openapi/src/test/java/org/wildfly/extension/microprofile/openapi/tck/DeploymentProcessor.java b/testsuite/integration/microprofile-tck/openapi/src/test/java/org/wildfly/extension/microprofile/openapi/tck/DeploymentProcessor.java index 889ad5082838..0bee78228d4f 100644 --- a/testsuite/integration/microprofile-tck/openapi/src/test/java/org/wildfly/extension/microprofile/openapi/tck/DeploymentProcessor.java +++ b/testsuite/integration/microprofile-tck/openapi/src/test/java/org/wildfly/extension/microprofile/openapi/tck/DeploymentProcessor.java @@ -23,8 +23,6 @@ import org.hamcrest.Matchers; import org.hamcrest.core.IsEqual; -import org.hamcrest.internal.ReflectiveTypeFinder; -import org.hamcrest.number.IsCloseTo; import org.jboss.arquillian.container.test.spi.client.deployment.ApplicationArchiveProcessor; import org.jboss.arquillian.test.spi.TestClass; import org.jboss.shrinkwrap.api.Archive; @@ -41,10 +39,6 @@ public void process(Archive archive, TestClass testClass) { extensionsJar.addPackage(Matchers.class.getPackage()); extensionsJar.addPackage(IsEqual.class.getPackage()); - extensionsJar.addPackage(IsCloseTo.class.getPackage()); - extensionsJar.addPackage(ReflectiveTypeFinder.class.getPackage()); - extensionsJar.addPackage(junit.framework.Assert.class.getPackage()); - extensionsJar.addPackage(org.junit.Assert.class.getPackage()); WebArchive war = WebArchive.class.cast(archive); war.addAsLibraries(extensionsJar); diff --git a/testsuite/integration/microprofile-tck/openapi/src/test/resources/arquillian.xml b/testsuite/integration/microprofile-tck/openapi/src/test/resources/arquillian.xml index a947d2c05993..788f140431bb 100644 --- a/testsuite/integration/microprofile-tck/openapi/src/test/resources/arquillian.xml +++ b/testsuite/integration/microprofile-tck/openapi/src/test/resources/arquillian.xml @@ -12,6 +12,7 @@ true 9990 10 + ${container.java.home} \ No newline at end of file diff --git a/testsuite/integration/microprofile-tck/pom.xml b/testsuite/integration/microprofile-tck/pom.xml index 69aa12dc1847..986a06195ecb 100644 --- a/testsuite/integration/microprofile-tck/pom.xml +++ b/testsuite/integration/microprofile-tck/pom.xml @@ -28,7 +28,7 @@ org.wildfly wildfly-ts-integ - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-ts-integ-mp @@ -53,11 +53,7 @@ generate-test-resources none none - - ${full.maven.groupId} - wildfly-galleon-pack - ${full.maven.version} + FIXME-must-override FIXME-must-override @@ -74,6 +70,18 @@ ${version.org.eclipse.microprofile.telemetry} + + + + org.wildfly + wildfly-standard-test-expansion-bom + ${ee.maven.version} + pom + import + + + + @@ -136,10 +144,9 @@ - - ${ts.microprofile-tck-provisioning.fp.groupId} - ${ts.microprofile-tck-provisioning.fp.artifactId} - ${ts.microprofile-tck-provisioning.fp.version} + ${testsuite.full.galleon.pack.groupId} + ${testsuite.full.galleon.pack.artifactId} + ${testsuite.full.galleon.pack.version} false false @@ -184,10 +191,9 @@ - - ${ts.microprofile-tck-provisioning.fp.groupId} - ${ts.microprofile-tck-provisioning.fp.artifactId} - ${ts.microprofile-tck-provisioning.fp.version} + ${testsuite.full.galleon.pack.groupId} + ${testsuite.full.galleon.pack.artifactId} + ${testsuite.full.galleon.pack.version} @@ -264,10 +270,10 @@ - ee9.test.profile + preview.test.profile - ts.ee9 + ts.preview @@ -397,12 +403,12 @@ - + - bootablejar.ee9.profile + bootablejar.preview.profile - ts.bootable.ee9 + ts.bootable.preview diff --git a/testsuite/integration/microprofile-tck/reactive-messaging/pom.xml b/testsuite/integration/microprofile-tck/reactive-messaging/pom.xml index 14c37162752b..36028757061d 100644 --- a/testsuite/integration/microprofile-tck/reactive-messaging/pom.xml +++ b/testsuite/integration/microprofile-tck/reactive-messaging/pom.xml @@ -32,7 +32,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-ts-integ-mp-reactive-messaging @@ -168,10 +168,10 @@ - bootablejar.ee9.profile + bootablejar.preview.profile - ts.bootable.ee9 + ts.bootable.preview @@ -183,10 +183,10 @@ - ee9.test.profile + preview.test.profile - ts.ee9 + ts.preview diff --git a/testsuite/integration/microprofile-tck/reactive-messaging/src/test/resources/arquillian.xml b/testsuite/integration/microprofile-tck/reactive-messaging/src/test/resources/arquillian.xml index 9cfb9c9dc359..5ba83f5f552d 100644 --- a/testsuite/integration/microprofile-tck/reactive-messaging/src/test/resources/arquillian.xml +++ b/testsuite/integration/microprofile-tck/reactive-messaging/src/test/resources/arquillian.xml @@ -34,6 +34,7 @@ true 9990 10 + ${container.java.home} \ No newline at end of file diff --git a/testsuite/integration/microprofile-tck/reactive-streams-operators/pom.xml b/testsuite/integration/microprofile-tck/reactive-streams-operators/pom.xml index d24ca1d441ce..c7a27cddf4b2 100644 --- a/testsuite/integration/microprofile-tck/reactive-streams-operators/pom.xml +++ b/testsuite/integration/microprofile-tck/reactive-streams-operators/pom.xml @@ -32,7 +32,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-ts-integ-mp-reactive-streams-operators @@ -138,10 +138,10 @@ - bootablejar.ee9.profile + bootablejar.preview.profile - ts.bootable.ee9 + ts.bootable.preview @@ -154,10 +154,10 @@ - ee9.test.profile + preview.test.profile - ts.ee9 + ts.preview diff --git a/testsuite/integration/microprofile-tck/reactive-streams-operators/src/test/resources/arquillian.xml b/testsuite/integration/microprofile-tck/reactive-streams-operators/src/test/resources/arquillian.xml index de26f9097061..69d74c96409e 100644 --- a/testsuite/integration/microprofile-tck/reactive-streams-operators/src/test/resources/arquillian.xml +++ b/testsuite/integration/microprofile-tck/reactive-streams-operators/src/test/resources/arquillian.xml @@ -34,6 +34,7 @@ true 9990 10 + ${container.java.home} \ No newline at end of file diff --git a/testsuite/integration/microprofile-tck/rest-client/pom.xml b/testsuite/integration/microprofile-tck/rest-client/pom.xml index 4405400fe2e6..bbf6c6008350 100644 --- a/testsuite/integration/microprofile-tck/rest-client/pom.xml +++ b/testsuite/integration/microprofile-tck/rest-client/pom.xml @@ -29,7 +29,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-ts-integ-mp-rest-client WildFly Test Suite: Integration - MicroProfile - REST Client TCK @@ -39,7 +39,7 @@ ${jbossas.ts.dir}/.. jaxrs-server - observability + microprofile-rest-client none @@ -104,6 +104,26 @@ jetty-util test + + org.eclipse.jetty + jetty-servlet + test + + + org.eclipse.jetty + jetty-servlets + test + + + org.eclipse.jetty + jetty-webapp + test + + + org.eclipse.jetty + jetty-proxy + test + @@ -350,9 +370,9 @@ - ${full.maven.groupId} - ${ts.microprofile-tck-provisioning.fp.artifactId} - ${full.maven.version} + ${testsuite.full.galleon.pack.groupId} + ${testsuite.full.galleon.pack.artifactId} + ${testsuite.full.galleon.pack.version} false false @@ -382,9 +402,9 @@ - ${ts.microprofile-tck-provisioning.fp.groupId} - ${ts.microprofile-tck-provisioning.fp.artifactId} - ${ts.microprofile-tck-provisioning.fp.version} + ${testsuite.full.galleon.pack.groupId} + ${testsuite.full.galleon.pack.artifactId} + ${testsuite.full.galleon.pack.version} false false @@ -557,10 +577,10 @@ - bootablejar.ee9.profile + bootablejar.preview.profile - ts.bootable.ee9 + ts.bootable.preview @@ -609,10 +629,10 @@ - ee9.test.profile + preview.test.profile - ts.ee9 + ts.preview diff --git a/testsuite/integration/microprofile-tck/rest-client/src/test/resources/arquillian.xml b/testsuite/integration/microprofile-tck/rest-client/src/test/resources/arquillian.xml index d4c2796d24eb..24f83697f4d7 100644 --- a/testsuite/integration/microprofile-tck/rest-client/src/test/resources/arquillian.xml +++ b/testsuite/integration/microprofile-tck/rest-client/src/test/resources/arquillian.xml @@ -12,6 +12,7 @@ true 9990 10 + ${container.java.home} diff --git a/testsuite/integration/microprofile-tck/telemetry/pom.xml b/testsuite/integration/microprofile-tck/telemetry/pom.xml index 559b62f01fc0..c40ecbb67023 100644 --- a/testsuite/integration/microprofile-tck/telemetry/pom.xml +++ b/testsuite/integration/microprofile-tck/telemetry/pom.xml @@ -32,7 +32,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-ts-integ-mp-telemetry @@ -193,10 +193,10 @@ - bootablejar.ee9.profile + bootablejar.preview.profile - ts.bootable.ee9 + ts.bootable.preview @@ -206,10 +206,10 @@ - ee9.test.profile + preview.test.profile - ts.ee9 + ts.preview diff --git a/testsuite/integration/microprofile-tck/telemetry/src/test/resources/arquillian.xml b/testsuite/integration/microprofile-tck/telemetry/src/test/resources/arquillian.xml index 7ca24cee8325..507b2facd2a9 100644 --- a/testsuite/integration/microprofile-tck/telemetry/src/test/resources/arquillian.xml +++ b/testsuite/integration/microprofile-tck/telemetry/src/test/resources/arquillian.xml @@ -12,6 +12,7 @@ 9990 10 true + ${container.java.home} diff --git a/testsuite/integration/microprofile/pom.xml b/testsuite/integration/microprofile/pom.xml index f85c486ab01b..2ebe11c4c7c3 100644 --- a/testsuite/integration/microprofile/pom.xml +++ b/testsuite/integration/microprofile/pom.xml @@ -34,7 +34,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-ts-integ-microprofile @@ -49,13 +49,23 @@ build/target/${server.output.dir.prefix}-${server.output.dir.version} none - - src/test/jakarta/java wildfly-standard-expansion-bom + + + + org.wildfly + wildfly-standard-test-expansion-bom + ${project.version} + pom + import + + + + @@ -393,9 +403,9 @@ - ${testsuite.ee.galleon.pack.groupId} - ${testsuite.ee.galleon.pack.artifactId} - ${testsuite.ee.galleon.pack.version} + ${testsuite.full.galleon.pack.groupId} + ${testsuite.full.galleon.pack.artifactId} + ${testsuite.full.galleon.pack.version} @@ -466,30 +476,6 @@ - - - org.codehaus.mojo - build-helper-maven-plugin - - - add-test-source-directory - generate-test-sources - - add-test-source - - - - ${ts.microprofile.build-helper.source.dir} - - - - - @@ -557,9 +543,9 @@ - ${full.maven.groupId} - wildfly-galleon-pack - ${full.maven.version} + ${testsuite.full.galleon.pack.groupId} + ${testsuite.full.galleon.pack.artifactId} + ${testsuite.full.galleon.pack.version} false false @@ -624,17 +610,15 @@ - ee9.test.profile + preview.test.profile - DISABLED.ts.ee9 + DISABLED.ts.preview ${project.build.directory}/wildfly - src/test/jakarta/java - @@ -691,9 +675,9 @@ - ${full.maven.groupId} - wildfly-preview-feature-pack - ${full.maven.version} + ${testsuite.full.galleon.pack.groupId} + ${testsuite.full.galleon.pack.artifactId} + ${testsuite.full.galleon.pack.version} false false @@ -932,10 +916,10 @@ - bootablejar.ee9.profile + bootablejar.preview.profile - DISABLED.ts.bootable.ee9 + DISABLED.ts.bootable.preview diff --git a/testsuite/integration/microprofile/src/test/java/org/wildfly/test/integration/microprofile/faulttolerance/micrometer/FaultToleranceMicrometerIntegrationTestCase.java b/testsuite/integration/microprofile/src/test/java/org/wildfly/test/integration/microprofile/faulttolerance/micrometer/FaultToleranceMicrometerIntegrationTestCase.java index 2a01a43ba1f1..532836b89979 100644 --- a/testsuite/integration/microprofile/src/test/java/org/wildfly/test/integration/microprofile/faulttolerance/micrometer/FaultToleranceMicrometerIntegrationTestCase.java +++ b/testsuite/integration/microprofile/src/test/java/org/wildfly/test/integration/microprofile/faulttolerance/micrometer/FaultToleranceMicrometerIntegrationTestCase.java @@ -33,10 +33,12 @@ import org.jboss.as.arquillian.api.ServerSetup; import org.jboss.as.arquillian.api.ServerSetupTask; import org.jboss.as.test.integration.common.HttpRequest; +import org.jboss.as.test.shared.IntermittentFailure; import org.jboss.shrinkwrap.api.Archive; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.WebArchive; import org.junit.Assert; +import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.wildfly.test.integration.microprofile.faulttolerance.micrometer.deployment.FaultTolerantApplication; @@ -52,6 +54,11 @@ @ServerSetup(MicrometerSetupTask.class) public class FaultToleranceMicrometerIntegrationTestCase { + @BeforeClass + public static void beforeClass() { + IntermittentFailure.thisTestIsFailingIntermittently("WFLY-18080 Regular failures of FaultToleranceMicrometerIntegrationTestCase"); + } + // Let's use a slightly higher number of invocations, so we can at times differentiate between stale read and or other problems private static final int INVOCATION_COUNT = 10; diff --git a/testsuite/integration/microprofile/src/test/resources/arquillian.xml b/testsuite/integration/microprofile/src/test/resources/arquillian.xml index d48380ca94e1..2291532303e6 100644 --- a/testsuite/integration/microprofile/src/test/resources/arquillian.xml +++ b/testsuite/integration/microprofile/src/test/resources/arquillian.xml @@ -36,6 +36,7 @@ ${as.managementPort:9990} ${as.debug.port:8787} ${as.managementPort:9990} 8 + ${container.java.home} diff --git a/testsuite/integration/multinode/pom.xml b/testsuite/integration/multinode/pom.xml index d4e6151d8619..882b8044fa94 100644 --- a/testsuite/integration/multinode/pom.xml +++ b/testsuite/integration/multinode/pom.xml @@ -11,7 +11,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT diff --git a/testsuite/integration/multinode/src/test/resources/arquillian.xml b/testsuite/integration/multinode/src/test/resources/arquillian.xml index 8ff4de789824..12807e4f1a1b 100644 --- a/testsuite/integration/multinode/src/test/resources/arquillian.xml +++ b/testsuite/integration/multinode/src/test/resources/arquillian.xml @@ -20,6 +20,7 @@ ${as.debug.port:8787} 8 + ${container.java.home} @@ -36,6 +37,7 @@ ${as.debug.port.node1} 10090 8 + ${container.java.home} diff --git a/testsuite/integration/pom.xml b/testsuite/integration/pom.xml index a251a1d47638..7b1b850c48ba 100644 --- a/testsuite/integration/pom.xml +++ b/testsuite/integration/pom.xml @@ -11,7 +11,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-ts-integ @@ -48,6 +48,7 @@ ${skipTests} ${project.build.directory}/wildfly + ${java.home} @@ -299,10 +300,10 @@ - bootablejar.ee9.profile + bootablejar.preview.profile - ts.bootable.ee9 + ts.bootable.preview @@ -320,12 +321,12 @@ - + - ee9.test.profile + preview.test.profile - ts.ee9 + ts.preview @@ -428,6 +429,7 @@ ${server.jvm.args} ${modular.jdk.args} -Dmaven.repo.local=${settings.localRepository} ${modular.jdk.args} + ${container.java.home} diff --git a/testsuite/integration/rbac/pom.xml b/testsuite/integration/rbac/pom.xml index 94fb829208f7..ab1241876de1 100644 --- a/testsuite/integration/rbac/pom.xml +++ b/testsuite/integration/rbac/pom.xml @@ -11,7 +11,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT diff --git a/testsuite/integration/rbac/src/test/resources/arquillian.xml b/testsuite/integration/rbac/src/test/resources/arquillian.xml index 09e44889862c..7bc7ba74dab7 100644 --- a/testsuite/integration/rbac/src/test/resources/arquillian.xml +++ b/testsuite/integration/rbac/src/test/resources/arquillian.xml @@ -17,6 +17,7 @@ ${as.debug.port:8787} ${as.managementPort:9990} 8 + ${container.java.home} diff --git a/testsuite/integration/rts/pom.xml b/testsuite/integration/rts/pom.xml index 604cfbfd906e..45d74f756d6f 100644 --- a/testsuite/integration/rts/pom.xml +++ b/testsuite/integration/rts/pom.xml @@ -19,7 +19,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT diff --git a/testsuite/integration/rts/src/test/resources/arquillian.xml b/testsuite/integration/rts/src/test/resources/arquillian.xml index 0b25142620c5..2dc35c585199 100644 --- a/testsuite/integration/rts/src/test/resources/arquillian.xml +++ b/testsuite/integration/rts/src/test/resources/arquillian.xml @@ -38,6 +38,7 @@ true ${node0:127.0.0.1} ${as.managementPort:9990} + ${container.java.home} diff --git a/testsuite/integration/secman/pom.xml b/testsuite/integration/secman/pom.xml index 063cae096377..26420f5a1f35 100644 --- a/testsuite/integration/secman/pom.xml +++ b/testsuite/integration/secman/pom.xml @@ -12,7 +12,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT @@ -132,12 +132,12 @@ - + - ee9.profile + preview.profile - ts.ee9 + ts.preview diff --git a/testsuite/integration/secman/src/test/resources/arquillian.xml b/testsuite/integration/secman/src/test/resources/arquillian.xml index ea01209905bd..91fb849e9245 100644 --- a/testsuite/integration/secman/src/test/resources/arquillian.xml +++ b/testsuite/integration/secman/src/test/resources/arquillian.xml @@ -15,6 +15,7 @@ ${as.managementPort:9990} ${as.debug.port:8787} ${as.managementPort:9990} 8 + ${container.java.home} diff --git a/testsuite/integration/smoke/pom.xml b/testsuite/integration/smoke/pom.xml index a92cceacf3ff..b74508d917d4 100644 --- a/testsuite/integration/smoke/pom.xml +++ b/testsuite/integration/smoke/pom.xml @@ -11,7 +11,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT @@ -927,10 +927,10 @@ - bootablejar.ee9.profile + bootablejar.preview.profile - ts.bootable.ee9 + ts.bootable.preview @@ -1011,12 +1011,12 @@ - + - ee9.profile + preview.profile - ts.ee9 + ts.preview diff --git a/testsuite/integration/smoke/src/test/resources/arquillian.xml b/testsuite/integration/smoke/src/test/resources/arquillian.xml index b06e64b69459..30ef98ecc257 100644 --- a/testsuite/integration/smoke/src/test/resources/arquillian.xml +++ b/testsuite/integration/smoke/src/test/resources/arquillian.xml @@ -17,6 +17,7 @@ ${as.debug.port:8787} ${as.managementPort:9990} 8 + ${container.java.home} diff --git a/testsuite/integration/vdx/pom.xml b/testsuite/integration/vdx/pom.xml index 888ab6fbc4f8..173fb58f4639 100644 --- a/testsuite/integration/vdx/pom.xml +++ b/testsuite/integration/vdx/pom.xml @@ -25,7 +25,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT @@ -167,12 +167,12 @@ - + - ee9.profile + preview.profile - ts.ee9 + ts.preview diff --git a/testsuite/integration/vdx/src/test/resources/arquillian.xml b/testsuite/integration/vdx/src/test/resources/arquillian.xml index 84356b85b2d1..76ff5a6f1777 100644 --- a/testsuite/integration/vdx/src/test/resources/arquillian.xml +++ b/testsuite/integration/vdx/src/test/resources/arquillian.xml @@ -11,6 +11,7 @@ 9990 9990 10 + ${container.java.home} \ No newline at end of file diff --git a/testsuite/integration/web/pom.xml b/testsuite/integration/web/pom.xml index 81bda525e992..af9feeae4d4b 100644 --- a/testsuite/integration/web/pom.xml +++ b/testsuite/integration/web/pom.xml @@ -11,7 +11,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT @@ -1202,12 +1202,12 @@ - + - bootablejar.ee9.profile + bootablejar.preview.profile - ts.bootable.ee9 + ts.bootable.preview @@ -1289,6 +1289,7 @@ arquillian-bootable.xml + org/jboss/as/test/integration/web/security/**/*TestCase.java @@ -1350,6 +1351,7 @@ arquillian-bootable.xml + org/jboss/as/test/integration/web/security/**/*TestCase.java @@ -1385,6 +1387,7 @@ arquillian-bootable.xml + org/jboss/as/test/integration/web/security/**/*TestCase.java @@ -1411,12 +1414,12 @@ - + - ee9.profile + preview.profile - ts.ee9 + ts.preview @@ -1431,7 +1434,7 @@ test - + org/jboss/as/test/integration/web/annotationsmodule/WebModuleDeploymentTestCase.java org/jboss/as/test/integration/web/jsp/taglib/external/ExternalTagLibTestCase.java diff --git a/testsuite/integration/web/src/test/resources/arquillian.xml b/testsuite/integration/web/src/test/resources/arquillian.xml index ed245b093077..29c140c366ba 100644 --- a/testsuite/integration/web/src/test/resources/arquillian.xml +++ b/testsuite/integration/web/src/test/resources/arquillian.xml @@ -17,6 +17,7 @@ ${as.managementPort:9990} 8 + ${container.java.home} diff --git a/testsuite/integration/ws/pom.xml b/testsuite/integration/ws/pom.xml index 35d6d8e7b49f..e9462a577c6a 100644 --- a/testsuite/integration/ws/pom.xml +++ b/testsuite/integration/ws/pom.xml @@ -11,7 +11,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT diff --git a/testsuite/integration/ws/src/test/resources/arquillian.xml b/testsuite/integration/ws/src/test/resources/arquillian.xml index 3181fba1745e..9c44e4c5a482 100644 --- a/testsuite/integration/ws/src/test/resources/arquillian.xml +++ b/testsuite/integration/ws/src/test/resources/arquillian.xml @@ -19,6 +19,7 @@ ${as.debug.port:8787} ${as.managementPort:9990} 8 + ${container.java.home} diff --git a/testsuite/integration/xts/pom.xml b/testsuite/integration/xts/pom.xml index 5addc545826a..e268ad005cdd 100644 --- a/testsuite/integration/xts/pom.xml +++ b/testsuite/integration/xts/pom.xml @@ -10,7 +10,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT diff --git a/testsuite/integration/xts/src/test/resources/arquillian.xml b/testsuite/integration/xts/src/test/resources/arquillian.xml index f00983aecc89..93c50d35b64c 100644 --- a/testsuite/integration/xts/src/test/resources/arquillian.xml +++ b/testsuite/integration/xts/src/test/resources/arquillian.xml @@ -14,6 +14,7 @@ true ${node0:127.0.0.1} ${as.managementPort:9990} + ${container.java.home} @@ -26,6 +27,7 @@ true ${node0:127.0.0.1} ${as.managementPort1:10090} + ${container.java.home} diff --git a/testsuite/layers-expansion/pom.xml b/testsuite/layers-expansion/pom.xml index 41158d472bf0..84eac586ae92 100644 --- a/testsuite/layers-expansion/pom.xml +++ b/testsuite/layers-expansion/pom.xml @@ -11,7 +11,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-ts-layers-expansion @@ -64,12 +64,6 @@ true ${jbossas.ts.dir}/../.. - - ${testsuite.ee.galleon.pack.groupId} - ${testsuite.ee.galleon.pack.version} - wildfly-galleon-pack - ${settings.localRepository} @@ -84,6 +78,9 @@ ${project.build.directory}/std-configs + + + wildfly-standard-expansion-bom @@ -104,10 +101,10 @@ - ee9.profile + preview.profile - ts.ee9 + ts.preview @@ -116,10 +113,6 @@ compile compile test - - ${project.groupId} - ${project.version} - wildfly-preview-feature-pack ${settings.localRepository} @@ -160,9 +153,9 @@ ${layers.install.dir}/datasources-web-server-observability - ${ee.feature.pack.groupId} - ${full.feature.pack.artifactId} - ${ee.feature.pack.version} + ${testsuite.full.galleon.pack.groupId} + ${testsuite.full.galleon.pack.artifactId} + ${testsuite.full.galleon.pack.version} false false @@ -189,9 +182,9 @@ ${layers.install.dir}/jaxrs-server-observability - ${ee.feature.pack.groupId} - ${full.feature.pack.artifactId} - ${ee.feature.pack.version} + ${testsuite.full.galleon.pack.groupId} + ${testsuite.full.galleon.pack.artifactId} + ${testsuite.full.galleon.pack.version} false false @@ -218,9 +211,9 @@ ${layers.install.dir}/test-standalone-reference - ${ee.maven.groupId} - ${full.feature.pack.artifactId} - ${ee.maven.version} + ${testsuite.full.galleon.pack.groupId} + ${testsuite.full.galleon.pack.artifactId} + ${testsuite.full.galleon.pack.version} false @@ -242,9 +235,9 @@ ${layers.install.dir}/observability - ${ee.feature.pack.groupId} - ${full.feature.pack.artifactId} - ${ee.feature.pack.version} + ${testsuite.full.galleon.pack.groupId} + ${testsuite.full.galleon.pack.artifactId} + ${testsuite.full.galleon.pack.version} false false @@ -270,9 +263,9 @@ ${layers.install.dir}/opentelemetry - ${ee.feature.pack.groupId} - ${full.feature.pack.artifactId} - ${ee.feature.pack.version} + ${testsuite.full.galleon.pack.groupId} + ${testsuite.full.galleon.pack.artifactId} + ${testsuite.full.galleon.pack.version} false false @@ -301,9 +294,9 @@ ${layers.install.dir}/microprofile-platform - ${full.maven.groupId} - ${full.feature.pack.artifactId} - ${full.maven.version} + ${testsuite.full.galleon.pack.groupId} + ${testsuite.full.galleon.pack.artifactId} + ${testsuite.full.galleon.pack.version} false false @@ -329,9 +322,9 @@ ${layers.install.dir}/microprofile-config - ${full.maven.groupId} - ${full.feature.pack.artifactId} - ${full.maven.version} + ${testsuite.full.galleon.pack.groupId} + ${testsuite.full.galleon.pack.artifactId} + ${testsuite.full.galleon.pack.version} false false @@ -357,9 +350,9 @@ ${layers.install.dir}/microprofile-health - ${full.maven.groupId} - ${full.feature.pack.artifactId} - ${full.maven.version} + ${testsuite.full.galleon.pack.groupId} + ${testsuite.full.galleon.pack.artifactId} + ${testsuite.full.galleon.pack.version} false false @@ -385,9 +378,9 @@ ${layers.install.dir}/microprofile-openapi - ${full.maven.groupId} - ${full.feature.pack.artifactId} - ${full.maven.version} + ${testsuite.full.galleon.pack.groupId} + ${testsuite.full.galleon.pack.artifactId} + ${testsuite.full.galleon.pack.version} false false @@ -413,9 +406,9 @@ ${layers.install.dir}/microprofile-fault-tolerance - ${full.maven.groupId} - ${full.feature.pack.artifactId} - ${full.maven.version} + ${testsuite.full.galleon.pack.groupId} + ${testsuite.full.galleon.pack.artifactId} + ${testsuite.full.galleon.pack.version} false false @@ -441,9 +434,9 @@ ${layers.install.dir}/microprofile-jwt - ${full.maven.groupId} - ${full.feature.pack.artifactId} - ${full.maven.version} + ${testsuite.full.galleon.pack.groupId} + ${testsuite.full.galleon.pack.artifactId} + ${testsuite.full.galleon.pack.version} false false @@ -469,9 +462,9 @@ ${layers.install.dir}/microprofile-lra-coordinator - ${full.maven.groupId} - ${full.feature.pack.artifactId} - ${full.maven.version} + ${testsuite.full.galleon.pack.groupId} + ${testsuite.full.galleon.pack.artifactId} + ${testsuite.full.galleon.pack.version} false false @@ -497,9 +490,9 @@ ${layers.install.dir}/microprofile-lra-participant - ${full.maven.groupId} - ${full.feature.pack.artifactId} - ${full.maven.version} + ${testsuite.full.galleon.pack.groupId} + ${testsuite.full.galleon.pack.artifactId} + ${testsuite.full.galleon.pack.version} false false @@ -525,9 +518,9 @@ ${layers.install.dir}/microprofile-standalone - ${full.maven.groupId} - ${full.feature.pack.artifactId} - ${full.maven.version} + ${testsuite.full.galleon.pack.groupId} + ${testsuite.full.galleon.pack.artifactId} + ${testsuite.full.galleon.pack.version} false false @@ -562,9 +555,9 @@ ${layers.install.dir}/microprofile-standalone-ha - ${full.maven.groupId} - ${full.feature.pack.artifactId} - ${full.maven.version} + ${testsuite.full.galleon.pack.groupId} + ${testsuite.full.galleon.pack.artifactId} + ${testsuite.full.galleon.pack.version} false false @@ -605,9 +598,9 @@ ${layers.install.dir}/test-all-layers - ${full.maven.groupId} - ${full.feature.pack.artifactId} - ${full.maven.version} + ${testsuite.full.galleon.pack.groupId} + ${testsuite.full.galleon.pack.artifactId} + ${testsuite.full.galleon.pack.version} false false @@ -712,9 +705,9 @@ ${layers.install.dir}/test-all-layers-jpa-distributed - ${full.maven.groupId} - ${full.feature.pack.artifactId} - ${full.maven.version} + ${testsuite.full.galleon.pack.groupId} + ${testsuite.full.galleon.pack.artifactId} + ${testsuite.full.galleon.pack.version} false false @@ -813,9 +806,9 @@ ${layers.install.dir}/test-all-layers - ${full.maven.groupId} - wildfly-preview-feature-pack - ${full.maven.version} + ${testsuite.full.galleon.pack.groupId} + ${testsuite.full.galleon.pack.artifactId} + ${testsuite.full.galleon.pack.version} false false @@ -914,9 +907,9 @@ ${layers.install.dir}/test-all-layers-jpa-distributed - ${full.maven.groupId} - wildfly-preview-feature-pack - ${full.maven.version} + ${testsuite.full.galleon.pack.groupId} + ${testsuite.full.galleon.pack.artifactId} + ${testsuite.full.galleon.pack.version} false false @@ -1014,9 +1007,9 @@ ${std.default.install.dir}/standalone - ${ee.maven.groupId} - ${full.feature.pack.artifactId} - ${ee.maven.version} + ${testsuite.full.galleon.pack.groupId} + ${testsuite.full.galleon.pack.artifactId} + ${testsuite.full.galleon.pack.version} false false @@ -1039,9 +1032,9 @@ ${std.default.install.dir}/standalone-ha - ${ee.maven.groupId} - ${full.feature.pack.artifactId} - ${ee.maven.version} + ${testsuite.full.galleon.pack.groupId} + ${testsuite.full.galleon.pack.artifactId} + ${testsuite.full.galleon.pack.version} false false @@ -1065,9 +1058,9 @@ ${std.default.install.dir}/standalone-full - ${ee.maven.groupId} - ${full.feature.pack.artifactId} - ${ee.maven.version} + ${testsuite.full.galleon.pack.groupId} + ${testsuite.full.galleon.pack.artifactId} + ${testsuite.full.galleon.pack.version} false false @@ -1091,9 +1084,9 @@ ${std.default.install.dir}/standalone-full-ha - ${ee.maven.groupId} - ${full.feature.pack.artifactId} - ${ee.maven.version} + ${testsuite.full.galleon.pack.groupId} + ${testsuite.full.galleon.pack.artifactId} + ${testsuite.full.galleon.pack.version} false false diff --git a/testsuite/layers/pom.xml b/testsuite/layers/pom.xml index 7cb2a84cc59e..cd757f33afc8 100644 --- a/testsuite/layers/pom.xml +++ b/testsuite/layers/pom.xml @@ -11,7 +11,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-ts-layers @@ -102,12 +102,12 @@ - + - ee9.profile + preview.profile - ts.ee9 + ts.preview diff --git a/testsuite/mixed-domain/pom.xml b/testsuite/mixed-domain/pom.xml index de8ae57c4110..b916ca4a8d52 100644 --- a/testsuite/mixed-domain/pom.xml +++ b/testsuite/mixed-domain/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-testsuite-integration-mixed-domain diff --git a/testsuite/pom.xml b/testsuite/pom.xml index 0e8728b7aa0a..07a261c3f137 100644 --- a/testsuite/pom.xml +++ b/testsuite/pom.xml @@ -58,7 +58,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-testsuite @@ -188,16 +188,16 @@ - ${ee.maven.groupId} + ${project.groupId} ${dependency.management.import.artifact} - ${ee.maven.version} + ${project.version} pom import ${ee.maven.groupId} wildfly-standard-test-bom - ${project.version} + ${ee.maven.version} pom import @@ -473,8 +473,8 @@ - ee9.profile - ts.ee9 + preview.profile + ts.preview wildfly-preview-expansion-bom @@ -489,10 +489,10 @@ - bootablejar.ee9.profile + bootablejar.preview.profile - ts.bootable.ee9 + ts.bootable.preview diff --git a/testsuite/preview/basic/pom.xml b/testsuite/preview/basic/pom.xml index 23ed8b2a79b4..d1ed97d19333 100644 --- a/testsuite/preview/basic/pom.xml +++ b/testsuite/preview/basic/pom.xml @@ -11,7 +11,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT @@ -416,10 +416,10 @@ - bootablejar.ee9.profile + bootablejar.preview.profile - ts.bootable.ee9 + ts.bootable.preview diff --git a/testsuite/preview/basic/src/test/resources/arquillian.xml b/testsuite/preview/basic/src/test/resources/arquillian.xml index 3181fba1745e..9c44e4c5a482 100644 --- a/testsuite/preview/basic/src/test/resources/arquillian.xml +++ b/testsuite/preview/basic/src/test/resources/arquillian.xml @@ -19,6 +19,7 @@ ${as.debug.port:8787} ${as.managementPort:9990} 8 + ${container.java.home} diff --git a/testsuite/preview/pom.xml b/testsuite/preview/pom.xml index e6443be68ad4..96c2160bfd8d 100644 --- a/testsuite/preview/pom.xml +++ b/testsuite/preview/pom.xml @@ -11,7 +11,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-ts-preview @@ -50,6 +50,7 @@ wildfly-preview-ee-bom + ${java.home} @@ -126,10 +127,10 @@ - bootablejar.ee9.profile + bootablejar.preview.profile - ts.bootable.ee9 + ts.bootable.preview @@ -363,10 +364,10 @@ - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT 4.0.0 @@ -134,12 +134,12 @@ - + - ee9.profile + preview.profile - ts.ee9 + ts.preview diff --git a/testsuite/shared/pom.xml b/testsuite/shared/pom.xml index 85bbe006ee10..ce297e9ce404 100644 --- a/testsuite/shared/pom.xml +++ b/testsuite/shared/pom.xml @@ -11,7 +11,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT ../../pom.xml diff --git a/testsuite/shared/src/main/java/org/jboss/as/test/integration/common/jms/ActiveMQProviderJMSOperations.java b/testsuite/shared/src/main/java/org/jboss/as/test/integration/common/jms/ActiveMQProviderJMSOperations.java index 6b5adbf38c8d..a7a071a4b3f6 100644 --- a/testsuite/shared/src/main/java/org/jboss/as/test/integration/common/jms/ActiveMQProviderJMSOperations.java +++ b/testsuite/shared/src/main/java/org/jboss/as/test/integration/common/jms/ActiveMQProviderJMSOperations.java @@ -307,7 +307,7 @@ public void addHttpConnector(String connectorName, String socketBinding, String ModelNode attributes = new ModelNode(); attributes.get("socket-binding").set(socketBinding); attributes.get("endpoint").set(endpoint); - if (parameters != null && parameters.size() > 0) { + if (parameters != null && !parameters.isEmpty()) { ModelNode params = attributes.get("params").setEmptyList(); for (Map.Entry param : parameters.entrySet()) { params.add(param.getKey(), param.getValue()); diff --git a/testsuite/shared/src/main/java/org/jboss/as/test/shared/LayersTestBase.java b/testsuite/shared/src/main/java/org/jboss/as/test/shared/LayersTestBase.java index c43b87f858c2..ed0e86533dac 100644 --- a/testsuite/shared/src/main/java/org/jboss/as/test/shared/LayersTestBase.java +++ b/testsuite/shared/src/main/java/org/jboss/as/test/shared/LayersTestBase.java @@ -126,15 +126,13 @@ public class LayersTestBase { "org.infinispan.query", "org.infinispan.query.core", // JGroups external protocols - AWS - "com.amazon.aws.core", - "com.amazon.aws.jmespath", - "com.amazon.aws.kms", - "com.amazon.aws.s3", - "com.amazon.ion", - "com.fasterxml.jackson.dataformat.jackson-dataformat-cbor", "org.jgroups.aws", + "software.amazon.awssdk.s3", + // MicroProfile "org.wildfly.extension.microprofile.metrics-smallrye", "org.wildfly.extension.microprofile.opentracing-smallrye", + //xerces dependency is eliminated from different subsystems and use JDK JAXP instead + "org.apache.xerces", }; private static final String[] NOT_USED; // Packages that are not referenced from the module graph but needed. @@ -238,7 +236,8 @@ public class LayersTestBase { NOT_REFERENCED_COMMON, "org.wildfly.extension.metrics", // Used by the hibernate search that's injected by jpa - "org.hibernate.search.mapper.orm.coordination.outboxpolling" + "org.hibernate.search.mapper.orm.coordination.outboxpolling", + "org.apache.avro" ); } else { NOT_USED = ArrayUtils.addAll( @@ -255,9 +254,7 @@ public class LayersTestBase { "org.jboss.as.jpa.openjpa", "org.apache.openjpa", // TODO WFLY-16583 -- cruft - "javax.management.j2ee.api", - // Used by outboxpolling TODO this doesn't seem right - "org.apache.avro" + "javax.management.j2ee.api" ); NOT_REFERENCED = ArrayUtils.addAll( NOT_REFERENCED_COMMON, @@ -303,7 +300,6 @@ public class LayersTestBase { "com.google.code.gson", "com.carrotsearch.hppc", "org.apache.lucene", - "org.apache.avro", // Brought by galleon ServerRootResourceDefinition "wildflyee.api" ); diff --git a/testsuite/shared/src/main/java/org/jboss/as/test/shared/util/AssumeTestGroupUtil.java b/testsuite/shared/src/main/java/org/jboss/as/test/shared/util/AssumeTestGroupUtil.java index 7bc501a39762..f9a16e0a4661 100644 --- a/testsuite/shared/src/main/java/org/jboss/as/test/shared/util/AssumeTestGroupUtil.java +++ b/testsuite/shared/src/main/java/org/jboss/as/test/shared/util/AssumeTestGroupUtil.java @@ -1,11 +1,10 @@ package org.jboss.as.test.shared.util; import static org.junit.Assume.assumeTrue; - import java.security.AccessController; import java.security.PrivilegedAction; import java.util.function.Supplier; - +import org.jboss.logging.Logger; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; import org.jboss.shrinkwrap.api.spec.JavaArchive; @@ -39,6 +38,7 @@ public class AssumeTestGroupUtil { * in-container where Shrinkwrap is not available. *

*/ + private static final Logger logger = Logger.getLogger(AssumeTestGroupUtil.class); private static JavaArchive EMPTY_JAR; /** Same as {@link #EMPTY_JAR} but is a {@link WebArchive}. */ private static WebArchive EMPTY_WAR; @@ -239,9 +239,18 @@ public static boolean isFullDistribution() { * Assume for tests that require a docker installation. * * @throws AssumptionViolatedException if a docker client cannot be initialized + * @throws RuntimeException if a docker client is required but is unavailable or not properly configured */ public static void assumeDockerAvailable() { - assumeCondition("Docker is not available.", AssumeTestGroupUtil::isDockerAvailable); + try { + assumeCondition("Docker is not available.", AssumeTestGroupUtil::isDockerAvailable); + } catch (AssumptionViolatedException ex) { + if (System.getProperty("org.wildfly.test.require.docker") != null && System.getProperty("org.wildfly.test.require.docker").equals("true")){ + throw new RuntimeException("Docker is required but it is not available or is not properly configured"); + } else { + throw ex; + } + } } /** @@ -254,6 +263,7 @@ public static boolean isDockerAvailable() { DockerClientFactory.instance().client(); return true; } catch (Throwable ex) { + logger.error("Could not initialize docker",ex); return false; } } @@ -274,7 +284,16 @@ public static void assumeWildFlyPreview() { } public static boolean isWildFlyPreview() { - return System.getProperty("ts.ee9") != null || System.getProperty("ts.bootable.ee9") != null; + return System.getProperty("ts.preview") != null || System.getProperty("ts.bootable.preview") != null; + } + + public static void assumeBootableJar() { + assumeCondition("Some tests require bootable jar packaging", + AssumeTestGroupUtil::isBootableJar); + } + + public static boolean isBootableJar() { + return System.getProperty("ts.bootable") != null || System.getProperty("ts.bootable.preview") != null; } private static int getJavaSpecificationVersion() { diff --git a/testsuite/test-feature-pack-preview/pom.xml b/testsuite/test-feature-pack-preview/pom.xml index 25b8f8451bc0..a0901655f904 100644 --- a/testsuite/test-feature-pack-preview/pom.xml +++ b/testsuite/test-feature-pack-preview/pom.xml @@ -34,7 +34,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT ../../pom.xml diff --git a/testsuite/test-feature-pack/pom.xml b/testsuite/test-feature-pack/pom.xml index ac289e6d3c92..3d54cd0e88d9 100644 --- a/testsuite/test-feature-pack/pom.xml +++ b/testsuite/test-feature-pack/pom.xml @@ -34,7 +34,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT ../../pom.xml diff --git a/transactions/pom.xml b/transactions/pom.xml index 452609494475..733126d379ef 100644 --- a/transactions/pom.xml +++ b/transactions/pom.xml @@ -32,7 +32,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-transactions diff --git a/undertow/pom.xml b/undertow/pom.xml index e7d9a4fe5dde..aad0f8652aa9 100644 --- a/undertow/pom.xml +++ b/undertow/pom.xml @@ -31,7 +31,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT ../pom.xml diff --git a/undertow/src/main/java/org/wildfly/extension/undertow/MimeMappingDefinition.java b/undertow/src/main/java/org/wildfly/extension/undertow/MimeMappingDefinition.java index 536b4a84c1ee..0dedd8a83fec 100644 --- a/undertow/src/main/java/org/wildfly/extension/undertow/MimeMappingDefinition.java +++ b/undertow/src/main/java/org/wildfly/extension/undertow/MimeMappingDefinition.java @@ -55,7 +55,7 @@ class MimeMappingDefinition extends PersistentResourceDefinition { MimeMappingDefinition() { super(new SimpleResourceDefinition.Parameters(PATH_ELEMENT, UndertowExtension.getResolver(PATH_ELEMENT.getKey())) .setAddHandler(new ReloadRequiredAddStepHandler(ATTRIBUTES)) - .setRemoveHandler(new ReloadRequiredRemoveStepHandler()) + .setRemoveHandler(ReloadRequiredRemoveStepHandler.INSTANCE) ); } diff --git a/undertow/src/main/java/org/wildfly/extension/undertow/RemoteHttpInvokerService.java b/undertow/src/main/java/org/wildfly/extension/undertow/RemoteHttpInvokerService.java index fff34eda51d7..775305f5d6f8 100644 --- a/undertow/src/main/java/org/wildfly/extension/undertow/RemoteHttpInvokerService.java +++ b/undertow/src/main/java/org/wildfly/extension/undertow/RemoteHttpInvokerService.java @@ -22,6 +22,7 @@ package org.wildfly.extension.undertow; +import io.undertow.server.HttpHandler; import io.undertow.server.handlers.CookieImpl; import io.undertow.server.session.SecureRandomSessionIdGenerator; import org.jboss.msc.service.Service; @@ -29,31 +30,50 @@ import org.jboss.msc.service.StartException; import org.jboss.msc.service.StopContext; import io.undertow.server.handlers.PathHandler; +import org.wildfly.httpclient.common.HttpServiceConfig; /** - * Service that exposes the Wildfly + * Service that exposes the Wildfly Remote HTTP invoker base PathHandler. * * @author Stuart Douglas + * @author Richard Achmatowicz */ public class RemoteHttpInvokerService implements Service { - private static final String AFFINITY_PATH = "/common/v1/affinity"; + private static final String COMMON_PATH = "/common"; + private static final String AFFINITY_PATH = "/affinity"; private final PathHandler pathHandler = new PathHandler(); @Override public void start(StartContext context) throws StartException { pathHandler.clearPaths(); - SecureRandomSessionIdGenerator generator = new SecureRandomSessionIdGenerator(); - pathHandler.addPrefixPath(AFFINITY_PATH, exchange -> { + // add in a handler for servicing affinity requests from Wildfly HTTP client + pathHandler.addPrefixPath(COMMON_PATH, getAffinityServiceHandler()); + } + + /** + * An HttpHandler for handling affinity requests from a Wildfly HTTP client application. + * + * This handler is wrapped by HttpServiceConfig.wrap() to allow it to participate in the ee interoperability + * protocol, used by HTTP client applications to permit interoperability between jakarta and javax clients + * and servers. + * + * @return the HttpHandler + */ + private HttpHandler getAffinityServiceHandler() { + PathHandler wrappedHandler = new PathHandler(); + SecureRandomSessionIdGenerator generator = new SecureRandomSessionIdGenerator(); + wrappedHandler.addPrefixPath(AFFINITY_PATH, exchange -> { String resolved = exchange.getResolvedPath(); - int index = resolved.lastIndexOf(AFFINITY_PATH); + int index = resolved.lastIndexOf(COMMON_PATH); if(index > 0) { resolved = resolved.substring(0, index); } exchange.getResponseCookies().put("JSESSIONID", new CookieImpl("JSESSIONID", generator.createSessionId()).setPath(resolved)); }); + return HttpServiceConfig.getInstance().wrap(wrappedHandler); } @Override diff --git a/undertow/src/main/java/org/wildfly/extension/undertow/UndertowSubsystemSchema.java b/undertow/src/main/java/org/wildfly/extension/undertow/UndertowSubsystemSchema.java index 37681081071b..af9840c55067 100644 --- a/undertow/src/main/java/org/wildfly/extension/undertow/UndertowSubsystemSchema.java +++ b/undertow/src/main/java/org/wildfly/extension/undertow/UndertowSubsystemSchema.java @@ -22,9 +22,9 @@ package org.wildfly.extension.undertow; -import org.jboss.as.controller.LegacySubsystemURN; import org.jboss.as.controller.PersistentResourceXMLDescription; import org.jboss.as.controller.PersistentSubsystemSchema; +import org.jboss.as.controller.SubsystemSchema; import org.jboss.as.controller.xml.VersionedNamespace; import org.jboss.staxmapper.IntVersion; @@ -66,7 +66,7 @@ public enum UndertowSubsystemSchema implements PersistentSubsystemSchema(UndertowExtension.SUBSYSTEM_NAME, version); + this.namespace = SubsystemSchema.createLegacySubsystemURN(UndertowExtension.SUBSYSTEM_NAME, version); } @Override diff --git a/undertow/src/main/java/org/wildfly/extension/undertow/WelcomeFileDefinition.java b/undertow/src/main/java/org/wildfly/extension/undertow/WelcomeFileDefinition.java index 17d92e784970..237ba77e9125 100644 --- a/undertow/src/main/java/org/wildfly/extension/undertow/WelcomeFileDefinition.java +++ b/undertow/src/main/java/org/wildfly/extension/undertow/WelcomeFileDefinition.java @@ -43,7 +43,7 @@ class WelcomeFileDefinition extends PersistentResourceDefinition { WelcomeFileDefinition() { super(new SimpleResourceDefinition.Parameters(PATH_ELEMENT, UndertowExtension.getResolver(PATH_ELEMENT.getKey())) .setAddHandler(new ReloadRequiredAddStepHandler()) - .setRemoveHandler(new ReloadRequiredRemoveStepHandler()) + .setRemoveHandler(ReloadRequiredRemoveStepHandler.INSTANCE) ); } diff --git a/undertow/src/main/java/org/wildfly/extension/undertow/filters/FilterDefinitions.java b/undertow/src/main/java/org/wildfly/extension/undertow/filters/FilterDefinitions.java index c2533b9ecd9a..c3f032acb053 100644 --- a/undertow/src/main/java/org/wildfly/extension/undertow/filters/FilterDefinitions.java +++ b/undertow/src/main/java/org/wildfly/extension/undertow/filters/FilterDefinitions.java @@ -26,12 +26,12 @@ import java.util.Collections; import java.util.List; -import org.jboss.as.controller.AbstractAddStepHandler; import org.jboss.as.controller.AttributeDefinition; +import org.jboss.as.controller.ModelOnlyAddStepHandler; +import org.jboss.as.controller.ModelOnlyRemoveStepHandler; import org.jboss.as.controller.PathAddress; import org.jboss.as.controller.PathElement; import org.jboss.as.controller.PersistentResourceDefinition; -import org.jboss.as.controller.ReloadRequiredRemoveStepHandler; import org.jboss.as.controller.registry.AliasEntry; import org.jboss.as.controller.registry.ManagementResourceRegistration; import org.wildfly.extension.undertow.Constants; @@ -45,8 +45,8 @@ public class FilterDefinitions extends PersistentResourceDefinition { public FilterDefinitions() { super(PATH_ELEMENT, UndertowExtension.getResolver(PATH_ELEMENT.getValue()), - new AbstractAddStepHandler(), - ReloadRequiredRemoveStepHandler.INSTANCE + new ModelOnlyAddStepHandler(), + ModelOnlyRemoveStepHandler.INSTANCE ); } diff --git a/undertow/src/main/java/org/wildfly/extension/undertow/handlers/HandlerDefinitions.java b/undertow/src/main/java/org/wildfly/extension/undertow/handlers/HandlerDefinitions.java index 7ff63f28b25a..dcd3d77a1585 100644 --- a/undertow/src/main/java/org/wildfly/extension/undertow/handlers/HandlerDefinitions.java +++ b/undertow/src/main/java/org/wildfly/extension/undertow/handlers/HandlerDefinitions.java @@ -26,11 +26,11 @@ import java.util.Collections; import java.util.List; -import org.jboss.as.controller.AbstractAddStepHandler; import org.jboss.as.controller.AttributeDefinition; +import org.jboss.as.controller.ModelOnlyAddStepHandler; +import org.jboss.as.controller.ModelOnlyRemoveStepHandler; import org.jboss.as.controller.PathElement; import org.jboss.as.controller.PersistentResourceDefinition; -import org.jboss.as.controller.ReloadRequiredRemoveStepHandler; import org.jboss.as.controller.SimpleResourceDefinition; import org.wildfly.extension.undertow.Constants; import org.wildfly.extension.undertow.UndertowExtension; @@ -43,8 +43,8 @@ public class HandlerDefinitions extends PersistentResourceDefinition { public HandlerDefinitions() { super(new SimpleResourceDefinition.Parameters(PATH_ELEMENT, UndertowExtension.getResolver(PATH_ELEMENT.getValue())) - .setAddHandler(new AbstractAddStepHandler()) - .setRemoveHandler(ReloadRequiredRemoveStepHandler.INSTANCE) + .setAddHandler(new ModelOnlyAddStepHandler()) + .setRemoveHandler(ModelOnlyRemoveStepHandler.INSTANCE) ); } diff --git a/undertow/src/main/java/org/wildfly/extension/undertow/session/SharedSessionConfigSchema.java b/undertow/src/main/java/org/wildfly/extension/undertow/session/SharedSessionConfigSchema.java index e5e7e0de4cf3..54451aaf332b 100644 --- a/undertow/src/main/java/org/wildfly/extension/undertow/session/SharedSessionConfigSchema.java +++ b/undertow/src/main/java/org/wildfly/extension/undertow/session/SharedSessionConfigSchema.java @@ -22,10 +22,12 @@ package org.wildfly.extension.undertow.session; +import java.util.List; + import javax.xml.stream.XMLStreamException; +import org.jboss.as.controller.xml.IntVersionSchema; import org.jboss.as.controller.xml.VersionedNamespace; -import org.jboss.as.controller.xml.VersionedURN; import org.jboss.as.server.deployment.DeploymentUnit; import org.jboss.as.server.deployment.jbossallxml.JBossAllSchema; import org.jboss.as.web.session.SharedSessionManagerConfig; @@ -42,7 +44,7 @@ public enum SharedSessionConfigSchema implements JBossAllSchema namespace; SharedSessionConfigSchema(int major, int minor) { - this.namespace = new VersionedURN<>(VersionedURN.JBOSS_IDENTIFIER, this.getLocalName(), new IntVersion(major, minor)); + this.namespace = IntVersionSchema.createURN(List.of(IntVersionSchema.JBOSS_IDENTIFIER, this.getLocalName()), new IntVersion(major, minor)); } @Override diff --git a/web-common/pom.xml b/web-common/pom.xml index 9116d80eabb2..301fad05de60 100644 --- a/web-common/pom.xml +++ b/web-common/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-web-common diff --git a/webservices/opensaml-sysconfig/pom.xml b/webservices/opensaml-sysconfig/pom.xml index dc45322fae8d..f55fa8bbe99f 100644 --- a/webservices/opensaml-sysconfig/pom.xml +++ b/webservices/opensaml-sysconfig/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-webservices-opensaml-sysconfig diff --git a/webservices/pom.xml b/webservices/pom.xml index e87db82f86bf..4ee8f87109e0 100644 --- a/webservices/pom.xml +++ b/webservices/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-webservices diff --git a/webservices/server-integration/pom.xml b/webservices/server-integration/pom.xml index 34854b76e825..ea9be5b8263f 100644 --- a/webservices/server-integration/pom.xml +++ b/webservices/server-integration/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-webservices-server-integration diff --git a/webservices/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSDependenciesProcessor.java b/webservices/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSDependenciesProcessor.java index b18c0a616c63..c10dfb634878 100644 --- a/webservices/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSDependenciesProcessor.java +++ b/webservices/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSDependenciesProcessor.java @@ -30,7 +30,6 @@ import org.jboss.as.server.deployment.module.ModuleSpecification; import org.jboss.modules.Module; import org.jboss.modules.ModuleLoader; -import org.jboss.wsf.spi.deployment.Endpoint; /** * A DUP that sets the WS dependencies @@ -46,7 +45,6 @@ public final class WSDependenciesProcessor implements DeploymentUnitProcessor { "jakarta.xml.ws.api", "jakarta.xml.soap.api" }; - public static final String XERCES_IMPL = "org.apache.xerces"; private final boolean addJBossWSDependencies; @@ -65,11 +63,5 @@ public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitPro for(String api : JAVAEE_APIS) { moduleSpec.addSystemDependency(new ModuleDependency(moduleLoader, api, false, false, true, false)); } - - //After jboss modules 2.0, the xerces module is not added and this is required for jaxb 2.3.x(EE8) to pass the TCK - //But this is not needed for jaxb 3.x in WildFly Preview(EE10) - if (Endpoint.class.getPackage().getImplementationVersion().startsWith("3")) { - moduleSpec.addSystemDependency(new ModuleDependency(moduleLoader, XERCES_IMPL, true, false, true, false)); - } } } diff --git a/webservices/tests-integration/pom.xml b/webservices/tests-integration/pom.xml index ecf18c768aeb..73b8585a0e50 100644 --- a/webservices/tests-integration/pom.xml +++ b/webservices/tests-integration/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-webservices-tests-integration diff --git a/weld/bean-validation/pom.xml b/weld/bean-validation/pom.xml index 74022e7efd63..e75b0aa522a2 100644 --- a/weld/bean-validation/pom.xml +++ b/weld/bean-validation/pom.xml @@ -10,7 +10,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-weld-bean-validation diff --git a/weld/common/pom.xml b/weld/common/pom.xml index 4956764889e2..b3b598773a50 100644 --- a/weld/common/pom.xml +++ b/weld/common/pom.xml @@ -10,7 +10,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-weld-common diff --git a/weld/ejb/pom.xml b/weld/ejb/pom.xml index 54b7843a2067..df218f472eae 100644 --- a/weld/ejb/pom.xml +++ b/weld/ejb/pom.xml @@ -10,7 +10,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-weld-ejb diff --git a/weld/jpa/pom.xml b/weld/jpa/pom.xml index e245197955f1..3262594c8254 100644 --- a/weld/jpa/pom.xml +++ b/weld/jpa/pom.xml @@ -10,7 +10,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-weld-jpa diff --git a/weld/pom.xml b/weld/pom.xml index 49713b7aaf65..27f14d4e1fa7 100644 --- a/weld/pom.xml +++ b/weld/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT ../pom.xml diff --git a/weld/spi/pom.xml b/weld/spi/pom.xml index f0cf1b47574f..35fed24e1d04 100644 --- a/weld/spi/pom.xml +++ b/weld/spi/pom.xml @@ -10,7 +10,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-weld-spi diff --git a/weld/subsystem/pom.xml b/weld/subsystem/pom.xml index 920f547301a4..e5267c8c3b5c 100644 --- a/weld/subsystem/pom.xml +++ b/weld/subsystem/pom.xml @@ -10,7 +10,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-weld diff --git a/weld/transactions/pom.xml b/weld/transactions/pom.xml index 1eeb1cf88445..df2d3ef2b0d3 100644 --- a/weld/transactions/pom.xml +++ b/weld/transactions/pom.xml @@ -10,7 +10,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-weld-transactions diff --git a/weld/webservices/pom.xml b/weld/webservices/pom.xml index 5c7feea688ef..ae401f0987a9 100644 --- a/weld/webservices/pom.xml +++ b/weld/webservices/pom.xml @@ -11,7 +11,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT ../pom.xml diff --git a/xts/pom.xml b/xts/pom.xml index 18454bb3bcf9..f0fd336c2f77 100644 --- a/xts/pom.xml +++ b/xts/pom.xml @@ -33,7 +33,7 @@ Maintain separation between the artifact id and the version to help prevent merge conflicts between commits changing the GA and those changing the V. --> - 29.0.0.Beta1-SNAPSHOT + 30.0.0.Beta1-SNAPSHOT wildfly-xts