felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pde...@apache.org
Subject svn commit: r918680 - /felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/ComponentManager.java
Date Wed, 03 Mar 2010 20:58:01 GMT
Author: pderop
Date: Wed Mar  3 20:58:00 2010
New Revision: 918680

URL: http://svn.apache.org/viewvc?rev=918680&view=rev
Log:
added annotation support for BundleAdapterService. Fixed wrong default value for "propagate"
BundleDependency attribute

Modified:
    felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/ComponentManager.java

Modified: felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/ComponentManager.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/ComponentManager.java?rev=918680&r1=918679&r2=918680&view=diff
==============================================================================
--- felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/ComponentManager.java
(original)
+++ felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/ComponentManager.java
Wed Mar  3 20:58:00 2010
@@ -160,6 +160,10 @@
                         service = createAdapterService(b, dm, parser);
                         break;
                         
+                    case BundleAdapterService:
+                        service = createBundleAdapterService(b, dm, parser);
+                        break;
+
                     case ServiceDependency:
                         checkServiceParsed(service);
                         service.add(createServiceDependency(b, dm, parser, false));
@@ -362,6 +366,28 @@
     }
 
     /**
+     * Creates a Bundle Adapter Service.
+     * @param b
+     * @param dm
+     * @param parser
+     * @return
+     */
+    private Service createBundleAdapterService(Bundle b, DependencyManager dm, DescriptorParser
parser)
+        throws ClassNotFoundException
+    {
+        int stateMask = parser.getInt(DescriptorParam.stateMask, Bundle.INSTALLED | Bundle.RESOLVED
| Bundle.ACTIVE);
+        String filter = parser.getString(DescriptorParam.filter, null);
+        Class<?> adapterImpl = b.loadClass(parser.getString(DescriptorParam.impl));
+        String service = parser.getString(DescriptorParam.service);
+        Dictionary<String, String> properties = parser.getDictionary(DescriptorParam.properties,
null);
+        boolean propagate = "true".equals(parser.getString(DescriptorParam.propagate, "false"));
+        Service srv = dm.createBundleAdapterService(stateMask, filter, adapterImpl, service,
properties, propagate);  
+        setServiceCallbacks(srv, parser);
+        setServiceComposition(srv, parser);
+        return srv;
+    }
+
+    /**
      * Creates a ServiceDependency that we parsed from a component descriptor "ServiceDependency"
entry.
      * @param b
      * @param dm
@@ -486,7 +512,7 @@
         }
 
         // propagate
-        bd.setPropagate("true".equals(parser.getString(DescriptorParam.stateMask, "true")));
+        bd.setPropagate("true".equals(parser.getString(DescriptorParam.stateMask, "false")));
         return bd;
     }
 }



Mime
View raw message