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 B0295181A5 for ; Sat, 27 Feb 2016 17:09:18 +0000 (UTC) Received: (qmail 34828 invoked by uid 500); 27 Feb 2016 17:09:18 -0000 Delivered-To: apmail-felix-dev-archive@felix.apache.org Received: (qmail 34752 invoked by uid 500); 27 Feb 2016 17:09:18 -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 34741 invoked by uid 99); 27 Feb 2016 17:09:18 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 27 Feb 2016 17:09:18 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 24B622C14F2 for ; Sat, 27 Feb 2016 17:09:18 +0000 (UTC) Date: Sat, 27 Feb 2016 17:09:18 +0000 (UTC) From: "Pierre De Rop (JIRA)" To: dev@felix.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (FELIX-5200) Factory Configuration Adapter Not Retarted 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-5200?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Pierre De Rop resolved FELIX-5200. ---------------------------------- Resolution: Fixed Fixed issue in rv 1732653, and added the following test case: org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/api/FELIX5200_FactoryPidNotRestartedTest.java > Factory Configuration Adapter Not Retarted > ------------------------------------------ > > Key: FELIX-5200 > URL: https://issues.apache.org/jira/browse/FELIX-5200 > Project: Felix > Issue Type: Bug > Components: Dependency Manager > Affects Versions: org.apache.felix.dependencymanager-r1 > Reporter: Pierre De Rop > Assignee: Pierre De Rop > Fix For: org.apache.felix.dependencymanager-r7 > > > When a factory pid adapter is losing one of its required service dependencies, it is stopped, but when the lost dependency comes up again, the configuration adapter instance is not re-created and re-started. > Example: > * A factory configuration adapter has a required dependency on a "Required" service. > * The factory configuration is created, the "Required" service is registered, so a factory configuration adapter INSTANCE1 is then created. > * Now the "Required" service is unregistered: the INSTANCE1 is then stopped. > * And when the "Required" service comes up again, then a new factory config adapter INSTANCE2 should be re-created, updated and started, But since R1 this is not the case anymore. > The bug is located in the AbstractDecorator.stop() method, this method currently does this: > {code} > public void stop() { > for (Component component : m_services.values()) { > m_manager.remove(component); > } > } > {code} > Clearly, this is a bug because the "m_services" list is not cleared, so when the AbstractDecorator.updated(String, Dictionary) method is called again, it finds again some old stale components, and updates them instead of re-creating new adapter instances. > In DM3, the list was correctly cleared: > {code} > public void stop() { > Object[] components; > synchronized (m_services) { > components = m_services.values().toArray(); > m_services.clear(); > } > for (int i = 0; i < components.length; i++) { > m_manager.remove((Component) components[i]); > } > } > {code} > I will add a test case soon. -- This message was sent by Atlassian JIRA (v6.3.4#6332)