felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pde...@apache.org
Subject svn commit: r912252 - in /felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime: ComponentManager.java DescriptorEntry.java DescriptorParam.java DescriptorParser.java
Date Sat, 20 Feb 2010 23:30:53 GMT
Author: pderop
Date: Sat Feb 20 23:30:53 2010
New Revision: 912252

URL: http://svn.apache.org/viewvc?rev=912252&view=rev
Log:
added support for annotated adapter services

Modified:
    felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/ComponentManager.java
    felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/DescriptorEntry.java
    felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/DescriptorParam.java
    felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/DescriptorParser.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=912252&r1=912251&r2=912252&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
Sat Feb 20 23:30:53 2010
@@ -155,6 +155,10 @@
                         service = createAspectService(b, dm, parser);
                         break;
                         
+                    case AdapterService:
+                        service = createAdapterService(b, dm, parser);
+                        break;
+                        
                     case ServiceDependency:
                         checkServiceParsed(service);
                         service.add(createServiceDependency(b, dm, parser, false));
@@ -329,6 +333,28 @@
     }
 
     /**
+     * Creates an Adapter Service.
+     * @param b
+     * @param dm
+     * @param parser
+     * @return
+     */
+    private Service createAdapterService(Bundle b, DependencyManager dm, DescriptorParser
parser)
+        throws ClassNotFoundException
+    {
+        Class<?> adapterImpl = b.loadClass(parser.getString(DescriptorParam.impl));
+        Class<?> adapterService = b.loadClass(parser.getString(DescriptorParam.adapterService));
+        Dictionary<String, String> adapterProperties = parser.getDictionary(DescriptorParam.adapterProperties,
null);
+        Class<?> adapteeService = b.loadClass(parser.getString(DescriptorParam.adapteeService));
+        String adapteeFilter = parser.getString(DescriptorParam.adapteeFilter, null);
+     
+        Service service = dm.createAdapterService(adapteeService, adapteeFilter, adapterService,
adapterImpl, adapterProperties);
+        setServiceCallbacks(service, parser);
+        setServiceComposition(service, parser);
+        return service;
+    }
+
+    /**
      * Creates a ServiceDependency that we parsed from a component descriptor "ServiceDependency"
entry.
      * @param b
      * @param dm

Modified: felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/DescriptorEntry.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/DescriptorEntry.java?rev=912252&r1=912251&r2=912252&view=diff
==============================================================================
--- felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/DescriptorEntry.java
(original)
+++ felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/DescriptorEntry.java
Sat Feb 20 23:30:53 2010
@@ -26,6 +26,7 @@
 {
     Service,
     AspectService,
+    AdapterService,
     ServiceDependency,
     TemporalServiceDependency,
     ConfigurationDependency

Modified: felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/DescriptorParam.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/DescriptorParam.java?rev=912252&r1=912251&r2=912252&view=diff
==============================================================================
--- felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/DescriptorParam.java
(original)
+++ felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/DescriptorParam.java
Sat Feb 20 23:30:53 2010
@@ -90,7 +90,19 @@
     updated,
     
     /* TemporalServiceDependency attribute for the timeout (the parsed value is a String)
*/
-    timeout;
+    timeout,
+    
+    /* AdapterService attribute for the adapter interface (the parsed value is a String)
*/
+    adapterService,
+    
+    /* AdapterService attribute for the adapter service properties (the parsed value is a
Hashtable) */
+    adapterProperties,
+    
+    /* AdapterService attribute for the adaptee service (the parsed value is a String) */
+    adapteeService,
+    
+    /* AdapterService attribute for the adaptee service filter (the parsed value is a String)
*/
+    adapteeFilter;
     
     /**
      * Indicates if a given attribute is a Service attribute.

Modified: felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/DescriptorParser.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/DescriptorParser.java?rev=912252&r1=912251&r2=912252&view=diff
==============================================================================
--- felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/DescriptorParser.java
(original)
+++ felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/DescriptorParser.java
Sat Feb 20 23:30:53 2010
@@ -56,7 +56,8 @@
  *    params := paramName '=' paramValue ( ';' paramName '=' paramValue )*
  *    
  *    paramName := init | start | stop | destroy | impl | provide | properties | factory
| factoryMethod | composition | service | filter | 
- *                 defaultImpl | required | added | changed | removed | autoConfig | pid
| propagate | updated | timeout
+ *                 defaultImpl | required | added | changed | removed | autoConfig | pid
| propagate | updated | timeout |
+ *                 adapterService | adapterProperties | adapteeService | adapteeFilter
  *    init := 'init'
  *    start := 'start'
  *    stop := 'stop'
@@ -79,7 +80,11 @@
  *    propagate := 'propagate'
  *    updated := 'updated'
  *    timeout := 'timeout'
- *    
+ *    adapterService := 'adapterService'
+ *    adapterProperties := 'adapterProperties'
+ *    adapteeService := 'adapteeService'
+ *    adapteeFilter := 'adapteeFilter'
+ *     
  *    paramValue := strings | attributes
  *    strings := string ( ',' string )*
  *    attributes := string ':' string ( ',' string : string )*



Mime
View raw message