aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From csie...@apache.org
Subject [03/12] aries-jax-rs-whiteboard git commit: Deploy extensions in default application
Date Fri, 24 Feb 2017 16:41:50 GMT
Deploy extensions in default application


Project: http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/repo
Commit: http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/commit/f51b5770
Tree: http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/tree/f51b5770
Diff: http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/diff/f51b5770

Branch: refs/heads/master
Commit: f51b57703fe7e55e02ec63ad093491950cb722a8
Parents: e7caec3
Author: Carlos Sierra <csierra@apache.org>
Authored: Wed Feb 22 17:44:39 2017 +0100
Committer: Raymond Auge <raymond.auge@liferay.com>
Committed: Fri Feb 24 10:11:03 2017 -0500

----------------------------------------------------------------------
 jax-rs.itests/src/main/java/test/JaxrsTest.java |  4 +--
 .../activator/CXFJaxRsBundleActivator.java      | 31 ++++++--------------
 2 files changed, 11 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/f51b5770/jax-rs.itests/src/main/java/test/JaxrsTest.java
----------------------------------------------------------------------
diff --git a/jax-rs.itests/src/main/java/test/JaxrsTest.java b/jax-rs.itests/src/main/java/test/JaxrsTest.java
index 5292cfd..3fc9c52 100644
--- a/jax-rs.itests/src/main/java/test/JaxrsTest.java
+++ b/jax-rs.itests/src/main/java/test/JaxrsTest.java
@@ -184,7 +184,7 @@ public class JaxrsTest {
                 "osgi.jaxrs.resource.base", "/test-addon");
 
             filterRegistration = registerFilter(
-                "osgi.jaxrs.filter.base", "/test-addon");
+                "osgi.jaxrs.extension.name", "test-filter");
 
             Response response = webTarget.request().get();
 
@@ -231,7 +231,7 @@ public class JaxrsTest {
                     assertNull(response.getHeaders().getFirst("Filtered"));
 
                     filterRegistration = registerFilter(
-                        "osgi.jaxrs.filter.base", "/test-addon");
+                        "osgi.jaxrs.extension.name", "test-filter");
 
                     response = webTarget.request().get();
 

http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/f51b5770/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/activator/CXFJaxRsBundleActivator.java
----------------------------------------------------------------------
diff --git a/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/activator/CXFJaxRsBundleActivator.java
b/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/activator/CXFJaxRsBundleActivator.java
index e40b991..4260db0 100644
--- a/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/activator/CXFJaxRsBundleActivator.java
+++ b/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/activator/CXFJaxRsBundleActivator.java
@@ -59,7 +59,7 @@ public class CXFJaxRsBundleActivator implements BundleActivator {
     private BundleContext _bundleContext;
     private OSGiResult<?> _applicationsResult;
     private OSGiResult<?> _singletonsResult;
-    private OSGiResult<?> _filtersResult;
+    private OSGiResult<?> _extensionsResult;
 
     private static <T> OSGi<T> service(ServiceReference<T> serviceReference)
{
         return
@@ -127,27 +127,14 @@ public class CXFJaxRsBundleActivator implements BundleActivator {
 
         _singletonsResult = singletons.run(bundleContext);
 
-        OSGi<?> filters =
-            serviceReferences(getFiltersFilter()).flatMap(ref ->
+        OSGi<?> extensions =
+            serviceReferences(getExtensionFilter()).flatMap(ref ->
             waitForExtensionDependencies(ref,
-                just(
-                    ref.getProperty("osgi.jaxrs.filter.base").toString()).
-                    flatMap(filterBase ->
-                serviceReferences(
-                    CXFJaxRsServiceRegistrator.class, "(CXF_ENDPOINT_ADDRESS=*)").
-                    filter(regref ->
-                        regref.
-                            getProperty("CXF_ENDPOINT_ADDRESS").
-                            toString().
-                            startsWith(filterBase)).
-                    flatMap(regref ->
-                service(regref).flatMap(registrator ->
-                service(ref).flatMap(service ->
-                safeRegisterEndpoint(ref, registrator, service)
-            )))))
+                safeRegisterEndpoint(ref, defaultServiceRegistrator)
+            )
         );
 
-        _filtersResult = filters.run(bundleContext);
+        _extensionsResult = extensions.run(bundleContext);
     }
 
     /**
@@ -260,8 +247,8 @@ public class CXFJaxRsBundleActivator implements BundleActivator {
         return cxfNonSpringServlet;
     }
 
-    private String getFiltersFilter() {
-        return "(osgi.jaxrs.filter.base=*)";
+    private String getExtensionFilter() {
+        return "(osgi.jaxrs.extension.name=*)";
     }
 
     private String getApplicationFilter() {
@@ -275,7 +262,7 @@ public class CXFJaxRsBundleActivator implements BundleActivator {
     @Override
     public void stop(BundleContext context) throws Exception {
         _applicationsResult.close();
-        _filtersResult.close();
+        _extensionsResult.close();
         _singletonsResult.close();
     }
 


Mime
View raw message