felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pde...@apache.org
Subject svn commit: r1437355 - in /felix/trunk/dependencymanager: annotation/src/main/java/org/apache/felix/dm/annotation/api/ annotation/src/main/java/org/apache/felix/dm/annotation/plugin/bnd/ runtime/ runtime/src/main/java/org/apache/felix/dm/runtime/
Date Wed, 23 Jan 2013 11:56:57 GMT
Author: pderop
Date: Wed Jan 23 11:56:56 2013
New Revision: 1437355

URL: http://svn.apache.org/viewvc?rev=1437355&view=rev
Log:
[FELIX-3866] Added support for swap attribute in AspectService and AdpaterService annotations.

Modified:
    felix/trunk/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/api/AdapterService.java
    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
    felix/trunk/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/plugin/bnd/EntryParam.java
    felix/trunk/dependencymanager/runtime/pom.xml
    felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/Activator.java
    felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/AdapterServiceBuilder.java
    felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/AspectServiceBuilder.java
    felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/Params.java

Modified: felix/trunk/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/api/AdapterService.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/api/AdapterService.java?rev=1437355&r1=1437354&r2=1437355&view=diff
==============================================================================
--- felix/trunk/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/api/AdapterService.java
(original)
+++ felix/trunk/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/api/AdapterService.java
Wed Jan 23 11:56:56 2013
@@ -106,6 +106,11 @@ public @interface AdapterService
     String changed() default "";
 
     /**
+     * name of the callback method to invoke on swap.
+     */
+    String swap() default "";
+
+    /**
      * The callback method to invoke when the service is lost. When this attribute is used,
then the added attribute 
      * must also be used.
      */

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=1437355&r1=1437354&r2=1437355&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
Wed Jan 23 11:56:56 2013
@@ -107,6 +107,11 @@ public @interface AspectService
     String removed() default "";
     
     /**
+     * name of the callback method to invoke on swap.
+     */
+    String swap() default "";
+
+    /**
      * Sets the static method used to create the AspectService implementation instance. The
      * default constructor of the annotated class is used. The factoryMethod can be used
to provide a specific
      * aspect implements, like a DynamicProxy.

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=1437355&r1=1437354&r2=1437355&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
Wed Jan 23 11:56:56 2013
@@ -595,9 +595,10 @@ public class AnnotationCollector extends
         String added = annotation.get(EntryParam.added.toString());
         String changed = annotation.get(EntryParam.changed.toString());
         String removed = annotation.get(EntryParam.removed.toString());
+        String swap = annotation.get(EntryParam.swap.toString());
 
-        // "field" and "added/changed/removed" attributes can't be mixed
-        if (field != null && (added != null || changed != null || removed != null))
+        // "field" and "added/changed/removed/swap" attributes can't be mixed
+        if (field != null && (added != null || changed != null || removed != null
|| swap != null))
         {
             throw new IllegalStateException("Annotation " + annotation + "can't applied on
" + m_className
                     + " can't mix \"field\" attribute with \"added/changed/removed\" attributes");
@@ -617,6 +618,7 @@ public class AnnotationCollector extends
         writer.putString(annotation, EntryParam.added, null);
         writer.putString(annotation, EntryParam.changed, null);
         writer.putString(annotation, EntryParam.removed, null);
+        writer.putString(annotation, EntryParam.swap, null);
     }
 
     /**

Modified: felix/trunk/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/plugin/bnd/EntryParam.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/plugin/bnd/EntryParam.java?rev=1437355&r1=1437354&r2=1437355&view=diff
==============================================================================
--- felix/trunk/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/plugin/bnd/EntryParam.java
(original)
+++ felix/trunk/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/plugin/bnd/EntryParam.java
Wed Jan 23 11:56:56 2013
@@ -40,6 +40,7 @@ public enum EntryParam
     added, 
     changed,
     removed,
+    swap,
     autoConfig, 
     pid, 
     factoryPid,

Modified: felix/trunk/dependencymanager/runtime/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/runtime/pom.xml?rev=1437355&r1=1437354&r2=1437355&view=diff
==============================================================================
--- felix/trunk/dependencymanager/runtime/pom.xml (original)
+++ felix/trunk/dependencymanager/runtime/pom.xml Wed Jan 23 11:56:56 2013
@@ -43,7 +43,7 @@
         <dependency>
             <groupId>${pom.groupId}</groupId>
             <artifactId>org.apache.felix.dependencymanager</artifactId>
-            <version>3.0.0</version>
+            <version>3.1.0-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>org.json</groupId>

Modified: felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/Activator.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/Activator.java?rev=1437355&r1=1437354&r2=1437355&view=diff
==============================================================================
--- felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/Activator.java
(original)
+++ felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/Activator.java
Wed Jan 23 11:56:56 2013
@@ -28,8 +28,8 @@ import org.osgi.service.log.LogService;
 /*
  * This is the Activator for our DependencyManager Component Runtime.
  * Here, we'll track started/stopped bundles which have some DependencyManager
- * descriptors (META-INF/*.dm). Such descriptors are generated by the Bnd 
- * plugin which parses DependencyManager annotations at compile time.
+ * descriptors (META-INF/dependencymanager/*.dm). Such descriptors are generated 
+ * by the Bnd plugin which parses DependencyManager annotations at compile time.
  * 
  * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
@@ -54,8 +54,8 @@ public class Activator extends Dependenc
      * "DependencyManager-Component" Manifest header.
      * If the "dm.runtime.log=true" parameter is configured in the Felix config.properties
      * then we'll use a required/temporal service dependency over the log service.
-     * This temporal dependency avoids us to be restarted if the log service is temporarily

-     * unavailable (that is: when the log service is updating).
+     * This temporal dependency allows to not being restarted if the log service is temporarily

+     * unavailable (that is: when the log service is updated).
      * if the "dm.runtime.log" is not configured or it it is set to false, then we'll use

      * an optional dependency over the log service, in order to use a NullObject in case
      * the log service is not available.

Modified: felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/AdapterServiceBuilder.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/AdapterServiceBuilder.java?rev=1437355&r1=1437354&r2=1437355&view=diff
==============================================================================
--- felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/AdapterServiceBuilder.java
(original)
+++ felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/AdapterServiceBuilder.java
Wed Jan 23 11:56:56 2013
@@ -54,10 +54,11 @@ public class AdapterServiceBuilder exten
         String added = srvMeta.getString(Params.added, null);
         String changed = srvMeta.getString(Params.changed, null);
         String removed = srvMeta.getString(Params.removed, null);
-        
-        if (field != null && (added != null || changed != null || removed != null))
+        String swap = srvMeta.getString(Params.swap, null);
+
+        if (field != null && (added != null || changed != null || removed != null
|| swap != null))
         {
-            throw new IllegalArgumentException("autoconfig field " + field + " cant be defined
with both added/changed/removed calllbacks");
+            throw new IllegalArgumentException("autoconfig field " + field + " cant be defined
with both added/changed/removed/swap calllbacks");
         }
         if (field == null && added == null && (changed != null || removed
!= null))
         {
@@ -74,7 +75,7 @@ public class AdapterServiceBuilder exten
         {
             if (added != null)
             {
-                c = dm.createAdapterService(adapteeService, adapteeFilter, added, changed,
removed);
+                c = dm.createAdapterService(adapteeService, adapteeFilter, added, changed,
removed, swap);
 
             }
             else

Modified: felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/AspectServiceBuilder.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/AspectServiceBuilder.java?rev=1437355&r1=1437354&r2=1437355&view=diff
==============================================================================
--- felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/AspectServiceBuilder.java
(original)
+++ felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/AspectServiceBuilder.java
Wed Jan 23 11:56:56 2013
@@ -59,10 +59,11 @@ public class AspectServiceBuilder extend
         String added = srvMeta.getString(Params.added, null);
         String changed = srvMeta.getString(Params.changed, null);
         String removed = srvMeta.getString(Params.removed, null);
-        
-        if (field != null && (added != null || changed != null || removed != null))
+        String swap = srvMeta.getString(Params.swap, null);
+
+        if (field != null && (added != null || changed != null || removed != null
|| swap != null))
         {
-            throw new IllegalArgumentException("autoconfig field " + field + " cant be defined
with both added/changed/removed calllbacks");
+            throw new IllegalArgumentException("autoconfig field " + field + " cant be defined
with both added/changed/removed/swap calllbacks");
         }
         if (field == null && added == null && (changed != null || removed
!= null))
         {
@@ -79,7 +80,7 @@ public class AspectServiceBuilder extend
         {
             if (added != null)
             {
-                c = dm.createAspectService(serviceInterface, serviceFilter, ranking, added,
changed, removed)
+                c = dm.createAspectService(serviceInterface, serviceFilter, ranking, added,
changed, removed, swap)
                       .setServiceProperties(aspectProperties);
             } 
             else

Modified: felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/Params.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/Params.java?rev=1437355&r1=1437354&r2=1437355&view=diff
==============================================================================
--- felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/Params.java
(original)
+++ felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/Params.java
Wed Jan 23 11:56:56 2013
@@ -41,6 +41,7 @@ public enum Params
     added,
     changed,
     removed,
+    swap,
     autoConfig,
     pid,
     propagate,



Mime
View raw message