cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject cxf-dosgi git commit: Add simpler key for intent services
Date Wed, 10 Aug 2016 15:06:00 GMT
Repository: cxf-dosgi
Updated Branches:
  refs/heads/master e87305ec1 -> 919cfb787


Add simpler key for intent services


Project: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/commit/919cfb78
Tree: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/tree/919cfb78
Diff: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/diff/919cfb78

Branch: refs/heads/master
Commit: 919cfb787e05506be9b167e21ab3c827890ff9c8
Parents: e87305e
Author: Christian Schneider <chris@die-schneider.net>
Authored: Wed Aug 10 17:05:48 2016 +0200
Committer: Christian Schneider <chris@die-schneider.net>
Committed: Wed Aug 10 17:05:48 2016 +0200

----------------------------------------------------------------------
 Readme.md                                            |  2 +-
 common/Readme.md                                     |  6 +++---
 .../cxf/dosgi/common/intent/IntentManager.java       |  1 +
 .../dosgi/common/intent/impl/IntentManagerImpl.java  | 15 +++++++++++----
 samples/pom.xml                                      |  2 +-
 5 files changed, 17 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/919cfb78/Readme.md
----------------------------------------------------------------------
diff --git a/Readme.md b/Readme.md
index 731dfa4..3587038 100644
--- a/Readme.md
+++ b/Readme.md
@@ -16,7 +16,7 @@ Example
 
 * service.exported.intents=logging
 
-See [](common "common module").
+See [common module](common).
 
 ## Build
 

http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/919cfb78/common/Readme.md
----------------------------------------------------------------------
diff --git a/common/Readme.md b/common/Readme.md
index 6d948c4..dbc5099 100644
--- a/common/Readme.md
+++ b/common/Readme.md
@@ -7,12 +7,12 @@ Handles communication with the HttpService and Intents.
 In case a custom http context is used the providers will register a custom servlet.
 Besides this the HttpServiceManager also handles the creation of a default address if none
is given and the conversion from the relative address specified on the service property to
a fully qualified address.
 
-Configs
+Config pid `org.apache.cxf.dosgi.http` 
 
 Key             | Default | Description
 ----------------|---------|------------
 httpBase        |         | Start of the addres like http://myserver:8181
-cxfServletAlias | /cxf     | Name of the cxf servlet alias
+cxfServletAlias | /cxf    | Name of the cxf servlet alias
 
 The absolute address of a service is determined by :
 
@@ -22,7 +22,7 @@ The absolute address of a service is determined by :
 
 The IntentManager service tracks intent services and allows to apply these to a client or
endpoint.
 
-An intent is marked by the service property `org.apache.cxf.dosgi.IntentName`. The value
of this property represents the name of the intent that the user can specify on his service
to refer to the intent.
+An intent is marked by the service property `org.apache.cxf.dosgi.IntentName` or `intentName`.
The value of this property represents the name of the intent that the user can specify on
his service to refer to the intent.
 
 An intent can be of the following types.
 

http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/919cfb78/common/src/main/java/org/apache/cxf/dosgi/common/intent/IntentManager.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/cxf/dosgi/common/intent/IntentManager.java b/common/src/main/java/org/apache/cxf/dosgi/common/intent/IntentManager.java
index 512b617..deeae0a 100644
--- a/common/src/main/java/org/apache/cxf/dosgi/common/intent/IntentManager.java
+++ b/common/src/main/java/org/apache/cxf/dosgi/common/intent/IntentManager.java
@@ -24,6 +24,7 @@ import java.util.Set;
 
 public interface IntentManager {
     String INTENT_NAME_PROP = "org.apache.cxf.dosgi.IntentName";
+    String INTENT_NAME_PROP2 = "intentName";
 
     Set<String> getExported(Map<String, Object> sd);
 

http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/919cfb78/common/src/main/java/org/apache/cxf/dosgi/common/intent/impl/IntentManagerImpl.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/cxf/dosgi/common/intent/impl/IntentManagerImpl.java
b/common/src/main/java/org/apache/cxf/dosgi/common/intent/impl/IntentManagerImpl.java
index bbef774..de0247e 100644
--- a/common/src/main/java/org/apache/cxf/dosgi/common/intent/impl/IntentManagerImpl.java
+++ b/common/src/main/java/org/apache/cxf/dosgi/common/intent/impl/IntentManagerImpl.java
@@ -55,20 +55,27 @@ public class IntentManagerImpl implements IntentManager {
 
     @Activate
     public void activate(BundleContext context) throws InvalidSyntaxException {
-        Filter filter = FrameworkUtil.createFilter("(" + IntentManager.INTENT_NAME_PROP +
"=*)");
+        String filterSt = String.format("(|(%s=*)(%s=*))",  INTENT_NAME_PROP, INTENT_NAME_PROP2);
+        Filter filter = FrameworkUtil.createFilter(filterSt);
         tracker = new ServiceTracker<Object, Object>(context, filter, null) {
             @Override
             public Object addingService(ServiceReference<Object> reference) {
                 Object intent = super.addingService(reference);
-                addIntent(intent, (String)reference.getProperty(INTENT_NAME_PROP));
+                addIntent(intent, getName(reference));
                 return intent;
             }
-            
+
             @Override
             public void removedService(ServiceReference<Object> reference, Object intent)
{
-                removeIntent(intent, (String)reference.getProperty(INTENT_NAME_PROP));
+                removeIntent(intent, getName(reference));
                 super.removedService(reference, intent);
             }
+
+            private String getName(ServiceReference<Object> reference) {
+                String name = (String)reference.getProperty(INTENT_NAME_PROP);
+                String name2 = (String)reference.getProperty(INTENT_NAME_PROP2);
+                return name != null ? name : name2;
+            }
         };
         tracker.open();
     }

http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/919cfb78/samples/pom.xml
----------------------------------------------------------------------
diff --git a/samples/pom.xml b/samples/pom.xml
index 975c2ee..5d08022 100644
--- a/samples/pom.xml
+++ b/samples/pom.xml
@@ -23,7 +23,7 @@
     <groupId>org.apache.cxf.dosgi.samples</groupId>
     <artifactId>cxf-dosgi-ri-samples</artifactId>
     <packaging>pom</packaging>
-    <name>CXF DOSGi RI Sample Bundles</name>
+    <name>CXF DOSGi Sample Bundles</name>
     <url>http://cxf.apache.org/</url>
 
     <parent>


Mime
View raw message