Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[osgi-users] OSGi DS field-option question
  • From: "Fauth Dirk (ETAS/ENA)" <dirk.fauth@xxxxxxxxxxxx>
  • Date: Fri, 10 Jun 2022 10:13:20 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=de.bosch.com; dmarc=pass action=none header.from=de.bosch.com; dkim=pass header.d=de.bosch.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7EsgK5YzdBi5If3q1FeY8DWL0+8ptnS2ZX0S8UqtMxU=; b=AISC0L64lj1mnm+XAhvtLr1kv5FMfAxSJ0dJO7+ExVGHn+z0t8VwAjjbk7xhvXenFL6yxP0nh06aWqAKjsRF06C9YQKlcI0ECfc34aLtPABtEySt207/qAff686DkU0ubBIB3oT4BrmNo++9oyyrqU0UJpv2MG5S+0P2dJrvQQTx+a4nUX7fFdkr2hghRbWOpVPg7XWm08HFQKrzbKtbQJqd75rrOQ6cgeNoWrqIT7+qSKCXxJ4iQca0G8GTBCrhxYNsN4YouWYvLqXT1Ojzurm+vYdO3lnv+MziFH5YRNtBK6p3vdPAAQmjubxgfY1dP3pQI++nxfIwL+8TWCL1vA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GfmbMD9kL1XfVJ1JgYh5+0QeIYBxq7NUY/K7INpj4Bgv5D4bDko/AnDPxfObiPor5O0jlb/dzzjC0vVF5m4av24fXLgcTuginqtLWm4oEwkCPFUaV0zu4X8sifnmEpBbFf67x0Fci3emHpU0FQTJQ8Pe/JqZ5RO/ZPnJQoZY078Q8All6Xv5geh3caFtLVzsIArfL1oWgI4uY4tPGBclQ+Jfw4Ds2hsJCtPcYNJuy426iFKh39HSlNAa+nJPRBfQ8z6GgDSdPJ1dr0cs2pwpo7ZkYp2br19BZS9f4npw87H4uKhd2ByD+MZEE75KGxkcja6cIL+QPstUxvvDz0S5dw==
  • Delivered-to: osgi-users@xxxxxxxxxxx
  • List-archive: <https://dev.eclipse.org/mailman/private/osgi-users/>
  • List-help: <mailto:osgi-users-request@eclipse.org?subject=help>
  • List-subscribe: <https://dev.eclipse.org/mailman/listinfo/osgi-users>, <mailto:osgi-users-request@eclipse.org?subject=subscribe>
  • List-unsubscribe: <https://dev.eclipse.org/mailman/options/osgi-users>, <mailto:osgi-users-request@eclipse.org?subject=unsubscribe>
  • Thread-index: Adh8r+Bnr9k2HZg0R7+AtAr/cUXRdQ==
  • Thread-topic: OSGi DS field-option question

Hi,

 

I am trying to create a service that stores some other service references and exchange them based on a target property.

 

@Component(service = StringModifierRegistry.class)

public class StringModifierRegistry {

 

      @Reference(target = "(!(service.intents=jaxrs))", policy = ReferencePolicy.DYNAMIC)

      final List<StringModifier> stringModifier = new CopyOnWriteArrayList<>();

     

      @Activate

      void activate() {

             System.out.println("registry activated");

      }

     

      @Deactivate

      void deactivate() {

             System.out.println("registry deactivated");

      }

     

      public List<StringModifier> getStringModifier() {

             return this.stringModifier;

      }

}

 

Since the policy is DYNAMIC and the list is final which leads to field-option="update" I would have expected that the list is updated and not replaced if I change the target filter via ConfigurationAdmin. But what I see is that the component gets deactivated and activated whenever I update the configuration.

Switching to event binding also causes deactivate and activate. Maybe it is then not related to the collection update, but I am not sure.

 

Is the deactivate and activate caused by the configuration update of the target target property or because the bound services change? I haven’t found a passage in the specification on that topic. But maybe I looked in the wrong sections.

 

Mit freundlichen Grüßen / Best regards

Dirk Fauth

ETAS Advance Engineering

T +49 711 3423-2174
Dirk.Fauth@xxxxxxxx

ETAS GmbH, ETAS/ENA
Borsigstraße 24, 70469 Stuttgart, Germany
www.etas.com

ETAS – Empowering Tomorrow’s Automotive Software


Managing Directors: Christoph Hartung, Günter Gromeier, Götz Nigge
Chairman of the Supervisory Board: Dr. Walter Schirm
Registered Office: Stuttgart, Registration Court: Amtsgericht Stuttgart, HRB: 19033


Back to the top