Return-Path: X-Original-To: apmail-felix-commits-archive@www.apache.org Delivered-To: apmail-felix-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8A9BF1740E for ; Sat, 11 Jul 2015 14:47:49 +0000 (UTC) Received: (qmail 39767 invoked by uid 500); 11 Jul 2015 14:47:49 -0000 Delivered-To: apmail-felix-commits-archive@felix.apache.org Received: (qmail 39720 invoked by uid 500); 11 Jul 2015 14:47:49 -0000 Mailing-List: contact commits-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list commits@felix.apache.org Received: (qmail 39711 invoked by uid 99); 11 Jul 2015 14:47:49 -0000 Received: from eris.apache.org (HELO hades.apache.org) (140.211.11.105) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 11 Jul 2015 14:47:49 +0000 Received: from hades.apache.org (localhost [127.0.0.1]) by hades.apache.org (ASF Mail Server at hades.apache.org) with ESMTP id 2DB42AC0032 for ; Sat, 11 Jul 2015 14:47:49 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@felix.apache.org From: cziegeler@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20150711144749.2DB42AC0032@hades.apache.org> 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 imp */ void invokeUpdatedMethod( ComponentContextImpl componentContext, final RefPair refPair, int trackingCount, EdgeInfo info ) { - if ( m_dependencyMetadata.getUpdated() == null ) + if ( m_dependencyMetadata.getUpdated() == null && m_dependencyMetadata.getField() == null ) { return; }