Return-Path: X-Original-To: apmail-felix-dev-archive@www.apache.org Delivered-To: apmail-felix-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2242518945 for ; Tue, 14 Jul 2015 03:33:05 +0000 (UTC) Received: (qmail 24562 invoked by uid 500); 14 Jul 2015 03:33:04 -0000 Delivered-To: apmail-felix-dev-archive@felix.apache.org Received: (qmail 24492 invoked by uid 500); 14 Jul 2015 03:33:04 -0000 Mailing-List: contact dev-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 dev@felix.apache.org Received: (qmail 24471 invoked by uid 99); 14 Jul 2015 03:33:04 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Jul 2015 03:33:04 +0000 Date: Tue, 14 Jul 2015 03:33:04 +0000 (UTC) From: "Carsten Ziegeler (JIRA)" To: dev@felix.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Reopened] (FELIX-4957) [DS][RFC-212] Various issues with field references MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/FELIX-4957?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Carsten Ziegeler reopened FELIX-4957: ------------------------------------- > [DS][RFC-212] Various issues with field references > -------------------------------------------------- > > Key: FELIX-4957 > URL: https://issues.apache.org/jira/browse/FELIX-4957 > Project: Felix > Issue Type: Bug > Components: Declarative Services (SCR) > Reporter: Carsten Ziegeler > Assignee: Carsten Ziegeler > Fix For: scr-2.0.0 > > > 1. The DS spec states that non-volatile fields with dynamic references is an error. These fields must not be injected. See 112.3.8.1: > "For a dynamic reference, the field must be declared with the volatile modifier so that field value changes made by SCR are visible to other threads. If the field is not declared with the volatile modifier, SCR must log an error message with the Log Service, if present, and the field must not be modified." > 2. When a field with a dynamic reference holds the service properties of the referenced service, the field must be modified when the referenced service's properties are changed. > See 112.3.8.1: "For a dynamic reference with unary cardinality, SCR must set the field with initial bound service, if any, before the component instance is activated. When there is a new bound service or the service properties of the bound service are modified and the field holds service properties, SCR must replace the field value. " > 3. When a component uses a static field reference holding properties for the referenced service and these service properties change, DS must reactivate the component to inject the updated service properties. > See 112.3.8.1: "For a static reference, SCR must set the value of the field before the component instance is activat- ed and must not change the field while the component is active." > So the component must be reactivated to receive the updated service properties. > 4. When a final field is used as a reference, DS must activate the component but not set the field value. > See 112.3.8.1: "If the field is declared with the final modifier, SCR must log an error message with the Log Service, if present, and the field must not be modified." > 5. If a field reference is optional and there is no bound service, DS must null the field. > See 112.3.8.1: "If the reference has optional cardinality and there is no bound service, SCR must set the field value to null." -- This message was sent by Atlassian JIRA (v6.3.4#6332)