This is an automated email from the ASF dual-hosted git repository. asf-gitbox-commits pushed a commit to branch geoapi-4.0 in repository https://gitbox.apache.org/repos/asf/sis.git
commit e3ec50ccada2372d9bd80eb3f98a291203dabfcb Author: Martin Desruisseaux <[email protected]> AuthorDate: Mon Nov 30 13:09:04 2026 +0100 Remove the `org.apache.sis.web` module completely (was not released). It only provided listeners, but their registration is tricky: * If SIS is shared by several applications (JAR* files in Tomcat `lib/`, etc.), undeploying one application would shutdown SIS for all other applications. * Users would have no opt-out and no control on execution order. * Shutdown hooks potentially registered many times. For now, it is safer to leave the `shutdown()` call to users. https://issues.apache.org/jira/browse/SIS-640 --- .../apache/sis/buildtools/gradle/Dependency.java | 3 +- endorsed/build.gradle.kts | 15 ----- .../src/org.apache.sis.util/main/module-info.java | 1 - .../main/org/apache/sis/setup/Configuration.java | 10 +++- .../jakarta.servlet.ServletContainerInitializer | 1 - .../src/org.apache.sis.web/main/module-info.java | 46 --------------- .../org/apache/sis/web/jakarta/JavaBeanHook.java | 60 ------------------- .../apache/sis/web/jakarta/ServletListener.java | 69 ---------------------- .../org/apache/sis/web/jakarta/package-info.java | 26 -------- .../src/org.apache.sis.web/webapp/WEB-INF/web.xml | 24 -------- netbeans-project/ivy.xml | 3 - netbeans-project/nbproject/project.xml | 1 + 12 files changed, 10 insertions(+), 249 deletions(-) diff --git a/buildSrc/src/main/java/org/apache/sis/buildtools/gradle/Dependency.java b/buildSrc/src/main/java/org/apache/sis/buildtools/gradle/Dependency.java index a34a162aea..14b26b9db7 100644 --- a/buildSrc/src/main/java/org/apache/sis/buildtools/gradle/Dependency.java +++ b/buildSrc/src/main/java/org/apache/sis/buildtools/gradle/Dependency.java @@ -83,8 +83,7 @@ public final class Dependency { Map.entry("storage.hdf", "storage:sis-hdf"), Map.entry("storage.ogcwxs", "storage:sis-ogcwxs"), Map.entry("storage.ogcapi", "storage:sis-ogcapi"), - Map.entry("portrayal.map", "core:sis-portrayal-map"), - Map.entry("web", "application:sis-web") + Map.entry("portrayal.map", "core:sis-portrayal-map") ); /** diff --git a/endorsed/build.gradle.kts b/endorsed/build.gradle.kts index 9ba5788e89..d2d53a4cd9 100644 --- a/endorsed/build.gradle.kts +++ b/endorsed/build.gradle.kts @@ -70,9 +70,6 @@ dependencies { compileOnly(libs.aws.s3) compileOnly(drivers.postgres) runtimeOnly(drivers.hsql) - compileOnly(group = "jakarta.annotation", name = "jakarta.annotation-api", version = "3.0.0") - compileOnly(group = "jakarta.servlet", name = "jakarta.servlet-api", version = "6.1.0") - compileOnly(group = "jakarta.ejb", name = "jakarta.ejb-api", version = "4.0.1") // Test dependencies testImplementation(tests.junit5) @@ -467,18 +464,6 @@ publishing { "inside the Calc spreadsheet." } } - create<MavenPublication>("web") { - var module = "org.apache.sis.web" - groupId = "org.apache.sis.application" - artifactId = "sis-web" - artifact(layout.buildDirectory.file("libs/${module}.jar")) - artifact(layout.buildDirectory.file("docs/${module}-sources.jar")) {classifier = "sources"} - artifact(layout.buildDirectory.file("docs/${module}-javadoc.jar")) {classifier = "javadoc"} - pom { - name = "Apache SIS web services layer" - description = "Support the use of Apache SIS in web applications." - } - } } /* Following block is currently repeated in all sub-projects. */ repositories { diff --git a/endorsed/src/org.apache.sis.util/main/module-info.java b/endorsed/src/org.apache.sis.util/main/module-info.java index 22c3ce0da2..743611c1bc 100644 --- a/endorsed/src/org.apache.sis.util/main/module-info.java +++ b/endorsed/src/org.apache.sis.util/main/module-info.java @@ -165,7 +165,6 @@ module org.apache.sis.util { org.apache.sis.storage.gsf, // In the "incubator" sub-project. org.apache.sis.portrayal, org.apache.sis.console, - org.apache.sis.web, // In the "incubator" sub-project. org.apache.sis.gui, // In the "optional" sub-project. org.apache.sis.referencing.database; // In the "non-free" sub-project. diff --git a/endorsed/src/org.apache.sis.util/main/org/apache/sis/setup/Configuration.java b/endorsed/src/org.apache.sis.util/main/org/apache/sis/setup/Configuration.java index 18a401d62b..373917c849 100644 --- a/endorsed/src/org.apache.sis.util/main/org/apache/sis/setup/Configuration.java +++ b/endorsed/src/org.apache.sis.util/main/org/apache/sis/setup/Configuration.java @@ -34,8 +34,8 @@ import org.apache.sis.util.internal.shared.MetadataServices; * Those methods can be used in final applications, but should not be used by libraries * in order to avoid interfering with user's settings. * - * <h2>Other system-wide configuration</h2> - * The following methods have system-wide effects on Apache SIS configuration, + * <h2>Methods having a system-wide effect on Apache <abbr>SIS</abbr> configuration</h2> + * The following methods have system-wide effects on Apache <abbr>SIS</abbr> configuration, * but are not yet controlled through this {@code Configuration} class: * * <ul> @@ -199,6 +199,12 @@ public final class Configuration { * This method may be useful in embedded environments that do not allow the use of shutdown hooks, * or when waiting for the <abbr>JVM</abbr> shutdown is overly conservative. * + * <p>If Apache <abbr>SIS</abbr> is shared by several applications (for example, if the <abbr>JAR</abbr> + * files are in the Tomcat {@code lib/} directory or a Jetty server classpath), invoking this method during + * the undeployment of one application would shutdown <abbr>SIS</abbr> for all other applications. + * This risk can be mitigated by checking if <abbr>SIS</abbr> was loaded by the application class loader. + * The current version of Apache <abbr>SIS</abbr> doesn't do this check.</p> + * * <h4>Complete shutdown of Derby database</h4> * This method shutdowns only the databases used by Apache <abbr>SIS</abbr>. * If Apache Derby is used for the <abbr>EPSG</abbr> database, some Derby daemon threads may still be running. diff --git a/endorsed/src/org.apache.sis.web/main/META-INF/services/jakarta.servlet.ServletContainerInitializer b/endorsed/src/org.apache.sis.web/main/META-INF/services/jakarta.servlet.ServletContainerInitializer deleted file mode 100644 index 6364701916..0000000000 --- a/endorsed/src/org.apache.sis.web/main/META-INF/services/jakarta.servlet.ServletContainerInitializer +++ /dev/null @@ -1 +0,0 @@ -org.apache.sis.web.jakarta.ServletListener diff --git a/endorsed/src/org.apache.sis.web/main/module-info.java b/endorsed/src/org.apache.sis.web/main/module-info.java deleted file mode 100644 index 489a69bc70..0000000000 --- a/endorsed/src/org.apache.sis.web/main/module-info.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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. - */ - -/** - * Support for Apache <abbr>SIS</abbr> execution in the context of Servlet or web containers. - * This module registers listeners for stopping Apache <abbr>SIS</abbr> background threads - * when a web application or an Enterprise JavaBean (<abbr>EJB</abbr>) using <abbr>SIS</abbr> - * is undeployed from a container. - * The listeners in this module are compatible with the following frameworks: - * - * <ul> - * <li>Jakarta Servlet ({@code jakarta.servlet} package)</li> - * <li>Jakarta Enterprise JavaBeans (<abbr>EJB</abbr>) ({@code jakarta.ejb} package)</li> - * </ul> - * - * Web applications or Enterprise JavaBeans should consider adding this module in their dependencies - * if they use Apache <abbr>SIS</abbr> and need clean undeploy while keeping the rest of the container running. - * - * @author Martin Desruisseaux (Geomatys) - * @version 1.8 - * @since SIS 1.8 - */ -module org.apache.sis.web { - requires transitive org.apache.sis.util; - - requires static jakarta.servlet; - requires static jakarta.annotation; - requires static jakarta.ejb; - - provides jakarta.servlet.ServletContainerInitializer - with org.apache.sis.web.jakarta.ServletListener; -} diff --git a/endorsed/src/org.apache.sis.web/main/org/apache/sis/web/jakarta/JavaBeanHook.java b/endorsed/src/org.apache.sis.web/main/org/apache/sis/web/jakarta/JavaBeanHook.java deleted file mode 100644 index 15b37812dc..0000000000 --- a/endorsed/src/org.apache.sis.web/main/org/apache/sis/web/jakarta/JavaBeanHook.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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.apache.sis.web.jakarta; - -import jakarta.ejb.Startup; -import jakarta.ejb.Singleton; -import jakarta.annotation.PostConstruct; -import jakarta.annotation.PreDestroy; -import org.apache.sis.system.Shutdown; - - -/** - * Listener for Enterprise JavaBeans, used as a shutdown hook when the <abbr>EJB</abbr> is undeployed. - * This class should not be used directly. - * - * @author Martin Desruisseaux (Geomatys) - */ -@Startup -@Singleton -public final class JavaBeanHook { - /** - * Invoked by reflection. - */ - public JavaBeanHook() { - } - - /** - * Notifies Apache <abbr>SIS</abbr> that the application is initializing. - */ - @PostConstruct - public void initialize() { - Shutdown.setContainer("EJB (Jakarta)"); - } - - /** - * Receives notification that the application is about to be shutdown. - */ - @PreDestroy - public void shutdown() { - try { - Shutdown.stop(getClass()); - } catch (Exception e) { - Shutdown.log(getClass(), e); - } - } -} diff --git a/endorsed/src/org.apache.sis.web/main/org/apache/sis/web/jakarta/ServletListener.java b/endorsed/src/org.apache.sis.web/main/org/apache/sis/web/jakarta/ServletListener.java deleted file mode 100644 index 5f9f9e41fe..0000000000 --- a/endorsed/src/org.apache.sis.web/main/org/apache/sis/web/jakarta/ServletListener.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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.apache.sis.web.jakarta; - -import java.util.Set; -import jakarta.servlet.ServletContext; -import jakarta.servlet.ServletContextEvent; -import jakarta.servlet.ServletContextListener; -import jakarta.servlet.ServletContainerInitializer; -import jakarta.servlet.annotation.HandlesTypes; -import jakarta.servlet.annotation.WebListener; -import org.apache.sis.system.Shutdown; - - -/** - * Listener for servlet context, used as a shutdown hook when the application is undeployed. - * This class should not be used directly. - * - * @author Martin Desruisseaux (Geomatys) - */ -@WebListener("Apache SIS shutdown hook") -public final class ServletListener implements ServletContainerInitializer, ServletContextListener { - /** - * Invoked by reflection by the service loader. - */ - public ServletListener() { - } - - /** - * Notifies Apache <abbr>SIS</abbr> that the application is initializing. - * - * @param handled classes declared by {@link HandlesTypes}, or {@code null} if none. - * @param context context of the web application in which the classes were discovered. - */ - @Override - public void onStartup(final Set<Class<?>> handled, final ServletContext context) { - context.addListener(this); - final String env = context.getServerInfo(); - Shutdown.setContainer(env != null ? env : "Servlet"); - } - - /** - * Receives notification that the application is about to be shutdown. - * - * @param event the context of the servlet being shutdown. - */ - @Override - public void contextDestroyed(final ServletContextEvent event) { - try { - Shutdown.stop(getClass()); - } catch (Exception e) { - event.getServletContext().log(e.toString(), e); - } - } -} diff --git a/endorsed/src/org.apache.sis.web/main/org/apache/sis/web/jakarta/package-info.java b/endorsed/src/org.apache.sis.web/main/org/apache/sis/web/jakarta/package-info.java deleted file mode 100644 index 5c99bcb14c..0000000000 --- a/endorsed/src/org.apache.sis.web/main/org/apache/sis/web/jakarta/package-info.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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. - */ - - -/** - * All classes having a dependencies to Jakarta ({@code jakarta.servlet} and {@code jakarta.ejb} packages). - * Jakarta contains Enterprise JavaBeans (<abbr>EJB</abbr>) for business logic and servlet for the web. - * This is the replacement of JavaEE ({@code javax.*} packages). - * - * @author Martin Desruisseaux (Geomatys) - */ -package org.apache.sis.web.jakarta; diff --git a/endorsed/src/org.apache.sis.web/webapp/WEB-INF/web.xml b/endorsed/src/org.apache.sis.web/webapp/WEB-INF/web.xml deleted file mode 100644 index 74993a471f..0000000000 --- a/endorsed/src/org.apache.sis.web/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- -Licensed to the Apache Software Foundation (ASF) under one or more contributor -license agreements. See the NOTICE file distributed with this work for -additional information regarding copyright ownership. The ASF licenses this -file to you 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. ---> -<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns="http://java.sun.com/xml/ns/javaee" - xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" - xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" - id="WebApp_ID" version="2.5"> - <display-name>Apache SIS</display-name> -</web-app> diff --git a/netbeans-project/ivy.xml b/netbeans-project/ivy.xml index 17e5ad0b2a..b12818cb29 100644 --- a/netbeans-project/ivy.xml +++ b/netbeans-project/ivy.xml @@ -27,9 +27,6 @@ <dependency org="software.amazon.awssdk" name="aws-core" rev="2.57.13"/> <dependency org="software.amazon.awssdk" name="s3" rev="2.57.13"/> <dependency org="org.antlr" name="antlr4-maven-plugin" rev="4.13.2"/> - <dependency org="jakarta.servlet" name="jakarta.servlet-api" rev="6.1.0"/> - <dependency org="jakarta.ejb" name="jakarta.ejb-api" rev="4.0.1"/> - <dependency org="jakarta.annotation" name="jakarta.annotation-api" rev="3.0.0"/> <dependency org="org.junit.platform" name="junit-platform-launcher" rev="1.10.3"/> <dependency org="org.junit.jupiter" name="junit-jupiter-api" rev="5.10.3"/> <dependency org="org.apache.derby" name="derby" rev="10.17.1.0"/> diff --git a/netbeans-project/nbproject/project.xml b/netbeans-project/nbproject/project.xml index 38bfdfc02b..778c36797c 100644 --- a/netbeans-project/nbproject/project.xml +++ b/netbeans-project/nbproject/project.xml @@ -40,6 +40,7 @@ <word>programmatically</word> <word>transformative</word> <word>unary</word> + <word>undeployment</word> <word>unseparable</word> <word>untiled</word> </spellchecker-wordlist>
