You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aries.apache.org by cs...@apache.org on 2021/04/11 16:16:18 UTC

[aries-jax-rs-whiteboard] branch master updated (6acdca3 -> fd4d686)

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

csierra pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/aries-jax-rs-whiteboard.git.


    from 6acdca3  update resolutions
     new 853af50  remove usage of internal dsl classes
     new fd4d686  don't embed component-dsl in every consumer

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../cxf-jettison/cxf-jettison-itest/itest.bndrun   |  1 +
 .../cxf-jettison/cxf-jettison-jaxrs/bnd.bnd        |  2 -
 integrations/jackson/jackson-itest/itest.bndrun    |  1 +
 integrations/jackson/jackson-jaxrs/bnd.bnd         |  2 -
 integrations/openapi/openapi-itest/itest.bndrun    |  1 +
 integrations/openapi/openapi-resource/bnd.bnd      |  2 -
 .../rest-management-itest/itest.bndrun             |  1 +
 .../rest-management/rest-management/bnd.bnd        |  2 -
 integrations/shiro/shiro-authc/bnd.bnd             |  2 -
 integrations/shiro/shiro-authz/bnd.bnd             |  2 -
 integrations/shiro/shiro-itest/itest.bndrun        |  1 +
 .../aries-jaxrs-whiteboard-example.bndrun          |  1 +
 jax-rs.example/aries-jaxrs-whiteboard-only.bndrun  |  1 +
 jax-rs.itests/itest.bndrun                         |  1 +
 jax-rs.whiteboard/bnd.bnd                          |  2 -
 .../aries/jax/rs/whiteboard/internal/Registry.java | 49 ++++++++++++++++------
 pom.xml                                            |  1 -
 17 files changed, 45 insertions(+), 27 deletions(-)

[aries-jax-rs-whiteboard] 02/02: don't embed component-dsl in every consumer

Posted by cs...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

csierra pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/aries-jax-rs-whiteboard.git

commit fd4d686aa9334487f5f78a3380e9345f1c2378dd
Author: Raymond Auge <ro...@apache.org>
AuthorDate: Thu Apr 8 13:07:52 2021 -0400

    don't embed component-dsl in every consumer
    
    Signed-off-by: Raymond Auge <ro...@apache.org>
---
 integrations/cxf-jettison/cxf-jettison-itest/itest.bndrun       | 1 +
 integrations/cxf-jettison/cxf-jettison-jaxrs/bnd.bnd            | 2 --
 integrations/jackson/jackson-itest/itest.bndrun                 | 1 +
 integrations/jackson/jackson-jaxrs/bnd.bnd                      | 2 --
 integrations/openapi/openapi-itest/itest.bndrun                 | 1 +
 integrations/openapi/openapi-resource/bnd.bnd                   | 2 --
 integrations/rest-management/rest-management-itest/itest.bndrun | 1 +
 integrations/rest-management/rest-management/bnd.bnd            | 2 --
 integrations/shiro/shiro-authc/bnd.bnd                          | 2 --
 integrations/shiro/shiro-authz/bnd.bnd                          | 2 --
 integrations/shiro/shiro-itest/itest.bndrun                     | 1 +
 jax-rs.example/aries-jaxrs-whiteboard-example.bndrun            | 1 +
 jax-rs.example/aries-jaxrs-whiteboard-only.bndrun               | 1 +
 jax-rs.itests/itest.bndrun                                      | 1 +
 jax-rs.whiteboard/bnd.bnd                                       | 2 --
 pom.xml                                                         | 1 -
 16 files changed, 8 insertions(+), 15 deletions(-)

diff --git a/integrations/cxf-jettison/cxf-jettison-itest/itest.bndrun b/integrations/cxf-jettison/cxf-jettison-itest/itest.bndrun
index cde325b..ff58810 100644
--- a/integrations/cxf-jettison/cxf-jettison-itest/itest.bndrun
+++ b/integrations/cxf-jettison/cxf-jettison-itest/itest.bndrun
@@ -48,6 +48,7 @@
 	com.fasterxml.woodstox.woodstox-core;version='[6.2.4,6.2.5)',\
 	com.sun.xml.bind.jaxb-osgi;version='[2.3.3,2.3.4)',\
 	jakarta.xml.bind-api;version='[2.3.3,2.3.4)',\
