You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by pd...@apache.org on 2010/03/04 08:20:26 UTC

svn commit: r918879 - in /felix/trunk/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation: api/AspectService.java plugin/bnd/AnnotationCollector.java

Author: pderop
Date: Thu Mar  4 07:20:26 2010
New Revision: 918879

URL: http://svn.apache.org/viewvc?rev=918879&view=rev
Log:
added factory and factoryMethod attributes in AspectService annotation

Modified:
    felix/trunk/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/api/AspectService.java
    felix/trunk/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/plugin/bnd/AnnotationCollector.java

Modified: felix/trunk/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/api/AspectService.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/api/AspectService.java?rev=918879&r1=918878&r2=918879&view=diff
==============================================================================
--- felix/trunk/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/api/AspectService.java (original)
+++ felix/trunk/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/api/AspectService.java Thu Mar  4 07:20:26 2010
@@ -62,4 +62,18 @@
      * @return the ranking of this aspect
      */
     int ranking();
+    
+    /**
+     * Returns the Class of the class which acts as a factory for this Service. The default method
+     * factory name is "create". If you need to invoke another method, then you can use the 
+     * <code>factoryMethod</code> attribute.
+     * @return the factory Class name.
+     */
+    Class<?> factory() default Object.class;
+
+    /**
+     * Returns the method name of the factory class which will create our Service instance.
+     * @return the factory method name.
+     */
+    String factoryMethod() default "";
 }

Modified: felix/trunk/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/plugin/bnd/AnnotationCollector.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/plugin/bnd/AnnotationCollector.java?rev=918879&r1=918878&r2=918879&view=diff
==============================================================================
--- felix/trunk/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/plugin/bnd/AnnotationCollector.java (original)
+++ felix/trunk/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/plugin/bnd/AnnotationCollector.java Thu Mar  4 07:20:26 2010
@@ -610,6 +610,12 @@
         // Register previously parsed Init/Start/Stop/Destroy/Composition annotations
         addInitStartStopDestroyCompositionParams(info);
         
+        // factory attribute
+        info.addClassParam(annotation, Params.factory, null);
+
+        // factoryMethod attribute
+        info.addParam(annotation, Params.factoryMethod, null);
+        
         // Parse service filter
         String filter = annotation.get(Params.filter.toString());
         if (filter != null) {