From cc566fd0386a9b0e516f62841bc77da236d662db Mon Sep 17 00:00:00 2001 From: Manfred Riem Date: Sun, 20 Oct 2024 14:27:35 -0500 Subject: [PATCH] Move to EE 11 (#4074) --- VERSIONS.md | 19 ++- bom/pom.xml | 37 ++-- cli/cli/pom.xml | 28 --- .../src/main/java/cloud/piranha/cli/Cli.java | 99 ----------- .../cloud/piranha/cli/CoreProfileCommand.java | 92 ---------- .../cli/CoreProfileDownloadCommand.java | 159 ------------------ .../piranha/cli/CoreProfileRunCommand.java | 126 -------------- .../piranha/cli/CoreProfileStartCommand.java | 126 -------------- .../piranha/cli/CoreProfileStopCommand.java | 97 ----------- cli/cli/src/main/resources/VERSION | 1 - cli/macos/pom.xml | 51 ------ cli/pom.xml | 50 ------ .../impl/DefaultWebApplicationResponse.java | 13 +- .../DefaultWebApplicationRequestTest.java | 2 +- .../DefaultWebApplicationResponseTest.java | 14 +- extension/eclipse-concurro/pom.xml | 44 +++++ .../extension/concurro/ConcurroExtension.java | 50 ++---- .../src/main/java/module-info.java | 32 ++-- extension/eclipse-epicyro/pom.xml | 5 + extension/eclipse-exousia/pom.xml | 12 ++ .../exousia/AuthorizationPreInitializer.java | 22 ++- .../exousia/PiranhaPrincipalMapper.java | 28 +-- extension/eclipse-soteria/pom.xml | 5 + .../wrappers/EntityManagerWrapper.java | 92 +++++++++- extension/platform/pom.xml | 6 + extension/pom.xml | 1 + extension/redhat-weld/pom.xml | 14 +- .../src/main/java/module-info.java | 2 + .../src/main/java/module-info.java | 4 +- extension/webprofile/pom.xml | 6 + external/tck/el/pom.xml | 4 +- external/tck/wasp/pom.xml | 6 +- pom.xml | 47 ++++-- test/debug/pom.xml | 6 - test/embedded/exousia/pom.xml | 5 + uber/pom.xml | 15 ++ 36 files changed, 345 insertions(+), 975 deletions(-) delete mode 100644 cli/cli/pom.xml delete mode 100644 cli/cli/src/main/java/cloud/piranha/cli/Cli.java delete mode 100644 cli/cli/src/main/java/cloud/piranha/cli/CoreProfileCommand.java delete mode 100644 cli/cli/src/main/java/cloud/piranha/cli/CoreProfileDownloadCommand.java delete mode 100644 cli/cli/src/main/java/cloud/piranha/cli/CoreProfileRunCommand.java delete mode 100644 cli/cli/src/main/java/cloud/piranha/cli/CoreProfileStartCommand.java delete mode 100644 cli/cli/src/main/java/cloud/piranha/cli/CoreProfileStopCommand.java delete mode 100644 cli/cli/src/main/resources/VERSION delete mode 100644 cli/macos/pom.xml delete mode 100644 cli/pom.xml create mode 100644 extension/eclipse-concurro/pom.xml rename cli/cli/src/main/java/cloud/piranha/cli/Util.java => extension/eclipse-concurro/src/main/java/cloud/piranha/extension/concurro/ConcurroExtension.java (61%) rename cli/cli/src/main/java/cloud/piranha/cli/VersionCommand.java => extension/eclipse-concurro/src/main/java/module-info.java (80%) create mode 100644 uber/pom.xml diff --git a/VERSIONS.md b/VERSIONS.md index daf5760525..a7e5d85d7a 100644 --- a/VERSIONS.md +++ b/VERSIONS.md @@ -10,17 +10,20 @@ used by Piranha to deliver various bits and pieces of functionality. | Arquillian | 1.8.0.Final | | Eclipse Angus Activation | 2.0.2 | | Eclipse Angus Mail | 2.0.3 | -| Eclipse Grizzly | 4.0.2 | +| Eclipse Epicyro | 3.1.0 | +| Eclipse Exousia | 3.0.0-M1.1 | +| Eclipse Expressly | 6.0.0-M2 | +| Eclipse Grizzly | 4.1.0-M1 | | Eclipse Grizzly NPN | 2.0.0 | | Eclipse JAXB | 4.0.5 | -| Eclipse Jersey | 3.1.8 | +| Eclipse Jersey | 3.1.7 | | Eclipse JSTL | 3.0.1 | -| Eclipse Mojarra | 4.0.7 | -| Eclipse Parsson | 1.1.6 | -| Eclipse Soteria | 3.0.3 | -| Eclipse Tyrus | 2.1.5 | +| Eclipse Mojarra | 4.1.0 | +| Eclipse Parsson | 1.1.7 | +| Eclipse Soteria | 4.0.0-M3 | +| Eclipse Tyrus | 2.2.0-M1 | | Eclipse Yasson | 3.0.4 | -| EclipseLink | 4.0.4 | +| EclipseLink | 5.0.0-B02 | | Hazelcast | 5.4.0 | | Netty | 4.1.112.Final | | OmniFaces Services | 0.4 | @@ -29,4 +32,4 @@ used by Piranha to deliver various bits and pieces of functionality. | Project CRaC | 0.1.3 | | Spring Boot | 3.3.0 | | Undertow | 2.3.14.Final | -| Weld | 5.1.3.Final | +| Weld | 6.0.0.Beta1 | diff --git a/bom/pom.xml b/bom/pom.xml index f1498d58f4..57ceb511af 100644 --- a/bom/pom.xml +++ b/bom/pom.xml @@ -16,28 +16,29 @@ 2.1.3 - 2.1.1 - 3.0.0 - 2.1.0 + 3.0.0 + 3.1.0 + 3.0.0 + 3.1.1 4.0.1 - 5.0.1 - 4.0.1 - 4.0.1 + 6.0.0 + 4.1.0 + 4.1.0 2.0.1.MR - 10.0.0 - 10.0.0 + 11.0.0-M4 + 11.0.0-M4 2.1.3 2.1.3 3.0.1 - 3.1.0 - 3.0.0 - 6.0.0 - 3.1.1 + 3.2.0 + 4.0.0 + 6.1.0 + 4.0.0 3.0.1 2.0.1 - 3.0.2 - 2.1.1 - 3.1.0 + 3.1.0 + 2.2.0 + 4.0.0 4.0.2 UTF-8 @@ -68,6 +69,12 @@ jakarta.authorization-api ${jakarta.authorization-api.version} + + + jakarta.enterprise.concurrent + jakarta.enterprise.concurrent-api + ${jakarta.enterprise.concurrent-api.version} + jakarta.enterprise diff --git a/cli/cli/pom.xml b/cli/cli/pom.xml deleted file mode 100644 index e25160d461..0000000000 --- a/cli/cli/pom.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - 4.0.0 - - - cloud.piranha.cli - project - 24.11.0-SNAPSHOT - - - piranha-cli - jar - - Piranha - CLI - - - - - src/main/resources - true - - VERSION - - - - - diff --git a/cli/cli/src/main/java/cloud/piranha/cli/Cli.java b/cli/cli/src/main/java/cloud/piranha/cli/Cli.java deleted file mode 100644 index 5ed9c56867..0000000000 --- a/cli/cli/src/main/java/cloud/piranha/cli/Cli.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) 2002-2024 Manorrock.com. All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ -package cloud.piranha.cli; - -import static cloud.piranha.cli.Util.stripFirstElement; - -/** - * The Piranha CLI. - * - * @author Manfred Riem (mriem@manorrock.com) - */ -public class Cli { - - /** - * Stores the arguments. - */ - private String[] arguments; - - /** - * Constructor. - */ - public Cli() { - } - - /** - * Main method. - * - * @param arguments the command-line arguments. - */ - public static void main(String[] arguments) { - Cli cli = new Cli(); - cli.arguments = arguments; - cli.run(); - } - - /** - * Run method. - */ - public void run() { - if (arguments.length == 0) { - usage(); - } else { - switch (arguments[0]) { - case "coreprofile" -> new CoreProfileCommand(stripFirstElement(arguments)).run(); - case "help" -> usage(); - case "version" -> new VersionCommand(stripFirstElement(arguments)).run(); - } - } - } - - /** - * Set the command-line arguments. - * - * @param arguments the command-line arguments. - */ - public void setArguments(String[] arguments) { - this.arguments = arguments; - } - - /** - * Show the help. - */ - private void usage() { - System.out.println(); - System.out.println("usage: piranha [command] [subcommand]"); - System.out.println(); - System.out.println("Available commands:"); - System.out.println(); - System.out.println(" coreprofile : Piranha Core Profile commands"); - System.out.println(" help : Show help"); - System.out.println(" version : Show version"); - System.out.println(); - } -} diff --git a/cli/cli/src/main/java/cloud/piranha/cli/CoreProfileCommand.java b/cli/cli/src/main/java/cloud/piranha/cli/CoreProfileCommand.java deleted file mode 100644 index 01926b4ce3..0000000000 --- a/cli/cli/src/main/java/cloud/piranha/cli/CoreProfileCommand.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2002-2024 Manorrock.com. All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ -package cloud.piranha.cli; - -import static cloud.piranha.cli.Util.stripFirstElement; - -/** - * The version command. - * - * @author Manfred Riem (mriem@manorrock.com) - */ -public class CoreProfileCommand implements Runnable { - - /** - * Stores the arguments. - */ - private final String[] arguments; - - /** - * Constructor. - * - * @param arguments the arguments. - */ - public CoreProfileCommand(String[] arguments) { - this.arguments = arguments; - } - - /** - * Run the command. - */ - @Override - public void run() { - if (arguments.length == 0) { - usage(); - } else { - switch (arguments[0]) { - case "download" -> new CoreProfileDownloadCommand(stripFirstElement(arguments)).run(); - case "run" -> new CoreProfileRunCommand(stripFirstElement(arguments)).run(); - case "start" -> new CoreProfileStartCommand(stripFirstElement(arguments)).run(); - case "stop" -> new CoreProfileStopCommand(stripFirstElement(arguments)).run(); - case "help" -> usage(); - } - } - } - - - /** - * Show the help. - */ - private void usage() { - System.out.println(); - System.out.println("usage: piranha coreprofile [command] "); - System.out.println(); - System.out.println("Available commands:"); - System.out.println(); - System.out.println(" download : Download the Piranha Core Profile distribution"); - System.out.println(" help : Show help"); - System.out.println(); - System.out.println(); - System.out.println("Command: download"); - System.out.println("-----------------"); - System.out.println(); - System.out.println("Available options:"); - System.out.println(); - System.out.println(" --outputDirectory : specify the output directory"); - } -} diff --git a/cli/cli/src/main/java/cloud/piranha/cli/CoreProfileDownloadCommand.java b/cli/cli/src/main/java/cloud/piranha/cli/CoreProfileDownloadCommand.java deleted file mode 100644 index de47163f44..0000000000 --- a/cli/cli/src/main/java/cloud/piranha/cli/CoreProfileDownloadCommand.java +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Copyright (c) 2002-2024 Manorrock.com. All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ -package cloud.piranha.cli; - -import static cloud.piranha.cli.Util.version; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.net.MalformedURLException; -import java.net.URL; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.nio.file.StandardCopyOption; - -/** - * The coreprofile download command. - * - * @author Manfred Riem (mriem@manorrock.com) - */ -public class CoreProfileDownloadCommand implements Runnable { - - /** - * Stores the Maven central prefix. - */ - private static final String MAVEN_CENTRAL_PREFIX - = "https://repo1.maven.org/maven2/cloud/piranha/dist/"; - - /** - * Stores the Sonatype SNAPSHOTs prefix. - */ - private static final String SONATYPE_SNAPSHOTS_PREFIX - = "https://oss.sonatype.org/content/repositories/snapshots/cloud/piranha/dist/"; - - /** - * Stores the arguments. - */ - private final String[] arguments; - - /** - * Stores the filename we are going to download to. - */ - private String filename = "piranha-dist-coreprofile-" + version() + ".jar"; - - /** - * Stores the output directory. - */ - private File outputDirectory = new File(System.getProperty("user.home"), - ".piranha/coreprofile/download"); - - /** - * Stores the URL we are going to download. - */ - private URL url; - - /** - * Stores the version we are downloading. - */ - private String version = "24.3.0"; - - /** - * Constructor. - * - * @param arguments the arguments. - */ - public CoreProfileDownloadCommand(String[] arguments) { - this.arguments = arguments; - } - - /** - * Download a release version. - */ - private void downloadRelease() { - String urlString = MAVEN_CENTRAL_PREFIX + "piranha-dist-coreprofile/" - + version + "/piranha-dist-coreprofile-" + version + ".jar"; - filename = "piranha-dist-coreprofile-" + version + ".jar"; - - try { - url = new URL(urlString); - } catch (MalformedURLException mue) { - mue.printStackTrace(System.out); - System.exit(0); - } - - downloadUrl(); - } - - /** - * Download a SNAPSHOT version. - */ - private void downloadSnapshot() { - String urlString = SONATYPE_SNAPSHOTS_PREFIX + "piranha-dist-coreprofile/" - + version + "/piranha-dist-coreprofile-" + version + ".jar"; - filename = "piranha-dist-coreprofile-" + version + ".jar"; - - try { - url = new URL(urlString); - } catch (MalformedURLException mue) { - mue.printStackTrace(System.out); - System.exit(0); - } - - downloadUrl(); - } - - /** - * Download the URL. - */ - private void downloadUrl() { - System.out.println("Downloading Piranha Core Profile - " + version); - System.out.println("From - " + url); - System.out.println("To - " + outputDirectory); - - if (!outputDirectory.exists()) { - outputDirectory.mkdirs(); - } - - try (InputStream in = url.openStream()) { - Files.copy(in, Paths.get(new File(outputDirectory, filename).toURI()), - StandardCopyOption.REPLACE_EXISTING); - } catch (IOException ioe) { - ioe.printStackTrace(System.out); - System.exit(0); - } - } - - @Override - public void run() { - if (version.endsWith("-SNAPSHOT")) { - downloadSnapshot(); - } else { - downloadRelease(); - } - } -} diff --git a/cli/cli/src/main/java/cloud/piranha/cli/CoreProfileRunCommand.java b/cli/cli/src/main/java/cloud/piranha/cli/CoreProfileRunCommand.java deleted file mode 100644 index 6588512a3a..0000000000 --- a/cli/cli/src/main/java/cloud/piranha/cli/CoreProfileRunCommand.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright (c) 2002-2024 Manorrock.com. All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ -package cloud.piranha.cli; - -import static cloud.piranha.cli.Util.version; -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; - -/** - * The coreprofile run command. - * - * @author Manfred Riem (mriem@manorrock.com) - */ -public class CoreProfileRunCommand implements Runnable { - - /** - * Stores the arguments. - */ - private final String[] arguments; - - /** - * Stores the distribution filename we are going use. - */ - private String distributionFilename = "piranha-dist-coreprofile-" + version() + ".jar"; - - /** - * Stores the distribution directory. - */ - private File distributionDirectory = new File(System.getProperty("user.home"), - ".piranha/coreprofile/download"); - - /** - * Stores the run arguments (--arguments). - */ - private String runArguments; - - /** - * Stores the version we are using. - */ - private String version = "24.3.0"; - - /** - * Constructor. - * - * @param arguments the arguments. - */ - public CoreProfileRunCommand(String[] arguments) { - this.arguments = arguments; - } - - @Override - public void run() { - parseArguments(); - distributionFilename = "piranha-dist-coreprofile-" + version + ".jar"; - File distributionJarFile = new File(distributionDirectory, distributionFilename); - if (distributionJarFile.exists()) { - runPiranhaCoreProfile(); - } else { - System.out.println(distributionJarFile.toString() + " not found"); - } - } - - /** - * Parse the command-line arguments. - */ - private void parseArguments() { - System.out.println("Parse arguments"); - for (int i = 0; i < arguments.length; i++) { - if (arguments[i].equals("--arguments")) { - runArguments = arguments[i + 1]; - } - if (arguments[i].equals("--version")) { - version = arguments[i + 1]; - } - } - } - - /** - * Run Piranha Core Profile. - */ - private void runPiranhaCoreProfile() { - try { - distributionFilename = "piranha-dist-coreprofile-" + version + ".jar"; - File distributionJarFile = new File(distributionDirectory, distributionFilename); - System.out.println("Run Piranha Core Profile"); - ProcessBuilder builder = new ProcessBuilder(); - ArrayList processCommands = new ArrayList<>(); - processCommands.add("java"); - processCommands.add("-jar"); - processCommands.add(distributionJarFile.getAbsolutePath()); - if (runArguments != null) { - processCommands.add(runArguments); - } - Process process = builder.command(processCommands).inheritIO().start(); - System.exit(process.waitFor()); - } catch (IOException | InterruptedException ex) { - ex.printStackTrace(System.err); - } - } -} diff --git a/cli/cli/src/main/java/cloud/piranha/cli/CoreProfileStartCommand.java b/cli/cli/src/main/java/cloud/piranha/cli/CoreProfileStartCommand.java deleted file mode 100644 index bb4d9b53f7..0000000000 --- a/cli/cli/src/main/java/cloud/piranha/cli/CoreProfileStartCommand.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright (c) 2002-2024 Manorrock.com. All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ -package cloud.piranha.cli; - -import static cloud.piranha.cli.Util.version; -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; - -/** - * The coreprofile start command. - * - * @author Manfred Riem (mriem@manorrock.com) - */ -public class CoreProfileStartCommand implements Runnable { - - /** - * Stores the arguments. - */ - private final String[] arguments; - - /** - * Stores the distribution filename we are going use. - */ - private String distributionFilename = "piranha-dist-coreprofile-" + version() + ".jar"; - - /** - * Stores the distribution directory. - */ - private File distributionDirectory = new File(System.getProperty("user.home"), - ".piranha/coreprofile/download"); - - /** - * Stores the run arguments (--arguments). - */ - private String runArguments; - - /** - * Stores the version we are using. - */ - private String version = "24.3.0"; - - /** - * Constructor. - * - * @param arguments the arguments. - */ - public CoreProfileStartCommand(String[] arguments) { - this.arguments = arguments; - } - - @Override - public void run() { - parseArguments(); - distributionFilename = "piranha-dist-coreprofile-" + version + ".jar"; - File distributionJarFile = new File(distributionDirectory, distributionFilename); - if (distributionJarFile.exists()) { - startPiranhaCoreProfile(); - } else { - System.out.println(distributionJarFile.toString() + " not found"); - } - } - - /** - * Parse the command-line arguments. - */ - private void parseArguments() { - System.out.println("Parse arguments"); - for (int i = 0; i < arguments.length; i++) { - if (arguments[i].equals("--arguments")) { - runArguments = arguments[i + 1]; - } - if (arguments[i].equals("--version")) { - version = arguments[i + 1]; - } - } - } - - /** - * Start Piranha Core Profile. - */ - private void startPiranhaCoreProfile() { - try { - distributionFilename = "piranha-dist-coreprofile-" + version + ".jar"; - File distributionJarFile = new File(distributionDirectory, distributionFilename); - System.out.println("Start Piranha Core Profile"); - ProcessBuilder builder = new ProcessBuilder(); - ArrayList processCommands = new ArrayList<>(); - processCommands.add("java"); - processCommands.add("-jar"); - processCommands.add(distributionJarFile.getAbsolutePath()); - processCommands.add("--write-pid"); - if (runArguments != null) { - processCommands.add(runArguments); - } - Process process = builder.command(processCommands).inheritIO().start(); - } catch (IOException ioe) { - ioe.printStackTrace(System.err); - } - } -} diff --git a/cli/cli/src/main/java/cloud/piranha/cli/CoreProfileStopCommand.java b/cli/cli/src/main/java/cloud/piranha/cli/CoreProfileStopCommand.java deleted file mode 100644 index 5fc9cfe752..0000000000 --- a/cli/cli/src/main/java/cloud/piranha/cli/CoreProfileStopCommand.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (c) 2002-2024 Manorrock.com. All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ -package cloud.piranha.cli; - -import static cloud.piranha.cli.Util.version; -import java.io.File; - -/** - * The coreprofile stop command. - * - * @author Manfred Riem (mriem@manorrock.com) - */ -public class CoreProfileStopCommand implements Runnable { - - /** - * Stores the arguments. - */ - private final String[] arguments; - - /** - * Stores the distribution filename we are going use. - */ - private String distributionFilename = "piranha-dist-coreprofile-" + version() + ".jar"; - - /** - * Stores the distribution directory. - */ - private File distributionDirectory = new File(System.getProperty("user.home"), - ".piranha/coreprofile/download"); - - /** - * Stores the run arguments (--arguments). - */ - private String runArguments; - - /** - * Stores the version we are using. - */ - private String version = "24.3.0"; - - /** - * Constructor. - * - * @param arguments the arguments. - */ - public CoreProfileStopCommand(String[] arguments) { - this.arguments = arguments; - } - - @Override - public void run() { - parseArguments(); - stopPiranhaCoreProfile(); - } - - /** - * Parse the command-line arguments. - */ - private void parseArguments() { - System.out.println("Parse arguments"); - } - - /** - * Stop Piranha Core Profile. - */ - private void stopPiranhaCoreProfile() { - File pidFile = new File("piranha.pid"); - if (pidFile.exists()) { - pidFile.delete(); - } - } -} diff --git a/cli/cli/src/main/resources/VERSION b/cli/cli/src/main/resources/VERSION deleted file mode 100644 index 17851514a7..0000000000 --- a/cli/cli/src/main/resources/VERSION +++ /dev/null @@ -1 +0,0 @@ -${pom.version} \ No newline at end of file diff --git a/cli/macos/pom.xml b/cli/macos/pom.xml deleted file mode 100644 index 8ae3f4187f..0000000000 --- a/cli/macos/pom.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - 4.0.0 - - - cloud.piranha.cli - project - 24.11.0-SNAPSHOT - - - piranha-cli-macos - pom - - Piranha - CLI - macOS - - - - macos - - - - org.graalvm.nativeimage - native-image-maven-plugin - - - - native-image - - package - - - - -H:+UnlockExperimentalVMOptions --no-fallback --install-exit-handlers - piranha - cloud.piranha.cli.Cli - false - - - - - - - cloud.piranha.cli - piranha-cli - ${project.version} - - - - - diff --git a/cli/pom.xml b/cli/pom.xml deleted file mode 100644 index 52eff5805c..0000000000 --- a/cli/pom.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - 4.0.0 - - cloud.piranha - project - 24.11.0-SNAPSHOT - - cloud.piranha.cli - project - pom - - Piranha - CLI - Project - - - cli - macos - - - - - - cloud.piranha - bom - ${project.version} - pom - import - - - - - - - org.junit.jupiter - junit-jupiter-api - test - - - org.junit.jupiter - junit-jupiter-engine - test - - - org.junit.jupiter - junit-jupiter-params - test - - - diff --git a/core/impl/src/main/java/cloud/piranha/core/impl/DefaultWebApplicationResponse.java b/core/impl/src/main/java/cloud/piranha/core/impl/DefaultWebApplicationResponse.java index 207db1e587..200e443ed6 100644 --- a/core/impl/src/main/java/cloud/piranha/core/impl/DefaultWebApplicationResponse.java +++ b/core/impl/src/main/java/cloud/piranha/core/impl/DefaultWebApplicationResponse.java @@ -529,12 +529,19 @@ public void sendError(int status, String statusMessage) throws IOException { */ setHeader("sendErrorCalled", "true"); } - + @Override public void sendRedirect(String location) throws IOException { + sendRedirect(location, SC_FOUND, true); + } + + @Override + public void sendRedirect(String location, int status, boolean resetBuffer) throws IOException { verifyNotCommitted("sendRedirect"); - resetBuffer(); - setStatus(SC_FOUND); + if (resetBuffer) { + resetBuffer(); + } + setStatus(status); URL url; try { url = new URL(location); diff --git a/core/impl/src/test/java/cloud/piranha/core/impl/DefaultWebApplicationRequestTest.java b/core/impl/src/test/java/cloud/piranha/core/impl/DefaultWebApplicationRequestTest.java index a0ab7d6009..dfe04b9198 100644 --- a/core/impl/src/test/java/cloud/piranha/core/impl/DefaultWebApplicationRequestTest.java +++ b/core/impl/src/test/java/cloud/piranha/core/impl/DefaultWebApplicationRequestTest.java @@ -945,7 +945,7 @@ void testSetCharacterEncoding3() { void testSetCharacterEncoding4() { DefaultWebApplicationRequest request = new DefaultWebApplicationRequest(); assertNotNull(assertThrows(UnsupportedEncodingException.class, - () -> request.setCharacterEncoding(null))); + () -> request.setCharacterEncoding((String) null))); } /** diff --git a/core/impl/src/test/java/cloud/piranha/core/impl/DefaultWebApplicationResponseTest.java b/core/impl/src/test/java/cloud/piranha/core/impl/DefaultWebApplicationResponseTest.java index b192bdc04d..267c2a5c12 100644 --- a/core/impl/src/test/java/cloud/piranha/core/impl/DefaultWebApplicationResponseTest.java +++ b/core/impl/src/test/java/cloud/piranha/core/impl/DefaultWebApplicationResponseTest.java @@ -192,10 +192,10 @@ void testFlushBuffer() { fail(); } } - + /** * Test flushBuffer method. - * + * * @throws Exception when a serious error occurs. */ @Test @@ -799,7 +799,7 @@ void testSetCharacterEncoding() { String defaultEncoding = response.getCharacterEncoding(); response.setCharacterEncoding("UTF-8"); assertTrue("UTF-8".equalsIgnoreCase(response.getCharacterEncoding())); - response.setCharacterEncoding(null); + response.setCharacterEncoding((String) null); assertTrue((defaultEncoding == null && response.getCharacterEncoding() == null) || (defaultEncoding != null && defaultEncoding.equalsIgnoreCase(response.getCharacterEncoding()))); } @@ -818,7 +818,7 @@ void testSetCharacterEncoding2() { String defaultEncoding = response.getCharacterEncoding(); response.setCharacterEncoding("UTF-8"); assertTrue("UTF-8".equalsIgnoreCase(response.getCharacterEncoding())); - response.setCharacterEncoding(null); + response.setCharacterEncoding((String) null); assertTrue((defaultEncoding == null && response.getCharacterEncoding() == null) || (defaultEncoding != null && defaultEncoding.equalsIgnoreCase(response.getCharacterEncoding()))); } @@ -872,12 +872,12 @@ void testSetCharacterEncoding5() { String defaultCharacterEncoding = response.getCharacterEncoding(); response.setCharacterEncoding("UTF-8"); assertEquals("UTF-8", response.getCharacterEncoding()); - response.setCharacterEncoding(null); + response.setCharacterEncoding((String) null); assertEquals(defaultCharacterEncoding, response.getCharacterEncoding()); response.reset(); response.setContentType("text/plain; charset=UTF-8"); assertEquals("UTF-8", response.getCharacterEncoding()); - response.setCharacterEncoding(null); + response.setCharacterEncoding((String) null); assertEquals(defaultCharacterEncoding, response.getCharacterEncoding()); response.reset(); response.setCharacterEncoding("does-not-exist"); @@ -888,7 +888,7 @@ void testSetCharacterEncoding5() { response.setCharacterEncoding("ISO-8859-7"); assertEquals("text/html;charset=ISO-8859-7", response.getContentType()); } - + /** * Test setCharacterEncoding method. */ diff --git a/extension/eclipse-concurro/pom.xml b/extension/eclipse-concurro/pom.xml new file mode 100644 index 0000000000..e405b8b303 --- /dev/null +++ b/extension/eclipse-concurro/pom.xml @@ -0,0 +1,44 @@ + + + + 4.0.0 + + cloud.piranha.extension + project + 24.11.0-SNAPSHOT + + piranha-extension-eclipse-concurro + jar + Piranha - Extension - Eclipse Concurro + + 3.1.0-M1 + + + + + cloud.piranha.core + piranha-core-api + ${project.version} + compile + + + + cloud.piranha.extension + piranha-extension-scinitializer + ${project.version} + provided + + + + jakarta.enterprise.concurrent + jakarta.enterprise.concurrent-api + runtime + + + org.glassfish + jakarta.enterprise.concurrent + ${concurro.version} + runtime + + + diff --git a/cli/cli/src/main/java/cloud/piranha/cli/Util.java b/extension/eclipse-concurro/src/main/java/cloud/piranha/extension/concurro/ConcurroExtension.java similarity index 61% rename from cli/cli/src/main/java/cloud/piranha/cli/Util.java rename to extension/eclipse-concurro/src/main/java/cloud/piranha/extension/concurro/ConcurroExtension.java index c493afc6fa..66873e414a 100644 --- a/cli/cli/src/main/java/cloud/piranha/cli/Util.java +++ b/extension/eclipse-concurro/src/main/java/cloud/piranha/extension/concurro/ConcurroExtension.java @@ -25,53 +25,33 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -package cloud.piranha.cli; +package cloud.piranha.extension.concurro; -import java.io.IOException; -import java.net.URISyntaxException; -import java.nio.file.Files; -import java.nio.file.Path; +import cloud.piranha.core.api.WebApplication; +import cloud.piranha.core.api.WebApplicationExtension; +import java.lang.System.Logger; +import static java.lang.System.Logger.Level.TRACE; /** - * Utility class. + * The extension that delivers Eclipse Concurro to Piranha. * * @author Manfred Riem (mriem@manorrock.com) */ -public class Util { +public class ConcurroExtension implements WebApplicationExtension { /** - * Private constructor. + * Stores the logger. */ - private Util() { - } - - /** - * Strip first element and return a new array. - * - * @param array the array. - * @return the copied array minus the first element. - */ - public static String[] stripFirstElement(String[] array) { - String[] newArray = new String[array.length - 1]; - for (int i = 1; i < array.length; i++) { - newArray[i - 1] = array[i]; - } - return newArray; - } + private static final Logger LOGGER = System.getLogger( + ConcurroExtension.class.getName()); /** - * Get the Piranha version. + * Configure the extension. * - * @return the Piranha version. + * @param webApplication the web application. */ - public static String version() { - String version; - try { - version = Files.readAllLines( - Path.of(Util.class.getResource("/VERSION").toURI())).get(0); - } catch (IOException | URISyntaxException e) { - version = e.getMessage(); - } - return version; + @Override + public void configure(WebApplication webApplication) { + LOGGER.log(TRACE, "Configuring Eclipse Concurro extension"); } } diff --git a/cli/cli/src/main/java/cloud/piranha/cli/VersionCommand.java b/extension/eclipse-concurro/src/main/java/module-info.java similarity index 80% rename from cli/cli/src/main/java/cloud/piranha/cli/VersionCommand.java rename to extension/eclipse-concurro/src/main/java/module-info.java index d76b110e6f..2e27cd4b86 100644 --- a/cli/cli/src/main/java/cloud/piranha/cli/VersionCommand.java +++ b/extension/eclipse-concurro/src/main/java/module-info.java @@ -25,30 +25,20 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -package cloud.piranha.cli; - -import static cloud.piranha.cli.Util.version; /** - * The version command. + * This module delivers the Eclipse Concurro integration extension. * + *

+ * This extension integrates Eclipse Conccuro into Piranha. See + * https://github.com/eclipse-ee4j/concurro for more information about its + * project. + *

+ * * @author Manfred Riem (mriem@manorrock.com) */ -public class VersionCommand implements Runnable { - - /** - * Constructor. - * - * @param arguments the arguments. - */ - public VersionCommand(String[] arguments) { - } - - /** - * Run the command. - */ - @Override - public void run() { - System.out.println(version()); - } +module cloud.piranha.extension.concurro { + + requires cloud.piranha.core.api; + requires static cloud.piranha.extension.scinitializer; } diff --git a/extension/eclipse-epicyro/pom.xml b/extension/eclipse-epicyro/pom.xml index 2e90ba78dd..1136fe6159 100644 --- a/extension/eclipse-epicyro/pom.xml +++ b/extension/eclipse-epicyro/pom.xml @@ -29,5 +29,10 @@ ${project.version} compile
+ + jakarta.authentication + jakarta.authentication-api + provided + diff --git a/extension/eclipse-exousia/pom.xml b/extension/eclipse-exousia/pom.xml index 7ab086da1e..97f887a289 100644 --- a/extension/eclipse-exousia/pom.xml +++ b/extension/eclipse-exousia/pom.xml @@ -40,5 +40,17 @@ + + + org.javassist + javassist + 3.29.2-GA + diff --git a/extension/eclipse-exousia/src/main/java/cloud/piranha/extension/exousia/AuthorizationPreInitializer.java b/extension/eclipse-exousia/src/main/java/cloud/piranha/extension/exousia/AuthorizationPreInitializer.java index 0db73c035f..6e4b596481 100644 --- a/extension/eclipse-exousia/src/main/java/cloud/piranha/extension/exousia/AuthorizationPreInitializer.java +++ b/extension/eclipse-exousia/src/main/java/cloud/piranha/extension/exousia/AuthorizationPreInitializer.java @@ -27,16 +27,16 @@ */ package cloud.piranha.extension.exousia; -import java.security.Policy; -import java.util.Set; - -import org.glassfish.exousia.AuthorizationService; - import cloud.piranha.core.api.WebApplication; import cloud.piranha.core.impl.DefaultAuthenticatedIdentity; +import jakarta.security.jacc.Policy; +import jakarta.security.jacc.PolicyFactory; import jakarta.servlet.ServletContainerInitializer; import jakarta.servlet.ServletContext; import jakarta.servlet.ServletException; +import java.util.Set; +import org.glassfish.exousia.AuthorizationService; +import org.glassfish.exousia.modules.def.DefaultPolicyFactory; /** * The Exousia initializer. @@ -117,19 +117,23 @@ private void createAuthorizationService(WebApplication context) throws ServletEx Class factoryClass = getAttribute(context, AUTHZ_FACTORY_CLASS); Class policyClass = getAttribute(context, AUTHZ_POLICY_CLASS); + PolicyFactory.setPolicyFactory(new DefaultPolicyFactory()); + // No need for the previous policy (likely the Java SE "JavaPolicy") to be consulted. - Policy.setPolicy(null); +// Policy.setPolicy(null); // Create the main Exousia authorization service, which implements the various entry points (an SPI) // for a runtime to make use of Jakarta Authorization AuthorizationService authorizationService = new AuthorizationService( - factoryClass, policyClass, + factoryClass, + policyClass, context.getServletContextId(), DefaultAuthenticatedIdentity::getCurrentSubject, - new PiranhaPrincipalMapper()); + () -> new PiranhaPrincipalMapper()); authorizationService.setRequestSupplier( - () -> AuthorizationPreFilter.getLocalServletRequest().get()); + context.getServletContextId(), + () -> AuthorizationPreFilter.getLocalServletRequest().get()); context.setAttribute(AUTHZ_SERVICE, authorizationService); } diff --git a/extension/eclipse-exousia/src/main/java/cloud/piranha/extension/exousia/PiranhaPrincipalMapper.java b/extension/eclipse-exousia/src/main/java/cloud/piranha/extension/exousia/PiranhaPrincipalMapper.java index 4000e2341c..0f77d9fa50 100644 --- a/extension/eclipse-exousia/src/main/java/cloud/piranha/extension/exousia/PiranhaPrincipalMapper.java +++ b/extension/eclipse-exousia/src/main/java/cloud/piranha/extension/exousia/PiranhaPrincipalMapper.java @@ -27,17 +27,14 @@ */ package cloud.piranha.extension.exousia; -import static java.util.stream.StreamSupport.stream; - +import cloud.piranha.core.api.AuthenticatedIdentity; +import jakarta.security.jacc.PrincipalMapper; import java.security.Principal; -import java.util.List; - +import java.util.Set; +import java.util.stream.Collectors; +import static java.util.stream.StreamSupport.stream; import javax.security.auth.Subject; -import org.glassfish.exousia.spi.PrincipalMapper; - -import cloud.piranha.core.api.AuthenticatedIdentity; - /** * The Piranha PrincipalMapper. * @@ -46,12 +43,21 @@ public class PiranhaPrincipalMapper implements PrincipalMapper { @Override - public List getMappedRoles(Iterable principals, Subject subject) { + public Principal getCallerPrincipal(Subject sbjct) { + return null; + } + + @Override + public Set getMappedRoles(Set principals) { return stream(principals.spliterator(), false) .filter(AuthenticatedIdentity.class::isInstance) .map(AuthenticatedIdentity.class::cast) .flatMap(e -> e.getGroups().stream()) - .toList(); + .collect(Collectors.toSet()); + } + + @Override + public Set getMappedRoles(Subject sbjct) { + return getMappedRoles(sbjct.getPrincipals()); } - } diff --git a/extension/eclipse-soteria/pom.xml b/extension/eclipse-soteria/pom.xml index 16743f4489..7193b41684 100644 --- a/extension/eclipse-soteria/pom.xml +++ b/extension/eclipse-soteria/pom.xml @@ -24,6 +24,11 @@ nimbus-jose-jwt compile + + jakarta.authentication + jakarta.authentication-api + compile + jakarta.enterprise jakarta.enterprise.cdi-api diff --git a/extension/eclipselink/src/main/java/cloud/piranha/extension/eclipselink/wrappers/EntityManagerWrapper.java b/extension/eclipselink/src/main/java/cloud/piranha/extension/eclipselink/wrappers/EntityManagerWrapper.java index d39aeefb39..98b32c832c 100644 --- a/extension/eclipselink/src/main/java/cloud/piranha/extension/eclipselink/wrappers/EntityManagerWrapper.java +++ b/extension/eclipselink/src/main/java/cloud/piranha/extension/eclipselink/wrappers/EntityManagerWrapper.java @@ -27,6 +27,10 @@ */ package cloud.piranha.extension.eclipselink.wrappers; +import jakarta.persistence.CacheRetrieveMode; +import jakarta.persistence.CacheStoreMode; +import jakarta.persistence.ConnectionConsumer; +import jakarta.persistence.ConnectionFunction; import java.util.List; import java.util.Map; @@ -34,26 +38,31 @@ import jakarta.persistence.EntityManager; import jakarta.persistence.EntityManagerFactory; import jakarta.persistence.EntityTransaction; +import jakarta.persistence.FindOption; import jakarta.persistence.FlushModeType; import jakarta.persistence.LockModeType; +import jakarta.persistence.LockOption; import jakarta.persistence.Query; +import jakarta.persistence.RefreshOption; import jakarta.persistence.StoredProcedureQuery; import jakarta.persistence.TypedQuery; +import jakarta.persistence.TypedQueryReference; import jakarta.persistence.criteria.CriteriaBuilder; import jakarta.persistence.criteria.CriteriaDelete; import jakarta.persistence.criteria.CriteriaQuery; +import jakarta.persistence.criteria.CriteriaSelect; import jakarta.persistence.criteria.CriteriaUpdate; import jakarta.persistence.metamodel.Metamodel; /** -* Provides a convenient implementation of the EntityManager interface that can be subclassed by developers wishing -* to adapt the entity manager. -* -*

-* This class implements the Wrapper or Decorator pattern. Methods default to calling through to the wrapped request -* object. -* -*/ + * Provides a convenient implementation of the EntityManager interface that can + * be subclassed by developers wishing to adapt the entity manager. + * + *

+ * This class implements the Wrapper or Decorator pattern. Methods default to + * calling through to the wrapped request object. + * + */ public class EntityManagerWrapper implements EntityManager { /** @@ -76,7 +85,8 @@ public EntityManagerWrapper(EntityManager entityManager) { /** * The underlying wrapped EntityManager - * @return underlying wrapped EntityManager + * + * @return underlying wrapped EntityManager */ public EntityManager getWrapped() { return wrappedEntityManager; @@ -117,6 +127,16 @@ public T find(Class entityClass, Object primaryKey, LockModeType lockMode return getWrapped().find(entityClass, primaryKey, lockMode, properties); } + @Override + public T find(Class type, Object o, FindOption... fos) { + return getWrapped().find(type, o, fos); + } + + @Override + public T find(EntityGraph eg, Object o, FindOption... fos) { + return getWrapped().find(eg, o, fos); + } + @Override public void flush() { getWrapped().flush(); @@ -147,6 +167,16 @@ public TypedQuery createQuery(CriteriaQuery criteriaQuery) { return getWrapped().createQuery(criteriaQuery); } + @Override + public TypedQuery createQuery(CriteriaSelect cs) { + return getWrapped().createQuery(cs); + } + + @Override + public TypedQuery createQuery(TypedQueryReference tqr) { + return getWrapped().createQuery(tqr); + } + @Override public Query createNamedQuery(String name) { return getWrapped().createNamedQuery(name); @@ -192,6 +222,11 @@ public void refresh(Object entity, LockModeType lockMode, Map pr getWrapped().refresh(entity, lockMode, properties); } + @Override + public void refresh(Object o, RefreshOption... ros) { + getWrapped().refresh(o, ros); + } + @Override public LockModeType getLockMode(Object o) { return getWrapped().getLockMode(o); @@ -247,6 +282,11 @@ public T getReference(Class entityClass, Object primaryKey) { return getWrapped().getReference(entityClass, primaryKey); } + @Override + public T getReference(T t) { + return getWrapped().getReference(t); + } + @Override public void setProperty(String propertyName, Object value) { getWrapped().setProperty(propertyName, value); @@ -287,6 +327,11 @@ public void lock(Object entity, LockModeType lockMode, Map prope getWrapped().lock(entity, lockMode, properties); } + @Override + public void lock(Object o, LockModeType lmt, LockOption... los) { + getWrapped().lock(o, lmt, los); + } + @Override public void clear() { getWrapped().clear(); @@ -337,4 +382,33 @@ public List> getEntityGraphs(Class entityClass) { return getWrapped().getEntityGraphs(entityClass); } + @Override + public void setCacheRetrieveMode(CacheRetrieveMode crm) { + getWrapped().setCacheRetrieveMode(crm); + } + + @Override + public void setCacheStoreMode(CacheStoreMode csm) { + getWrapped().setCacheStoreMode(csm); + } + + @Override + public CacheRetrieveMode getCacheRetrieveMode() { + return getWrapped().getCacheRetrieveMode(); + } + + @Override + public CacheStoreMode getCacheStoreMode() { + return getWrapped().getCacheStoreMode(); + } + + @Override + public void runWithConnection(ConnectionConsumer cc) { + getWrapped().runWithConnection(cc); + } + + @Override + public T callWithConnection(ConnectionFunction cf) { + return getWrapped().callWithConnection(cf); + } } diff --git a/extension/platform/pom.xml b/extension/platform/pom.xml index b61f8beca2..f897590a34 100644 --- a/extension/platform/pom.xml +++ b/extension/platform/pom.xml @@ -38,6 +38,12 @@ ${project.version} compile + + cloud.piranha.extension + piranha-extension-eclipse-concurro + ${project.version} + compile + cloud.piranha.extension piranha-extension-eclipse-expressly diff --git a/extension/pom.xml b/extension/pom.xml index c79e0c79f2..6ac0e56218 100644 --- a/extension/pom.xml +++ b/extension/pom.xml @@ -25,6 +25,7 @@ coreprofile default-datasource eclipse-angus + eclipse-concurro eclipse-epicyro eclipse-exousia eclipse-expressly diff --git a/extension/redhat-weld/pom.xml b/extension/redhat-weld/pom.xml index 35631fd8d1..80e7f36462 100644 --- a/extension/redhat-weld/pom.xml +++ b/extension/redhat-weld/pom.xml @@ -45,6 +45,11 @@ jakarta.annotation-api provided + + jakarta.authentication + jakarta.authentication-api + provided + jakarta.el jakarta.el-api @@ -59,11 +64,18 @@ jakarta.security.enterprise jakarta.security.enterprise-api provided - + jakarta.transaction jakarta.transaction-api provided + + + jakarta.enterprise + jakarta.enterprise.cdi-el-api + 4.1.0-M1 + runtime + diff --git a/extension/security-jakarta/src/main/java/module-info.java b/extension/security-jakarta/src/main/java/module-info.java index 64a9e2e6ad..28c159ba25 100644 --- a/extension/security-jakarta/src/main/java/module-info.java +++ b/extension/security-jakarta/src/main/java/module-info.java @@ -42,4 +42,6 @@ requires transitive cloud.piranha.extension.soteria; requires cloud.piranha.extension.weld; requires java.naming; + requires org.glassfish.epicyro; + requires org.glassfish.exousia; } diff --git a/extension/security-servlet/src/main/java/module-info.java b/extension/security-servlet/src/main/java/module-info.java index 3ffd4c4f8d..1b4ef925d1 100644 --- a/extension/security-servlet/src/main/java/module-info.java +++ b/extension/security-servlet/src/main/java/module-info.java @@ -38,7 +38,9 @@ opens cloud.piranha.extension.security.servlet; requires cloud.piranha.core.api; requires cloud.piranha.core.impl; - requires cloud.piranha.extension.epicyro; requires transitive cloud.piranha.extension.exousia; + requires transitive cloud.piranha.extension.epicyro; requires java.naming; + requires org.glassfish.epicyro; + requires org.glassfish.exousia; } diff --git a/extension/webprofile/pom.xml b/extension/webprofile/pom.xml index b5c0f81d6a..1f9f04ed40 100644 --- a/extension/webprofile/pom.xml +++ b/extension/webprofile/pom.xml @@ -56,6 +56,12 @@ ${project.version} compile + + cloud.piranha.extension + piranha-extension-eclipse-concurro + ${project.version} + compile + cloud.piranha.extension piranha-extension-eclipse-expressly diff --git a/external/tck/el/pom.xml b/external/tck/el/pom.xml index 98d71c3adf..6d9869694b 100644 --- a/external/tck/el/pom.xml +++ b/external/tck/el/pom.xml @@ -136,14 +136,14 @@ org.glassfish.expressly expressly - ${expressly.version} + 6.0.0-M1 ${work.home}/jars expressly.jar jakarta.el jakarta.el-api - ${jakarta.el-api.version} + 6.0.0-M2 ${work.home}/jars jakarta.el-api.jar diff --git a/external/tck/wasp/pom.xml b/external/tck/wasp/pom.xml index ec24adf058..1700776b1b 100644 --- a/external/tck/wasp/pom.xml +++ b/external/tck/wasp/pom.xml @@ -192,14 +192,14 @@ jakarta.servlet jakarta.servlet-api - ${jakarta.servlet-api.version} + 6.1.0-M1 ${signature.home} jakarta.servlet-api.jar org.glassfish.wasp wasp - ${wasp.version} + 4.0.0-M1 ${signature.home} wasp.jar @@ -220,7 +220,7 @@ org.glassfish.expressly expressly - ${expressly.version} + 6.0.0-M1 ${signature.home} expressly.jar diff --git a/pom.xml b/pom.xml index a8a65adf4a..d72243c3fb 100644 --- a/pom.xml +++ b/pom.xml @@ -44,7 +44,6 @@ arquillian bom - cli core dist embedded @@ -81,14 +80,13 @@ 1.27.1 2.0.0-M2 0.1.3 - 4.0.4 - 3.0.0 - - 2.1.1 - 5.0.0 + 5.0.0-B02 + 3.1.0 + 3.0.0-M1.1 + 6.0.0-M2 1.1.1 1.6 - 4.0.2 + 4.1.0-M1 2.0.0 33.3.1-jre 2.3.232 @@ -100,7 +98,7 @@ 3.2.2 4.0.5 1.3.1.Final - 3.1.8 + 4.0-M1-GF1 3.0.1 2.3.0 1.11.2 @@ -111,7 +109,7 @@ 3.1 2.1 2.0.2 - 4.0.8 + 4.1.1 4.1.114.Final 9.41.2 3.0.0 @@ -122,13 +120,13 @@ 2.0.0-beta-1 2.0.0 3.3.0 - 3.0.3 + 4.0.0-M3 3.3.4 1.0.1 - 2.1.5 + 2.2.0 2.3.17.Final - 3.2.2 - 5.1.3.Final + 4.0.0-M1 + 6.0.0.Beta4 3.0.4 3.6.0 @@ -917,6 +915,7 @@ + + + + @@ -1201,5 +1207,18 @@ test - + + + + sonatype-nexus-staging + Sonatype Nexus Staging + https://jakarta.oss.sonatype.org/content/repositories/staging/ + + true + + + false + + + diff --git a/test/debug/pom.xml b/test/debug/pom.xml index 01b9cf824f..e94acceb72 100644 --- a/test/debug/pom.xml +++ b/test/debug/pom.xml @@ -297,12 +297,6 @@ jakarta.el-api - - - jakarta.enterprise - jakarta.enterprise.cdi-api - - jakarta.faces diff --git a/test/embedded/exousia/pom.xml b/test/embedded/exousia/pom.xml index d6c183f527..18b580e79b 100644 --- a/test/embedded/exousia/pom.xml +++ b/test/embedded/exousia/pom.xml @@ -43,5 +43,10 @@ junit-jupiter-api test + + org.junit.jupiter + junit-jupiter-engine + test + diff --git a/uber/pom.xml b/uber/pom.xml new file mode 100644 index 0000000000..541f4e61d6 --- /dev/null +++ b/uber/pom.xml @@ -0,0 +1,15 @@ + + + + 4.0.0 + + cloud.piranha + project + 24.6.0-SNAPSHOT + + piranha-uber + jar + Piranha - Uber +