felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r937258 - /felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/helper/PropertyHandler.java
Date Fri, 23 Apr 2010 11:41:39 GMT
Author: cziegeler
Date: Fri Apr 23 11:41:38 2010
New Revision: 937258

URL: http://svn.apache.org/viewvc?rev=937258&view=rev
Log:
FELIX-2300 : SCR Plugin should be able to produce a metatype property for service.ranking.
Apply patch from Justin Edelson

Modified:
    felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/helper/PropertyHandler.java

Modified: felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/helper/PropertyHandler.java
URL: http://svn.apache.org/viewvc/felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/helper/PropertyHandler.java?rev=937258&r1=937257&r2=937258&view=diff
==============================================================================
--- felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/helper/PropertyHandler.java
(original)
+++ felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/helper/PropertyHandler.java
Fri Apr 23 11:41:38 2010
@@ -114,15 +114,7 @@ public class PropertyHandler {
 
         // property is private if explicitly marked or a well known
         // service property such as service.pid
-        final boolean isPrivate = SCRDescriptorGenerator.getBoolean(tag,
-            Constants.PROPERTY_PRIVATE, false)
-            || name.equals(org.osgi.framework.Constants.SERVICE_PID)
-            || name.equals(org.osgi.framework.Constants.SERVICE_DESCRIPTION)
-            || name.equals(org.osgi.framework.Constants.SERVICE_ID)
-            || name.equals(org.osgi.framework.Constants.SERVICE_RANKING)
-            || name.equals(org.osgi.framework.Constants.SERVICE_VENDOR)
-            || name.equals(ConfigurationAdmin.SERVICE_BUNDLELOCATION)
-            || name.equals(ConfigurationAdmin.SERVICE_FACTORYPID);
+        final boolean isPrivate = isPrivate(name, tag);
 
         // if this is an abstract component we store the extra info in the property
         if ( component.isAbstract() ) {
@@ -190,6 +182,22 @@ public class PropertyHandler {
 
         component.addProperty(prop);
     }
+    
+    private boolean isPrivate(String name, JavaTag tag) {
+        if (name.equals(org.osgi.framework.Constants.SERVICE_RANKING)) {
+            return SCRDescriptorGenerator.getBoolean(tag,
+                Constants.PROPERTY_PRIVATE, true);
+        } else {
+            return SCRDescriptorGenerator.getBoolean(tag,
+                Constants.PROPERTY_PRIVATE, false)
+                || name.equals(org.osgi.framework.Constants.SERVICE_PID)
+                || name.equals(org.osgi.framework.Constants.SERVICE_DESCRIPTION)
+                || name.equals(org.osgi.framework.Constants.SERVICE_ID)
+                || name.equals(org.osgi.framework.Constants.SERVICE_VENDOR)
+                || name.equals(ConfigurationAdmin.SERVICE_BUNDLELOCATION)
+                || name.equals(ConfigurationAdmin.SERVICE_FACTORYPID);
+        }
+    }
 
     /**
      * Return the name of the property.



Mime
View raw message