+	org.apache.aries.component-dsl.component-dsl;version='[1.2.2,1.2.3)',\
 	org.apache.aries.jax.rs.jaxb.json.cxf-jettison;version='[2.0.0,2.0.1)',\
 	org.apache.aries.jax.rs.jaxb.json.cxf-jettison-itest;version='[2.0.0,2.0.1)',\
 	org.apache.aries.jax.rs.whiteboard;version='[2.0.0,2.0.1)',\
diff --git a/integrations/cxf-jettison/cxf-jettison-jaxrs/bnd.bnd b/integrations/cxf-jettison/cxf-jettison-jaxrs/bnd.bnd
index 4b1e439..bfe5c22 100644
--- a/integrations/cxf-jettison/cxf-jettison-jaxrs/bnd.bnd
+++ b/integrations/cxf-jettison/cxf-jettison-jaxrs/bnd.bnd
@@ -14,5 +14,3 @@
 #    KIND, either express or implied.  See the License for the
 #    specific language governing permissions and limitations
 #    under the License.
-
--conditionalpackage: org.apache.aries.component.dsl.*
\ No newline at end of file
diff --git a/integrations/jackson/jackson-itest/itest.bndrun b/integrations/jackson/jackson-itest/itest.bndrun
index e938a2b..3cf06c9 100644
--- a/integrations/jackson/jackson-itest/itest.bndrun
+++ b/integrations/jackson/jackson-itest/itest.bndrun
@@ -53,6 +53,7 @@
 	com.fasterxml.woodstox.woodstox-core;version='[6.2.4,6.2.5)',\
 	com.sun.xml.bind.jaxb-osgi;version='[2.3.3,2.3.4)',\
 	jakarta.xml.bind-api;version='[2.3.3,2.3.4)',\
+	org.apache.aries.component-dsl.component-dsl;version='[1.2.2,1.2.3)',\
 	org.apache.aries.jax.rs.jackson;version='[2.0.0,2.0.1)',\
 	org.apache.aries.jax.rs.jackson.itest;version='[2.0.0,2.0.1)',\
 	org.apache.aries.jax.rs.whiteboard;version='[2.0.0,2.0.1)',\
diff --git a/integrations/jackson/jackson-jaxrs/bnd.bnd b/integrations/jackson/jackson-jaxrs/bnd.bnd
index a4b1d14..bfe5c22 100644
--- a/integrations/jackson/jackson-jaxrs/bnd.bnd
+++ b/integrations/jackson/jackson-jaxrs/bnd.bnd
@@ -14,5 +14,3 @@
 #    KIND, either express or implied.  See the License for the
 #    specific language governing permissions and limitations
 #    under the License.
-
--conditionalpackage: org.apache.aries.component.dsl.*
diff --git a/integrations/openapi/openapi-itest/itest.bndrun b/integrations/openapi/openapi-itest/itest.bndrun
index e8507d9..94b181a 100644
--- a/integrations/openapi/openapi-itest/itest.bndrun
+++ b/integrations/openapi/openapi-itest/itest.bndrun
@@ -63,6 +63,7 @@
 	io.swagger.core.v3.swagger-models;version='[2.1.7,2.1.8)',\
 	jakarta.validation.jakarta.validation-api;version='[2.0.2,2.0.3)',\
 	jakarta.xml.bind-api;version='[2.3.3,2.3.4)',\
+	org.apache.aries.component-dsl.component-dsl;version='[1.2.2,1.2.3)',\
 	org.apache.aries.jax.rs.openapi.itest;version='[2.0.0,2.0.1)',\
 	org.apache.aries.jax.rs.openapi.resource;version='[2.0.0,2.0.1)',\
 	org.apache.aries.jax.rs.whiteboard;version='[2.0.0,2.0.1)',\
