sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject [sling-org-apache-sling-discovery-support] branch master updated: SLING-7461 : Official endpoints property from Http Whiteboard should be used
Date Thu, 01 Feb 2018 09:25:14 GMT
This is an automated email from the ASF dual-hosted git repository.

cziegeler pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-support.git


The following commit(s) were added to refs/heads/master by this push:
     new 80f93e1  SLING-7461 : Official endpoints property from Http Whiteboard should be
used
80f93e1 is described below

commit 80f93e120f21c620a729c8846fcab48798122cfe
Author: Carsten Ziegeler <cziegele@adobe.com>
AuthorDate: Thu Feb 1 10:25:08 2018 +0100

    SLING-7461 : Official endpoints property from Http Whiteboard should be used
---
 .../discovery/impl/support/StandardPropertyProvider.java      | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/sling/discovery/impl/support/StandardPropertyProvider.java
b/src/main/java/org/apache/sling/discovery/impl/support/StandardPropertyProvider.java
index 9358688..e17c582 100644
--- a/src/main/java/org/apache/sling/discovery/impl/support/StandardPropertyProvider.java
+++ b/src/main/java/org/apache/sling/discovery/impl/support/StandardPropertyProvider.java
@@ -51,8 +51,11 @@ import org.osgi.service.http.HttpService;
            policy=ReferencePolicy.DYNAMIC)
 public class StandardPropertyProvider {
 
+    /** Official Endpoint service registration property fromhttp whiteboard spec */
+    private static final String REG_PROPERTY_ENDPOINTS = "osgi.http.endpoints";
+
     /** Endpoint service registration property from RFC 189 */
-    private static final String REG_PROPERTY_ENDPOINTS = "osgi.http.service.endpoints";
+    private static final String REG_PROPERTY_ENDPOINTS_RFC = "osgi.http.service.endpoints";
 
     private volatile long changeCount;
 
@@ -106,6 +109,7 @@ public class StandardPropertyProvider {
         this.propagationService = cc.getBundleContext().registerService(PropertyProvider.class.getName(),
                 new PropertyProvider() {
 
+                    @Override
                     public String getProperty(final String name) {
                         if ( InstanceDescription.PROPERTY_DESCRIPTION.equals(name) ) {
                             return settings.getSlingDescription();
@@ -133,7 +137,10 @@ public class StandardPropertyProvider {
      * Bind a http service
      */
     protected void bindHttpService(final ServiceReference reference) {
-        final String[] endpointUrls = toStringArray(reference.getProperty(REG_PROPERTY_ENDPOINTS));
+        String[] endpointUrls = toStringArray(reference.getProperty(REG_PROPERTY_ENDPOINTS));
+        if ( endpointUrls == null ) {
+            endpointUrls = toStringArray(reference.getProperty(REG_PROPERTY_ENDPOINTS_RFC));
+        }
         if ( endpointUrls != null ) {
             synchronized ( this.endpoints ) {
                 this.endpoints.put((Long)reference.getProperty(Constants.SERVICE_ID), endpointUrls);

-- 
To stop receiving notification emails like this one, please contact
cziegeler@apache.org.

Mime
View raw message