[tomcat] branch master updated: Remove Bnd annotation dependency from Jakarta API JARs

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[tomcat] branch master updated: Remove Bnd annotation dependency from Jakarta API JARs

markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
     new 5651dfa  Remove Bnd annotation dependency from Jakarta API JARs
5651dfa is described below

commit 5651dfad395a127774af67e26ab236599311e2ff
Author: Mark Thomas <[hidden email]>
AuthorDate: Thu Apr 1 13:53:02 2021 +0100

    Remove Bnd annotation dependency from Jakarta API JARs
---
 java/jakarta/el/ExpressionFactory.java                  |  3 ---
 java/jakarta/websocket/ContainerProvider.java           |  3 ---
 java/jakarta/websocket/server/ServerEndpointConfig.java |  3 ---
 res/bnd/el-api.jar.tmp.bnd                              |  9 +++++++++
 res/bnd/websocket-api.jar.tmp.bnd                       | 12 ++++++++++++
 webapps/docs/changelog.xml                              | 10 ++++++++++
 6 files changed, 31 insertions(+), 9 deletions(-)

diff --git a/java/jakarta/el/ExpressionFactory.java b/java/jakarta/el/ExpressionFactory.java
index 0777451..67b3556 100644
--- a/java/jakarta/el/ExpressionFactory.java
+++ b/java/jakarta/el/ExpressionFactory.java
@@ -36,13 +36,10 @@ import java.util.concurrent.locks.Lock;
 import java.util.concurrent.locks.ReadWriteLock;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
 
-import aQute.bnd.annotation.spi.ServiceConsumer;
-
 /**
  *
  * @since 2.1
  */
-@ServiceConsumer(value=ExpressionFactory.class)
 public abstract class ExpressionFactory {
 
     private static final boolean IS_SECURITY_ENABLED =
diff --git a/java/jakarta/websocket/ContainerProvider.java b/java/jakarta/websocket/ContainerProvider.java
index fdc54f6..33a8af2 100644
--- a/java/jakarta/websocket/ContainerProvider.java
+++ b/java/jakarta/websocket/ContainerProvider.java
@@ -19,13 +19,10 @@ package jakarta.websocket;
 import java.util.Iterator;
 import java.util.ServiceLoader;
 
-import aQute.bnd.annotation.spi.ServiceConsumer;
-
 /**
  * Use the {@link ServiceLoader} mechanism to provide instances of the WebSocket
  * client container.
  */
-@ServiceConsumer(value=ContainerProvider.class)
 public abstract class ContainerProvider {
 
     private static final String DEFAULT_PROVIDER_CLASS_NAME =
diff --git a/java/jakarta/websocket/server/ServerEndpointConfig.java b/java/jakarta/websocket/server/ServerEndpointConfig.java
index 33a7112..4fb16d3 100644
--- a/java/jakarta/websocket/server/ServerEndpointConfig.java
+++ b/java/jakarta/websocket/server/ServerEndpointConfig.java
@@ -29,8 +29,6 @@ import jakarta.websocket.EndpointConfig;
 import jakarta.websocket.Extension;
 import jakarta.websocket.HandshakeResponse;
 
-import aQute.bnd.annotation.spi.ServiceConsumer;
-
 /**
  * Provides configuration information for WebSocket endpoints published to a
  * server. Applications may provide their own implementation or use
@@ -141,7 +139,6 @@ public interface ServerEndpointConfig extends EndpointConfig {
     }
 
 
-    @ServiceConsumer(value=Configurator.class)
     public class Configurator {
 
         private static volatile Configurator defaultImpl = null;
diff --git a/res/bnd/el-api.jar.tmp.bnd b/res/bnd/el-api.jar.tmp.bnd
index ec61955..ad09124 100644
--- a/res/bnd/el-api.jar.tmp.bnd
+++ b/res/bnd/el-api.jar.tmp.bnd
@@ -25,6 +25,15 @@ Provide-Capability: \
         version:Version=${el.spec.version};\
         uses:='${packages;NAMED;jakarta.el.*}'
 
+Require-Capability: \
+    osgi.extender;\
+        filter:="(&(osgi.extender=osgi.serviceloader.processor)(version>=1.0.0)(!(version>=2.0.0)))",\
+    osgi.serviceloader;\
+        filter:="(osgi.serviceloader=jakarta.el.ExpressionFactory)";\
+        osgi.serviceloader="jakarta.el.ExpressionFactory",\
+    osgi.ee;\
+        filter:="(&(osgi.ee=JavaSE)(version=1.8))"
+
 -namesection: jakarta/el*/;\
     Specification-Title=Jakarta Expression Language;\
     Specification-Version=${el.spec.version};\
diff --git a/res/bnd/websocket-api.jar.tmp.bnd b/res/bnd/websocket-api.jar.tmp.bnd
index 93c9fe3..efa1f2b 100644
--- a/res/bnd/websocket-api.jar.tmp.bnd
+++ b/res/bnd/websocket-api.jar.tmp.bnd
@@ -26,6 +26,18 @@ Provide-Capability: \
         version:Version=${websocket.spec.version};\
         uses:='${packages;NAMED;jakarta.websocket.*}'
 
+Require-Capability: \
+    osgi.extender;\
+        filter:="(&(osgi.extender=osgi.serviceloader.processor)(version>=1.0.0)(!(version>=2.0.0)))",\
+    osgi.serviceloader;\
+        filter:="(osgi.serviceloader=jakarta.websocket.ContainerProvider)";\
+        osgi.serviceloader="jakarta.websocket.ContainerProvider",\
+    osgi.serviceloader;\
+        filter:="(osgi.serviceloader=jakarta.websocket.server.ServerEndpointConfig$Configurator)";\
+        osgi.serviceloader="jakarta.websocket.server.ServerEndpointConfig$Configurator",\
+    osgi.ee;\
+        filter:="(&(osgi.ee=JavaSE)(version=1.8))"
+
 -namesection: jakarta/websocket*/;\
     Specification-Title=Jakarta WebSocket;\
     Specification-Version=${websocket.spec.version};\
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 0407018..2f03833 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -104,6 +104,16 @@
   issues do not "pop up" wrt. others).
 -->
 <section name="Tomcat 10.0.6 (markt)" rtext="in development">
+  <subsection name="Other">
+    <changelog>
+      <fix>
+        Create OSGi <code>Require-Capability</code> sections in manifests for
+        Jakarta API JARs manually rather than via the
+        <code>aQute.bnd.annotation.spi.ServiceConsumer</code> annotation as this
+        triggers TCK failures for downstream consumers of the API JARs. (markt)
+      </fix>
+    </changelog>
+  </subsection>
 </section>
 <section name="Tomcat 10.0.5 (markt)" rtext="release in progress">
   <subsection name="Catalina">

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]