aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n..@apache.org
Subject svn commit: r1240647 - /aries/trunk/application/application-runtime-framework/src/main/java/org/apache/aries/application/runtime/framework/config/BundleFrameworkConfigurationFactoryImpl.java
Date Sun, 05 Feb 2012 00:03:05 GMT
Author: not
Date: Sun Feb  5 00:03:04 2012
New Revision: 1240647

URL: http://svn.apache.org/viewvc?rev=1240647&view=rev
Log:
ARIES-770 Committing patch from Richard Ellis. Changed from a StringBuffer to a StringBuilder
at the same time.

Modified:
    aries/trunk/application/application-runtime-framework/src/main/java/org/apache/aries/application/runtime/framework/config/BundleFrameworkConfigurationFactoryImpl.java

Modified: aries/trunk/application/application-runtime-framework/src/main/java/org/apache/aries/application/runtime/framework/config/BundleFrameworkConfigurationFactoryImpl.java
URL: http://svn.apache.org/viewvc/aries/trunk/application/application-runtime-framework/src/main/java/org/apache/aries/application/runtime/framework/config/BundleFrameworkConfigurationFactoryImpl.java?rev=1240647&r1=1240646&r2=1240647&view=diff
==============================================================================
--- aries/trunk/application/application-runtime-framework/src/main/java/org/apache/aries/application/runtime/framework/config/BundleFrameworkConfigurationFactoryImpl.java
(original)
+++ aries/trunk/application/application-runtime-framework/src/main/java/org/apache/aries/application/runtime/framework/config/BundleFrameworkConfigurationFactoryImpl.java
Sun Feb  5 00:03:04 2012
@@ -82,15 +82,25 @@ public class BundleFrameworkConfiguratio
     /**
      * Set up CompositeServiceFilter-Import header for framework manifest
      */
-    StringBuffer serviceImportFilter = new StringBuffer("(" + Constants.OBJECTCLASS + "="
-        + EquinoxFrameworkConstants.TRANSACTION_REGISTRY_BUNDLE + ")");
+    StringBuilder serviceImportFilter = new StringBuilder();
+    String txRegsitryImport = "(" + Constants.OBJECTCLASS + "=" + EquinoxFrameworkConstants.TRANSACTION_REGISTRY_BUNDLE
+ ")";
 
+    Collection<Filter> deployedServiceImports = metadata.getDeployedServiceImport();
+    //if there are more services than the txRegistry import a OR group is required for the
Filter
+    if (deployedServiceImports.size() > 0){
+      serviceImportFilter.append("(|");
+    }
+    
     for (Filter importFilter : metadata.getDeployedServiceImport()) {
-      if (serviceImportFilter.length() > 0) {
-        serviceImportFilter.append(",");
-      }
       serviceImportFilter.append(importFilter.toString());
     }
+    
+    serviceImportFilter.append(txRegsitryImport);
+    
+    //close the OR group if needed
+    if (deployedServiceImports.size() > 0){
+      serviceImportFilter.append(")");
+    }
 
     frameworkBundleManifest.put(EquinoxFrameworkConstants.COMPOSITE_SERVICE_FILTER_IMPORT,
         serviceImportFilter.toString());



Mime
View raw message