You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by fp...@apache.org on 2020/10/21 15:13:18 UTC

[karaf-winegrower] branch master updated: ensure * service ref property can be overriden if system property is set

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

fpapon pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/karaf-winegrower.git


The following commit(s) were added to refs/heads/master by this push:
     new 23bd77f  ensure * service ref property can be overriden if system property is set
     new b4414a9  Merge pull request #17 from rmannibucau/rmannibucau/service-ref-should-be-overridable-by-service-when-wildcard
23bd77f is described below

commit 23bd77f2d01b5111f3f2515aa989af5bf229df56
Author: Romain Manni-Bucau <rm...@gmail.com>
AuthorDate: Wed Oct 21 09:45:51 2020 +0200

    ensure * service ref property can be overriden if system property is set
---
 .../src/main/java/org/apache/winegrower/service/OSGiServices.java   | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/winegrower-core/src/main/java/org/apache/winegrower/service/OSGiServices.java b/winegrower-core/src/main/java/org/apache/winegrower/service/OSGiServices.java
index 6bf6b26..57f7ce9 100644
--- a/winegrower-core/src/main/java/org/apache/winegrower/service/OSGiServices.java
+++ b/winegrower-core/src/main/java/org/apache/winegrower/service/OSGiServices.java
@@ -156,6 +156,12 @@ public class OSGiServices {
             @Override
             public Object get(final Object key) {
                 final String property = System.getProperty(String.valueOf(key));
+                if ("*".equals(property)) { // http.port for ex
+                    final Object overridenValue = super.get(key);
+                    if (overridenValue != null) {
+                        return overridenValue;
+                    }
+                }
                 return property != null ? property : super.get(key);
             }
         };