felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1690372 - in /felix/trunk/scr/src/main/java/org/apache/felix/scr/impl: helper/BindMethod.java helper/BindMethods.java helper/FieldHandler.java helper/UnbindMethod.java helper/UpdatedMethod.java manager/DependencyManager.java
Date Sat, 11 Jul 2015 14:47:48 GMT
Author: cziegeler
Date: Sat Jul 11 14:47:48 2015
New Revision: 1690372

URL: http://svn.apache.org/r1690372
Log:
[DS][RFC-212] Various issues with field references

Modified:
    felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/helper/BindMethod.java
    felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/helper/BindMethods.java
    felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/helper/FieldHandler.java
    felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/helper/UnbindMethod.java
    felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/helper/UpdatedMethod.java
    felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/DependencyManager.java

Modified: felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/helper/BindMethod.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/helper/BindMethod.java?rev=1690372&r1=1690371&r2=1690372&view=diff
==============================================================================
--- felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/helper/BindMethod.java (original)
+++ felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/helper/BindMethod.java Sat Jul
11 14:47:48 2015
@@ -43,8 +43,6 @@ implements org.apache.felix.scr.impl.hel
 {
     private final String m_referenceClassName;
 
-    private final ReferenceMetadata.ReferenceScope m_referenceScope;
-
     private enum ParamType {
         serviceReference,
         serviceObjects,
@@ -57,11 +55,10 @@ implements org.apache.felix.scr.impl.hel
 
 
     public BindMethod( final String methodName,
-            final Class<?> componentClass, final String referenceClassName, final DSVersion
dsVersion, final boolean configurableServiceProperties, ReferenceScope referenceScope )
+            final Class<?> componentClass, final String referenceClassName, final DSVersion
dsVersion, final boolean configurableServiceProperties )
     {
         super( methodName, componentClass, dsVersion, configurableServiceProperties );
         m_referenceClassName = referenceClassName;
-        m_referenceScope = referenceScope;
     }
 
 

Modified: felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/helper/BindMethods.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/helper/BindMethods.java?rev=1690372&r1=1690371&r2=1690372&view=diff
==============================================================================
--- felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/helper/BindMethods.java (original)
+++ felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/helper/BindMethods.java Sat Jul
11 14:47:48 2015
@@ -36,24 +36,23 @@ public class BindMethods implements Refe
     public BindMethods( ReferenceMetadata m_dependencyMetadata, Class<?> instanceClass,
             final DSVersion dsVersion, final boolean configurableServiceProperties )
     {
-        ReferenceMetadata.ReferenceScope referenceScope = m_dependencyMetadata.getScope();
         m_bind = new org.apache.felix.scr.impl.helper.BindMethod(
                 m_dependencyMetadata.getBind(),
                 instanceClass,
                 m_dependencyMetadata.getInterface(),
-                dsVersion, configurableServiceProperties, referenceScope
+                dsVersion, configurableServiceProperties
         );
         m_updated = new org.apache.felix.scr.impl.helper.UpdatedMethod(
                 m_dependencyMetadata.getUpdated(),
                 instanceClass,
                 m_dependencyMetadata.getInterface(),
-                dsVersion, configurableServiceProperties, referenceScope
+                dsVersion, configurableServiceProperties
         );
         m_unbind = new org.apache.felix.scr.impl.helper.UnbindMethod(
                 m_dependencyMetadata.getUnbind(),
                 instanceClass,
                 m_dependencyMetadata.getInterface(),
-                dsVersion, configurableServiceProperties, referenceScope
+                dsVersion, configurableServiceProperties
         );
     }
 

Modified: felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/helper/FieldHandler.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/helper/FieldHandler.java?rev=1690372&r1=1690371&r2=1690372&view=diff
==============================================================================
--- felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/helper/FieldHandler.java (original)
+++ felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/helper/FieldHandler.java Sat Jul
11 14:47:48 2015
@@ -531,7 +531,8 @@ public class FieldHandler
         if ( !this.metadata.isMultiple() )
         {
             // unary references
-            // unbind needs only be done, if reference is dynamic and optional
+            
+        	// unbind needs only be done, if reference is dynamic and optional
             if ( mType == METHOD_TYPE.UNBIND )
             {
                 if ( this.metadata.isOptional() && !this.metadata.isStatic() )
@@ -544,18 +545,16 @@ public class FieldHandler
                 }
                 this.boundValues.remove(refPair);
             }
-            // updated needs only be done, if reference is dynamic and optional
+            // updated needs only be done, if reference is dynamic
             // and the value type is map or tuple
             else if ( mType == METHOD_TYPE.UPDATED )
             {
-                if ( this.metadata.isOptional() && !this.metadata.isStatic() )
+                if ( !this.metadata.isStatic() 
+                	 && ( this.valueType == ParamType.map || this.valueType == ParamType.tuple
) )
                 {
-                    if ( this.valueType == ParamType.map || this.valueType == ParamType.tuple
)
-                    {
-                        final Object obj = getValue(key, refPair);
-                        this.setFieldValue(componentInstance, obj);
-                        this.boundValues.put(refPair, obj);
-                    }
+                    final Object obj = getValue(key, refPair);
+                    this.setFieldValue(componentInstance, obj);
+                    this.boundValues.put(refPair, obj);
                 }
             }
             // bind needs always be done

Modified: felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/helper/UnbindMethod.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/helper/UnbindMethod.java?rev=1690372&r1=1690371&r2=1690372&view=diff
==============================================================================
--- felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/helper/UnbindMethod.java (original)
+++ felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/helper/UnbindMethod.java Sat Jul
11 14:47:48 2015
@@ -30,9 +30,9 @@ implements org.apache.felix.scr.impl.hel
 {
 
     public UnbindMethod( final String methodName,
-            final Class<?> componentClass, final String referenceClassName, final DSVersion
dsVersion, final boolean configurableServiceProperties, ReferenceMetadata.ReferenceScope referenceScope
)
+            final Class<?> componentClass, final String referenceClassName, final DSVersion
dsVersion, final boolean configurableServiceProperties )
     {
-        super( methodName, componentClass, referenceClassName, dsVersion, configurableServiceProperties,
referenceScope );
+        super( methodName, componentClass, referenceClassName, dsVersion, configurableServiceProperties
);
     }
 
 

Modified: felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/helper/UpdatedMethod.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/helper/UpdatedMethod.java?rev=1690372&r1=1690371&r2=1690372&view=diff
==============================================================================
--- felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/helper/UpdatedMethod.java (original)
+++ felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/helper/UpdatedMethod.java Sat
Jul 11 14:47:48 2015
@@ -30,9 +30,9 @@ implements org.apache.felix.scr.impl.hel
 {
 
     public UpdatedMethod( final String methodName,
-            final Class<?> componentClass, final String referenceClassName, final DSVersion
dsVersion, final boolean configurableServiceProperties, ReferenceMetadata.ReferenceScope referenceScope
)
+            final Class<?> componentClass, final String referenceClassName, final DSVersion
dsVersion, final boolean configurableServiceProperties )
     {
-        super( methodName, componentClass, referenceClassName, dsVersion, configurableServiceProperties,
referenceScope );
+        super( methodName, componentClass, referenceClassName, dsVersion, configurableServiceProperties
);
     }
 
 

Modified: felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/DependencyManager.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/DependencyManager.java?rev=1690372&r1=1690371&r2=1690372&view=diff
==============================================================================
--- felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/DependencyManager.java
(original)
+++ felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/DependencyManager.java
Sat Jul 11 14:47:48 2015
@@ -1621,7 +1621,7 @@ public class DependencyManager<S, T> imp
      */
     void invokeUpdatedMethod( ComponentContextImpl<S> componentContext, final RefPair<S,
T> refPair, int trackingCount, EdgeInfo info )
     {
-        if ( m_dependencyMetadata.getUpdated() == null )
+        if ( m_dependencyMetadata.getUpdated() == null && m_dependencyMetadata.getField()
== null )
         {
             return;
         }



Mime
View raw message