diff --git a/.gitignore b/.gitignore index 8c7d5a9204..8e64d46958 100644 --- a/.gitignore +++ b/.gitignore @@ -11,9 +11,4 @@ nbactions.xml .classpath .project .settings/ -modules/bundles/comet/src -modules/bundles/core/src -modules/bundles/http/src -modules/bundles/http-all/src -modules/bundles/http-servlet/src -modules/bundles/websockets/src + diff --git a/boms/bom/pom.xml b/boms/bom/pom.xml index 6038c24407..055713393a 100644 --- a/boms/bom/pom.xml +++ b/boms/bom/pom.xml @@ -1,7 +1,7 @@ - maven-source-plugin - 3.2.1 - - - org.codehaus.mojo - build-helper-maven-plugin - 3.6.1 - - - maven-enforcer-plugin @@ -211,11 +182,8 @@ - - [11,) - - 3.5.4 + 3.8.9 diff --git a/extras/connection-pool/pom.xml b/extras/connection-pool/pom.xml index f1170f9d9b..2963a9006f 100644 --- a/extras/connection-pool/pom.xml +++ b/extras/connection-pool/pom.xml @@ -1,7 +1,7 @@ - org.apache.maven.plugins maven-surefire-report-plugin false diff --git a/extras/http-server-multipart/src/main/java/module-info.java b/extras/http-server-multipart/src/main/java/module-info.java new file mode 100644 index 0000000000..d13eb5a932 --- /dev/null +++ b/extras/http-server-multipart/src/main/java/module-info.java @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2025 Contributors to the Eclipse Foundation + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0, which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the + * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + * version 2 with the GNU Classpath Exception, which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + */ + +/** + * @author David Matejcek + */ +module org.glassfish.grizzly.http.server.multipart { + + requires java.logging; + + requires org.glassfish.grizzly; + requires org.glassfish.grizzly.http; + requires org.glassfish.grizzly.http.server; + + exports org.glassfish.grizzly.http.multipart; +} diff --git a/extras/http-servlet-extras/pom.xml b/extras/http-servlet-extras/pom.xml index 0ba3234de5..fcab7b4230 100644 --- a/extras/http-servlet-extras/pom.xml +++ b/extras/http-servlet-extras/pom.xml @@ -1,7 +1,7 @@ - org.apache.maven.plugins maven-surefire-report-plugin false diff --git a/extras/pom.xml b/extras/pom.xml index 4afe306a89..eb5517e8eb 100644 --- a/extras/pom.xml +++ b/extras/pom.xml @@ -1,7 +1,7 @@ + + + Comet is a web application model in which a long-held HTTPS request + allows a web server to push data to a browser, without the browser + explicitly requesting it. + Comet is known by several other names, including Ajax Push, + Reverse Ajax, Two-way-web, HTTP Streaming, and HTTP server + push among others. + @@ -45,111 +54,77 @@ - install - - maven-clean-plugin - 3.3.2 - - - - - src - - - - - maven-dependency-plugin - 3.6.1 - src-dependencies + unpack-sources-from-dependencies generate-sources - unpack-dependencies sources - - - module-info.java - junit, hamcrest-core - - ${basedir}/src/main/java - false + compile + module-info.java,META-INF/** + ${project.build.directory}/generated-sources/grizzly true - - org.apache.felix - maven-bundle-plugin - - - - *, - - - org.glassfish.grizzly.*;-split-package:=merge-first;version=${project.version} - - org.glassfish.grizzly;scope=runtime - - - true - + org.codehaus.mojo + build-helper-maven-plugin - osgi-bundle - package + add-source-directory + generate-sources - bundle + add-source + add-resource + + ${project.build.directory}/generated-sources/grizzly + + + ${project.build.directory}/generated-sources/grizzly + false + + **/*.properties + + + + - - org.apache.maven.plugins - maven-source-plugin + org.apache.felix + maven-bundle-plugin - fudge-source - install + bundle-manifest + process-classes + + manifest + - - maven-antrun-plugin - 1.8 + maven-javadoc-plugin + + + maven-source-plugin + package-source install - - - - - - - run - - diff --git a/modules/bundles/core/pom.xml b/modules/bundles/core/pom.xml index d6f7523094..f47e4569d9 100644 --- a/modules/bundles/core/pom.xml +++ b/modules/bundles/core/pom.xml @@ -1,7 +1,7 @@ - - src - - - - - maven-dependency-plugin - 3.6.1 - src-dependencies + unpack-sources-from-dependencies generate-sources - unpack-dependencies sources - - module-info.java - junit,hamcrest-core - - ${basedir}/src/main/java - false + compile + module-info.java,META-INF/** + ${project.build.directory}/generated-sources/grizzly true - - org.apache.felix - maven-bundle-plugin - - - - *, - - - org.glassfish.grizzly.*;-split-package:=merge-first;version=${project.version} - - org.glassfish.grizzly;scope=runtime - - - true - + org.codehaus.mojo + build-helper-maven-plugin - osgi-bundle - package + add-source-directory + generate-sources - bundle + add-source + add-resource + + ${project.build.directory}/generated-sources/grizzly + + + ${project.build.directory}/generated-sources/grizzly + false + + **/*.properties + + + + - - - org.apache.maven.plugins - maven-javadoc-plugin - - -Xdoclint:none - - - - org.apache.maven.plugins - maven-source-plugin + org.apache.felix + maven-bundle-plugin - fudge-source - install + bundle-manifest + process-classes + + manifest + - - maven-antrun-plugin - 1.8 + maven-javadoc-plugin + + + maven-source-plugin + package-source install - - - - - - - run - - diff --git a/modules/bundles/http-all/pom.xml b/modules/bundles/http-all/pom.xml index 4e912013c5..42ec4d4449 100644 --- a/modules/bundles/http-all/pom.xml +++ b/modules/bundles/http-all/pom.xml @@ -1,7 +1,7 @@ - - src - - - - - maven-dependency-plugin - 3.6.1 - src-dependencies + unpack-sources-from-dependencies generate-sources - unpack-dependencies sources - junit, hamcrest-core - module-info.java - - ${basedir}/src/main/java - false + compile + module-info.java,META-INF/** + ${project.build.directory}/generated-sources/grizzly true - - org.apache.felix - maven-bundle-plugin - - - - * - - - org.glassfish.grizzly.*;-split-package:=merge-first;version=${project.version}, - jakarta.servlet.*;version=${servlet-version};-split-package:=merge-first - - org.glassfish.grizzly;scope=runtime - - - true - + org.codehaus.mojo + build-helper-maven-plugin - osgi-bundle - package + add-source-directory + generate-sources - bundle + add-source + add-resource + + ${project.build.directory}/generated-sources/grizzly + + + ${project.build.directory}/generated-sources/grizzly + false + + **/*.dtd + **/*.xsd + **/*.properties + + + + - - org.apache.maven.plugins - maven-source-plugin + org.apache.felix + maven-bundle-plugin - fudge-source - install + bundle-manifest + process-classes + + manifest + - - maven-antrun-plugin - 1.8 + maven-javadoc-plugin + + + maven-source-plugin + package-source install - - - - - - - run - - diff --git a/modules/bundles/http-servlet/pom.xml b/modules/bundles/http-servlet/pom.xml index 05842b1c50..a00721d360 100755 --- a/modules/bundles/http-servlet/pom.xml +++ b/modules/bundles/http-servlet/pom.xml @@ -1,7 +1,7 @@ - - src - - - - - maven-dependency-plugin - 3.6.1 - src-dependencies + unpack-sources-from-dependencies generate-sources - unpack-dependencies sources - junit, hamcrest-core - module-info.java - - ${basedir}/src/main/java - false + module-info.java,META-INF/** + junit,hamcrest-core + ${project.build.directory}/generated-sources/grizzly true - - org.apache.felix - maven-bundle-plugin - - - - *, - - - org.glassfish.grizzly.*;version=${project.version};-split-package:=merge-first, - jakarta.servlet.*;version=${servlet-version};-split-package:=merge-first - - org.glassfish.grizzly;scope=runtime - - - true - + org.codehaus.mojo + build-helper-maven-plugin - osgi-bundle - package + add-source-directory + generate-sources - bundle + add-source + add-resource + + ${project.build.directory}/generated-sources/grizzly + + + ${project.build.directory}/generated-sources/grizzly + false + + **/*.dtd + **/*.xsd + **/*.properties + + + + - - org.apache.maven.plugins - maven-source-plugin + org.apache.felix + maven-bundle-plugin - fudge-source - install + bundle-manifest + process-classes + + manifest + - - maven-antrun-plugin - 1.8 + maven-javadoc-plugin + + + maven-source-plugin + package-source install - - - - - - - run - - diff --git a/modules/bundles/http/pom.xml b/modules/bundles/http/pom.xml index 2e6e254fa1..61ec25e27f 100755 --- a/modules/bundles/http/pom.xml +++ b/modules/bundles/http/pom.xml @@ -1,7 +1,7 @@ - - src - - - - - maven-dependency-plugin - 3.6.1 - src-dependencies + unpack-sources-from-dependencies generate-sources - unpack-dependencies sources - - module-info.java - junit, hamcrest-core - - ${basedir}/src/main/java - false + module-info.java,META-INF/** + junit,hamcrest-core + ${project.build.directory}/generated-sources/grizzly true - + + org.codehaus.mojo + build-helper-maven-plugin + + + add-source-directory + generate-sources + + add-source + + + ${project.build.directory}/generated-sources/grizzly + + + + org.apache.felix maven-bundle-plugin - - !android.os, - *, - - - org.glassfish.grizzly.*;version=${project.version};-split-package:=merge-first, - - org.glassfish.grizzly;scope=runtime - + + * - true - osgi-bundle - package + bundle-manifest + process-classes - bundle + manifest - - org.apache.maven.plugins - maven-source-plugin - - - fudge-source - install - - + maven-javadoc-plugin - - maven-antrun-plugin - 1.8 + maven-source-plugin + package-source install - - - - - - - run - diff --git a/modules/bundles/pom.xml b/modules/bundles/pom.xml index 5313cab658..3dcf6afddd 100644 --- a/modules/bundles/pom.xml +++ b/modules/bundles/pom.xml @@ -1,6 +1,7 @@ - - src - - - - - maven-dependency-plugin - 3.6.1 - src-dependencies + unpack-sources-from-dependencies generate-sources - unpack-dependencies sources - junit, hamcrest-core - module-info.java - - ${basedir}/src/main/java - false + module-info.java,META-INF/** + junit,hamcrest-core + ${project.build.directory}/generated-sources/grizzly true - - org.apache.felix - maven-bundle-plugin - - - - *, - - - org.glassfish.grizzly.*;-split-package:=merge-first;version=${project.version} - - org.glassfish.grizzly;scope=runtime - - - true - + org.codehaus.mojo + build-helper-maven-plugin - osgi-bundle - package + add-source-directory + generate-sources - bundle + add-source + add-resource + + ${project.build.directory}/generated-sources/grizzly + + + ${project.build.directory}/generated-sources/grizzly + false + + **/*.properties + + + + - - org.apache.maven.plugins - maven-source-plugin + org.apache.felix + maven-bundle-plugin - fudge-source - install + bundle-manifest + process-classes + + manifest + - - maven-antrun-plugin - 1.8 + maven-javadoc-plugin + + + maven-source-plugin + package-source install - - - - - - - run - - diff --git a/modules/comet/pom.xml b/modules/comet/pom.xml index 18e105e8ce..e07e8ee5ce 100644 --- a/modules/comet/pom.xml +++ b/modules/comet/pom.xml @@ -1,7 +1,7 @@ + + + Comet is a web application model in which a long-held HTTPS request + allows a web server to push data to a browser, without the browser + explicitly requesting it. + Comet is known by several other names, including Ajax Push, + Reverse Ajax, Two-way-web, HTTP Streaming, and HTTP server + push among others. + org.glassfish.grizzly grizzly-framework - ${project.version} - org.glassfish.grizzly grizzly-http-server - ${project.version} jakarta.servlet @@ -59,80 +59,36 @@ - install org.apache.felix maven-bundle-plugin - true - - - - org.glassfish.grizzly*;version=${project.version}, - *, - - - org.glassfish.grizzly.comet.*;version=${project.version}, - - - - - - maven-jar-plugin + bundle-manifest + process-classes - test-jar + manifest - org.apache.maven.plugins - maven-surefire-plugin - - false - false - - - - - org.apache.maven.plugins maven-surefire-report-plugin false diff --git a/modules/grizzly/pom.xml b/modules/grizzly/pom.xml index 78f58dc361..a2948f8597 100644 --- a/modules/grizzly/pom.xml +++ b/modules/grizzly/pom.xml @@ -1,7 +1,7 @@ + Enables Grizzly-based servers to communicate with web servers + (like Apache HTTPD) using the AJP protocol, which is commonly used for + integrating Java application servers with front-end web servers for load + balancing and proxying. org.glassfish.grizzly grizzly-http-server - ${project.version} @@ -61,29 +63,18 @@ - - org.apache.maven.plugins - maven-surefire-plugin - - false - false - - org.apache.felix maven-bundle-plugin - true - - - - org.glassfish.grizzly*;version=${project.version}, - *, - - - org.glassfish.grizzly.http.ajp.*;version=${project.version}, - - - + + + bundle-manifest + process-classes + + manifest + + + diff --git a/modules/http-server/pom.xml b/modules/http-server/pom.xml index 2777005b30..f1ce8032fe 100644 --- a/modules/http-server/pom.xml +++ b/modules/http-server/pom.xml @@ -1,7 +1,7 @@ + provided true @@ -58,61 +53,23 @@ org.mockito mockito-core - 3.12.4 - test - install org.apache.felix maven-bundle-plugin - true bundle-manifest process-classes - manifest - - - - org.glassfish.grizzly.http.server.*;version="[2.3,${project.version}]";resolution:=optional, - org.glassfish.grizzly.*;version="[2.3,${project.version}]", - * - - - org.glassfish.grizzly.http2.*;version=${project.version}, - - - - - - org.glassfish.hk2 - osgiversion-maven-plugin - 3.0.2 - - - org.apache.maven.plugins - maven-jar-plugin - - - ${project.build.outputDirectory}/META-INF/MANIFEST.MF - - - - - maven-surefire-plugin - - false - -XX:+HeapDumpOnOutOfMemoryError ${bootClasspath} - @@ -120,7 +77,6 @@ - org.apache.maven.plugins maven-surefire-report-plugin false diff --git a/modules/http2/src/main/java/org/glassfish/grizzly/http2/AlpnServerNegotiatorImpl.java b/modules/http2/src/main/java/org/glassfish/grizzly/http2/AlpnServerNegotiatorImpl.java index 8a777194d4..71d6fa0c83 100644 --- a/modules/http2/src/main/java/org/glassfish/grizzly/http2/AlpnServerNegotiatorImpl.java +++ b/modules/http2/src/main/java/org/glassfish/grizzly/http2/AlpnServerNegotiatorImpl.java @@ -1,4 +1,5 @@ /* + * Copyright (c) 2025 Contributors to the Eclipse Foundation. * Copyright (c) 2014, 2020 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the @@ -30,16 +31,14 @@ final class AlpnServerNegotiatorImpl extends AlpnNegotiatorBase implements AlpnS private final static Logger LOGGER = Grizzly.logger(AlpnServerNegotiatorImpl.class); private final Http2BaseFilter filter; - // ---------------------------------------------------- Constructors public AlpnServerNegotiatorImpl(final Http2ServerFilter http2HandlerFilter) { this.filter = http2HandlerFilter; } - // ------------------------------- Methods from ServerSideNegotiator @Override public String selectProtocol(SSLEngine sslEngine, String[] clientProtocols) { - final Connection connection = AlpnSupport.getConnection(sslEngine); + final Connection connection = AlpnSupport.getConnection(sslEngine); if (LOGGER.isLoggable(Level.FINE)) { LOGGER.log(Level.FINE, "Alpn selectProtocol. Connection={0} sslEngine={1} clientProtocols={2}", new Object[] { connection, sslEngine, Arrays.toString(clientProtocols) }); @@ -62,7 +61,7 @@ public String selectProtocol(SSLEngine sslEngine, String[] clientProtocols) { return null; } - private void configureHttp2(final Connection connection, final String supportedProtocol) { + private void configureHttp2(final Connection connection, final String supportedProtocol) { if (HTTP2.equals(supportedProtocol)) { // If HTTP2 is supported - initialize HTTP2 connection // Create HTTP2 connection and bind it to the Grizzly connection @@ -78,5 +77,4 @@ private void configureHttp2(final Connection connection, final String supportedP // http2Session.sendPreface(); } } - -} // END ProtocolNegotiator +} diff --git a/modules/http2/src/main/java/org/glassfish/grizzly/http2/Http2AddOn.java b/modules/http2/src/main/java/org/glassfish/grizzly/http2/Http2AddOn.java index e94c164b5c..b08a9152e7 100644 --- a/modules/http2/src/main/java/org/glassfish/grizzly/http2/Http2AddOn.java +++ b/modules/http2/src/main/java/org/glassfish/grizzly/http2/Http2AddOn.java @@ -1,4 +1,5 @@ /* + * Copyright (c) 2025 Contributors to the Eclipse Foundation. * Copyright (c) 2012, 2020 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the @@ -104,7 +105,8 @@ private static void configureAlpn(final Transport transport, return; } final SSLBaseFilter sslFilter = (SSLBaseFilter) builder.get(idx); - AlpnSupport.getInstance().configure(sslFilter); - AlpnSupport.getInstance().setServerSideNegotiator(transport, new AlpnServerNegotiatorImpl(http2Filter)); + AlpnSupport alpnSupport = AlpnSupport.getInstance(); + alpnSupport.configure(sslFilter); + alpnSupport.setServerSideNegotiator(transport, new AlpnServerNegotiatorImpl(http2Filter)); } } diff --git a/modules/http2/src/main/java/org/glassfish/grizzly/http2/Http2Session.java b/modules/http2/src/main/java/org/glassfish/grizzly/http2/Http2Session.java index 90dfc2327f..673827fdeb 100644 --- a/modules/http2/src/main/java/org/glassfish/grizzly/http2/Http2Session.java +++ b/modules/http2/src/main/java/org/glassfish/grizzly/http2/Http2Session.java @@ -1,4 +1,5 @@ /* + * Copyright (c) 2025 Contributors to the Eclipse Foundation. * Copyright (c) 2012, 2020 Oracle and/or its affiliates and others. * All rights reserved. * @@ -17,11 +18,6 @@ package org.glassfish.grizzly.http2; -import static org.glassfish.grizzly.http2.Http2BaseFilter.PRI_PAYLOAD; -import static org.glassfish.grizzly.http2.frames.SettingsFrame.SETTINGS_INITIAL_WINDOW_SIZE; -import static org.glassfish.grizzly.http2.frames.SettingsFrame.SETTINGS_MAX_CONCURRENT_STREAMS; -import static org.glassfish.grizzly.http2.frames.SettingsFrame.SETTINGS_MAX_HEADER_LIST_SIZE; - import java.io.IOException; import java.util.ArrayList; import java.util.Iterator; @@ -30,7 +26,6 @@ import java.util.TreeMap; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.locks.ReentrantLock; -import java.util.function.Supplier; import java.util.logging.Level; import java.util.logging.Logger; @@ -79,6 +74,11 @@ import org.glassfish.grizzly.utils.Futures; import org.glassfish.grizzly.utils.Holder; +import static org.glassfish.grizzly.http2.Http2BaseFilter.PRI_PAYLOAD; +import static org.glassfish.grizzly.http2.frames.SettingsFrame.SETTINGS_INITIAL_WINDOW_SIZE; +import static org.glassfish.grizzly.http2.frames.SettingsFrame.SETTINGS_MAX_CONCURRENT_STREAMS; +import static org.glassfish.grizzly.http2.frames.SettingsFrame.SETTINGS_MAX_HEADER_LIST_SIZE; + /** * The HTTP2 session abstraction. * @@ -461,7 +461,7 @@ public int getLocalMaxConcurrentStreams() { /** * Sets the default maximum number of concurrent streams allowed for this session by our side. - * + * * @param localMaxConcurrentStreams max number of streams locally allowed */ public void setLocalMaxConcurrentStreams(int localMaxConcurrentStreams) { @@ -948,7 +948,7 @@ Http2Stream acceptStream(final HttpRequestPacket request, final int streamId, fi /** * Method is not thread-safe, it is expected that it will be called within {@link #getNewClientStreamLock()} lock scope. * The caller code is responsible for obtaining and releasing the mentioned {@link #getNewClientStreamLock()} lock. - * + * * @param request the request that initiated the stream * @param streamId the ID of this new stream * @param parentStreamId the parent stream @@ -1030,7 +1030,7 @@ public Http2Stream openUpgradeStream(final HttpRequestPacket request, final int /** * Initializes HTTP2 communication (if not initialized before) by forming HTTP2 connection and stream * {@link FilterChain}s. - * + * * @param context the current {@link FilterChainContext} * @param isUpStream flag denoting the direction of the chain */ diff --git a/modules/monitoring/grizzly/pom.xml b/modules/monitoring/grizzly/pom.xml index 6143498421..864ed4add1 100644 --- a/modules/monitoring/grizzly/pom.xml +++ b/modules/monitoring/grizzly/pom.xml @@ -1,7 +1,7 @@ + It enables a single network port to handle multiple protocols + by detecting the protocol of incoming connections and dispatching them + to the appropriate handler. + org.glassfish.grizzly grizzly-framework - ${project.version} - install true @@ -58,28 +60,18 @@ - - org.apache.maven.plugins - maven-surefire-plugin - - false - - org.apache.felix maven-bundle-plugin - true - - - - org.glassfish.grizzly*;version=${project.version}, - *, - - - org.glassfish.grizzly.portunif.*;version=${project.version}, - - - + + + bundle-manifest + process-classes + + manifest + + + diff --git a/modules/websockets/pom.xml b/modules/websockets/pom.xml index 70fd20042d..c95ae16a65 100644 --- a/modules/websockets/pom.xml +++ b/modules/websockets/pom.xml @@ -1,7 +1,7 @@ + * - maven-enforcer-plugin @@ -241,18 +286,15 @@ maven-jar-plugin - - development - ${project.url} - ${project.version} - org.glassfish.grizzly - + + false + + ${project.build.outputDirectory}/META-INF/MANIFEST.MF - org.apache.maven.plugins maven-source-plugin @@ -264,16 +306,8 @@ - - org.apache.maven.plugins maven-javadoc-plugin - - none - true - true - ${project.name} ${project.version} - diff --git a/samples/connection-pool-samples/pom.xml b/samples/connection-pool-samples/pom.xml index 2c6a554f44..985d035da5 100755 --- a/samples/connection-pool-samples/pom.xml +++ b/samples/connection-pool-samples/pom.xml @@ -1,7 +1,7 @@