diff --git a/integrations/openapi/openapi-resource/bnd.bnd b/integrations/openapi/openapi-resource/bnd.bnd
index f059bd7..067e9f9 100644
--- a/integrations/openapi/openapi-resource/bnd.bnd
+++ b/integrations/openapi/openapi-resource/bnd.bnd
@@ -16,5 +16,3 @@
 #    under the License.
 
 Export-Package: org.apache.aries.jax.rs.openapi;version=${openapi.version}
-
--conditionalpackage: org.apache.aries.component.dsl.*
\ No newline at end of file
diff --git a/integrations/rest-management/rest-management-itest/itest.bndrun b/integrations/rest-management/rest-management-itest/itest.bndrun
index ec081ec..e3c18c5 100644
--- a/integrations/rest-management/rest-management-itest/itest.bndrun
+++ b/integrations/rest-management/rest-management-itest/itest.bndrun
@@ -85,6 +85,7 @@
 	net.javacrumbs.json-unit.json-unit-json-path;version='[2.25.0,2.25.1)',\
 	net.minidev.accessors-smart;version='[1.2.0,1.2.1)',\
 	net.minidev.json-smart;version='[2.3.0,2.3.1)',\
+	org.apache.aries.component-dsl.component-dsl;version='[1.2.2,1.2.3)',\
 	org.apache.aries.jax.rs.openapi.resource;version='[2.0.0,2.0.1)',\
 	org.apache.aries.jax.rs.rest.management;version='[2.0.0,2.0.1)',\
 	org.apache.aries.jax.rs.rest.management.itest;version='[2.0.0,2.0.1)',\
diff --git a/integrations/rest-management/rest-management/bnd.bnd b/integrations/rest-management/rest-management/bnd.bnd
index 91bbb64..81b0013 100644
--- a/integrations/rest-management/rest-management/bnd.bnd
+++ b/integrations/rest-management/rest-management/bnd.bnd
@@ -20,5 +20,3 @@ Import-Package: \
 	javax.xml.bind.annotation;version="[2.3.0,3)",\
 	javax.xml.bind.annotation.adapters;version="[2.3.0,3)",\
 	*
-
--conditionalpackage: org.apache.aries.component.dsl.*
diff --git a/integrations/shiro/shiro-authc/bnd.bnd b/integrations/shiro/shiro-authc/bnd.bnd
index 22aae57..787083b 100644
--- a/integrations/shiro/shiro-authc/bnd.bnd
+++ b/integrations/shiro/shiro-authc/bnd.bnd
@@ -19,5 +19,3 @@
 # Support is not an OSGi bundle
 
 -includepackage: org.apache.shiro.web.jaxrs;version=${shiro.version}
-
--conditionalpackage: org.apache.aries.component.dsl.*
diff --git a/integrations/shiro/shiro-authz/bnd.bnd b/integrations/shiro/shiro-authz/bnd.bnd
index 22aae57..787083b 100644
--- a/integrations/shiro/shiro-authz/bnd.bnd
+++ b/integrations/shiro/shiro-authz/bnd.bnd
@@ -19,5 +19,3 @@
 # Support is not an OSGi bundle
 
 -includepackage: org.apache.shiro.web.jaxrs;version=${shiro.version}
-
--conditionalpackage: org.apache.aries.component.dsl.*
diff --git a/integrations/shiro/shiro-itest/itest.bndrun b/integrations/shiro/shiro-itest/itest.bndrun
index b88335a..fe66e0a 100644
--- a/integrations/shiro/shiro-itest/itest.bndrun
+++ b/integrations/shiro/shiro-itest/itest.bndrun
@@ -48,6 +48,7 @@
 	com.fasterxml.woodstox.woodstox-core;version='[6.2.4,6.2.5)',\
 	com.sun.xml.bind.jaxb-osgi;version='[2.3.3,2.3.4)',\
 	jakarta.xml.bind-api;version='[2.3.3,2.3.4)',\
+	org.apache.aries.component-dsl.component-dsl;version='[1.2.2,1.2.3)',\
 	org.apache.aries.jax.rs.shiro.authc;version='[2.0.0,2.0.1)',\
 	org.apache.aries.jax.rs.shiro.authz;version='[2.0.0,2.0.1)',\
 	org.apache.aries.jax.rs.shiro.itest;version='[2.0.0,2.0.1)',\
