felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pde...@apache.org
Subject svn commit: r907745 - /felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/ComponentManager.java
Date Mon, 08 Feb 2010 18:25:19 GMT
Author: pderop
Date: Mon Feb  8 18:25:16 2010
New Revision: 907745

URL: http://svn.apache.org/viewvc?rev=907745&view=rev
Log:
fixed javadoc. Added Aspect support

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=907745&r1=907744&r2=907745&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
Mon Feb  8 18:25:16 2010
@@ -41,7 +41,7 @@
 
 /**
  * This class parses service descriptors generated by the annotation bnd processor.
- * The descriptors are located under OSGI-INF/ directory. Such files are actually 
+ * The descriptors are located under OSGI-INF/dependencymanager directory. Such files are
actually 
  * referenced by a specific "DependendencyManager-Component" manifest header.
  */
 public class ComponentManager implements SynchronousBundleListener
@@ -151,6 +151,10 @@
                         service = createService(b, dm, parser);
                         break;
 
+                    case AspectService:
+                        service = createAspectService(b, dm, parser);
+                        break;
+                        
                     case ServiceDependency:
                         checkServiceParsed(service);
                         service.add(createServiceDependency(b, dm, parser, false));
@@ -372,4 +376,22 @@
         cd.setCallback(callback);
         return cd;
     }
+
+    /**
+     * Creates an Aspect Service.
+     * @param b
+     * @param dm
+     * @param parser
+     * @return
+     */
+    private Service createAspectService(Bundle b, DependencyManager dm, DescriptorParser
parser)
+        throws ClassNotFoundException
+    {
+        Class<?> serviceInterface = b.loadClass(parser.getString(DescriptorParam.service));
+        String serviceFilter = parser.getString(DescriptorParam.filter, null);
+        Class<?> aspectImplementation = b.loadClass(parser.getString(DescriptorParam.impl));
+        Dictionary<String, String> aspectProperties = parser.getDictionary(DescriptorParam.properties,
null);
+        Service service = dm.createAspectService(serviceInterface, serviceFilter, aspectImplementation,
aspectProperties);
+        return service;
+    }
 }



Mime
View raw message