diff --git a/jax-rs.example/aries-jaxrs-whiteboard-example.bndrun b/jax-rs.example/aries-jaxrs-whiteboard-example.bndrun
index 5e3821c..cb4ee1e 100644
--- a/jax-rs.example/aries-jaxrs-whiteboard-example.bndrun
+++ b/jax-rs.example/aries-jaxrs-whiteboard-example.bndrun
@@ -51,6 +51,7 @@
 	com.fasterxml.woodstox.woodstox-core;version='[6.2.4,6.2.5)',\
 	com.sun.xml.bind.jaxb-osgi;version='[2.3.3,2.3.4)',\
 	jakarta.xml.bind-api;version='[2.3.3,2.3.4)',\
+	org.apache.aries.component-dsl.component-dsl;version='[1.2.2,1.2.3)',\
 	org.apache.aries.jax.rs.example;version='[2.0.0,2.0.1)',\
 	org.apache.aries.jax.rs.whiteboard;version='[2.0.0,2.0.1)',\
 	org.apache.aries.spifly.dynamic.framework.extension;version='[1.3.2,1.3.3)',\
diff --git a/jax-rs.example/aries-jaxrs-whiteboard-only.bndrun b/jax-rs.example/aries-jaxrs-whiteboard-only.bndrun
index 0e5a0b9..fbdd2fa 100644
--- a/jax-rs.example/aries-jaxrs-whiteboard-only.bndrun
+++ b/jax-rs.example/aries-jaxrs-whiteboard-only.bndrun
@@ -50,6 +50,7 @@
 	com.fasterxml.woodstox.woodstox-core;version='[6.2.4,6.2.5)',\
 	com.sun.xml.bind.jaxb-osgi;version='[2.3.3,2.3.4)',\
 	jakarta.xml.bind-api;version='[2.3.3,2.3.4)',\
+	org.apache.aries.component-dsl.component-dsl;version='[1.2.2,1.2.3)',\
 	org.apache.aries.jax.rs.whiteboard;version='[2.0.0,2.0.1)',\
 	org.apache.aries.spifly.dynamic.framework.extension;version='[1.3.2,1.3.3)',\
 	org.apache.cxf.cxf-core;version='[3.4.3,3.4.4)',\
diff --git a/jax-rs.itests/itest.bndrun b/jax-rs.itests/itest.bndrun
index 3938472..5f1948b 100644
--- a/jax-rs.itests/itest.bndrun
+++ b/jax-rs.itests/itest.bndrun
@@ -52,6 +52,7 @@
 	com.fasterxml.woodstox.woodstox-core;version='[6.2.4,6.2.5)',\
 	com.sun.xml.bind.jaxb-osgi;version='[2.3.3,2.3.4)',\
 	jakarta.xml.bind-api;version='[2.3.3,2.3.4)',\
+	org.apache.aries.component-dsl.component-dsl;version='[1.2.2,1.2.3)',\
 	org.apache.aries.jax.rs.itests;version='[2.0.0,2.0.1)',\
 	org.apache.aries.jax.rs.whiteboard;version='[2.0.0,2.0.1)',\
 	org.apache.aries.spifly.dynamic.framework.extension;version='[1.3.2,1.3.3)',\
diff --git a/jax-rs.whiteboard/bnd.bnd b/jax-rs.whiteboard/bnd.bnd
index 2926951..332ec24 100644
--- a/jax-rs.whiteboard/bnd.bnd
+++ b/jax-rs.whiteboard/bnd.bnd
@@ -16,5 +16,3 @@
 #    under the License.
 
 Provide-Capability: osgi.implementation;osgi.implementation="aries.jax-rs";version:Version="${Bundle-Version}"
-
--conditionalpackage: org.apache.aries.component.dsl.*
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index fe564e1..ace749b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -236,7 +236,6 @@
                 <groupId>org.apache.aries.component-dsl</groupId>
                 <artifactId>org.apache.aries.component-dsl.component-dsl</artifactId>
                 <version>${dsl.version}</version>
-                <scope>provided</scope>
                 <exclusions>
                     <exclusion>
                         <groupId>org.osgi</groupId>

[aries-jax-rs-whiteboard] 01/02: remove usage of internal dsl classes

Posted by cs...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

csierra pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/aries-jax-rs-whiteboard.git

commit 853af5058b474c6a6d09ba2afa57bef47631fa6e
Author: Raymond Auge <ro...@apache.org>
AuthorDate: Thu Apr 8 12:59:35 2021 -0400

    remove usage of internal dsl classes
    
    Signed-off-by: Raymond Auge <ro...@apache.org>
---
 .../aries/jax/rs/whiteboard/internal/Registry.java | 49 ++++++++++++++++------
 1 file changed, 37 insertions(+), 12 deletions(-)

diff --git a/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/internal/Registry.java b/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/internal/Registry.java
index 0e61ad3..24e774a 100644
--- a/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/internal/Registry.java
+++ b/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/internal/Registry.java
@@ -19,22 +19,25 @@ package org.apache.aries.jax.rs.whiteboard.internal;
 
 import org.apache.aries.component.dsl.OSGi;
 import org.apache.aries.component.dsl.OSGiResult;
-import org.apache.aries.component.dsl.internal.ConcurrentDoublyLinkedList;
+import org.osgi.framework.Constants;
 import org.osgi.framework.Filter;
 import org.osgi.framework.FrameworkUtil;
 import org.osgi.framework.InvalidSyntaxException;
 
 import java.util.ArrayList;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 
+import static java.util.Objects.requireNonNull;
 import static org.apache.aries.component.dsl.OSGi.fromOsgiRunnable;
 
 public class Registry<T> implements AutoCloseable {
 
     public Registry() {
         _publishers = new HashSet<>();
-        _servicesWithPropertiesList = new ConcurrentDoublyLinkedList<>();
+        _servicesWithPropertiesList = new ArrayList<>();
     }
 
     @Override
@@ -87,9 +90,10 @@ public class Registry<T> implements AutoCloseable {
     public OSGi<T> registerService(T service, Map<String, ?> properties) {
         return (bc, p) -> {
             synchronized (Registry.this) {
-                ConcurrentDoublyLinkedList.Node node =
-                    _servicesWithPropertiesList.addLast(
-                        new ServiceWithProperties<>(service, properties));
+                final ServiceWithProperties<T> serviceWithProperties =
+                    new ServiceWithProperties<>(service, properties);
+
+                _servicesWithPropertiesList.add(serviceWithProperties);
 
                 OSGiResult result = p.publish(service);
 
@@ -108,7 +112,8 @@ public class Registry<T> implements AutoCloseable {
                         }
 
                         result.close();
-                        node.remove();
+                        _servicesWithPropertiesList.remove(
+                            serviceWithProperties);
                     }
                 };
             }
@@ -117,18 +122,38 @@ public class Registry<T> implements AutoCloseable {
 
 
     private final HashSet<FilteredPublisher<T>> _publishers;
-    private final ConcurrentDoublyLinkedList<ServiceWithProperties<T>>
-        _servicesWithPropertiesList;
+    private final List<ServiceWithProperties<T>> _servicesWithPropertiesList;
 
     private static class ServiceWithProperties<T> {
 
-        T service;
-        Map<String, ?> properties;
+        final T service;
+        final Map<String, ?> properties;
+        final Long serviceId;
 
         ServiceWithProperties(T service, Map<String, ?> properties) {
-            this.service = service;
-            this.properties = properties;
+            this.service = requireNonNull(service);
+            this.properties = requireNonNull(properties);
+            this.serviceId = requireNonNull(
+                (Long)properties.get(Constants.SERVICE_ID));
+        }
+
+        @Override
+        public int hashCode() {
+            return Objects.hashCode(serviceId);
         }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (this == obj)
+                return true;
+            if (obj == null)
+                return false;
+            if (getClass() != obj.getClass())
+                return false;
+            ServiceWithProperties<?> other = (ServiceWithProperties<?>) obj;
+            return Objects.equals(other.serviceId, serviceId);
+        }
+
     }
 
 }