Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [osgi-users] Declarative Service Curiosity
  • From: "Fauth Dirk (XC-ECO/ESM1)" <Dirk.Fauth@xxxxxxxxxxxx>
  • Date: Fri, 8 Apr 2022 10:15:15 +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=/fKyOUIVLJC6+jWycuK91VWsyb0wsTsAOG+DdEL6Ma8=; b=Fc9D7BxHgi+OSuC9YBVWy+s2ArJTuYbNu1F6y+ZdXo1HcrSQn9TupqnhpEcgIMmjn8UfYgK3HvgpLqrzsqG6hHgfSXYupWBGH5asylxe7VlCkeTU9hh/dQEU0kJCR1quevy5eH5q9CLjjS2Jex0IV3s9SVuFlSljgBJK+fakDXbuqug7KZ4R4VRnuvV+5uVvkrJ+fUuxnwRghObA8aVssnzYnazbKSQJcUsv1YmE76fSjQuiWPXAzi+RLudozVWtBaiT5TAo8NMcd0sGboq/Hh6liOEs6EW8ofKdaezcoRaWZSjAa2HG3rqienruw7acWYh5AwqHiDFLwndKxxaI4A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lkCE0XYMPCcWcr9aYWzq2Ax1dNAGwVUPaK66P2JtFNGFHGr5Hyue9c+yR4GADwBRrk0xBCQ/yos3NZ7EqPDI6Qf9og/L/HX3hzPIExzxKWJQQjSlzBlte1Ti17Qty7sf3gT6WYWuvRVYQTDJPSkQwniBoMgDGc0Solb8EYgjYB3s7obdoGHEcHGSaX5VG5IrzK+bJhyXL81O8iefbyd9V4n77GAVX0F9mIvhF1UEE03JDufwYPG0MRDkvPfyzdYCb6Nbkh6roGw7EcrhEbpoVrlWd41Kj78tvQqPO6Ge5KiVi+ca77+vD2PlKfMYO/xtK+BKd+6WQ9vtLHaT1ABsDA==
  • 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: AQHYSyhj3bC6kG7fXkuJ00CYtiTN+KzlvR8A
  • Thread-topic: [osgi-users] Declarative Service Curiosity

Hi,

Well one thing is the binding and satisfaction of a component, the other thing is the activation. As you are using the lookup strategy, the referenced service does not really need to be activated in advance. Because you need it at a later time when you call the lookup. This is different to the reference as field or method, where the component activation should be done before.

But to be honest, that is just my understanding and I would have thought that the activation order is the same just as you. And of course I am not sure if my understanding of the lookup strategy is correct. I might be totally wrong with my assumption.

So not sure if this is a bug or intended, but I can tell it also is this way in 2.1.24. Just tested it locally.


Mit freundlichen Grüßen / Best regards

 Dirk Fauth

Cross-Domain Computing Solutions, Cross Automotive Platforms - System, Software and Tools Engineering Engineering Software Methods and Tools1 (XC-ECO/ESM1)
Robert Bosch GmbH | Postfach 30 02 20 | 70442 Stuttgart | GERMANY | www.bosch.com
Tel. +49 711 811-57819 | Telefax +49 711 811 | Dirk.Fauth@xxxxxxxxxxxx

Sitz: Stuttgart, Registergericht: Amtsgericht Stuttgart, HRB 14000;
Aufsichtsratsvorsitzender: Prof. Dr. Stefan Asenkerschbaumer; Geschäftsführung: Dr. Stefan Hartung, 
Dr. Christian Fischer, Filiz Albrecht, Dr. Markus Forschner, Dr. Markus Heyn, Rolf Najork

-----Ursprüngliche Nachricht-----
Von: osgi-users <osgi-users-bounces@xxxxxxxxxxx> Im Auftrag von Jürgen Albert
Gesendet: Freitag, 8. April 2022 11:08
An: osgi-users@xxxxxxxxxxx
Betreff: [osgi-users] Declarative Service Curiosity

Hi,

I have a bit of an odd Situation and I'm not sure if I have a faulty
expectation:

I have 2 Components:

@Component(immediate = true, property = Condition.CONDITION_ID + "=" +
CONDITION_EQUINOX_CONFIG)
public class EquinoxConfigInitializerImpl implements Condition {
     @Activate
     public void activate(ComponentContext ctx) {
         // some code here
     }
}

I have a second component that does require this Condition to be there and to be activated. It does not need to be injected, so I reference it only in the annotation.

@Component(immediate=true , reference = {
     @Reference(name = "equinoxConfig", service = Condition.class, policy=ReferencePolicy.STATIC, cardinality=ReferenceCardinality.MANDATORY, target = "(" + Condition.CONDITION_ID + "=" + CONDITION_EQUINOX_CONFIG + ")") } )

public class Component2 { ... }

My expectation thus has been, that the EquinoxConfigInitializerImpl would have been activated before Component2. For some reason this is not the case and it is activated after Component2. I couldn't really find something concrete in the Spec that lead me to a definitive answer.

Am I wrong, is this undefined or did I find a Bug in SCR (2.1.16)?

Regards,

Jürgen.

--
Jürgen Albert
CEO
Chair Eclipse OSGi Working Group Steering Committee


Data In Motion Consulting GmbH

Kahlaische Str. 4
07745 Jena

Mobil:  +49 157-72521634
E-Mail: j.albert@xxxxxxxxxxxxxxx
Web: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.datainmotion.de%2F&amp;data=04%7C01%7Cdirk.fauth%40de.bosch.com%7Cd1d7e7dd0dbd43751f8308da193f5e29%7C0ae51e1907c84e4bbb6d648ee58410f4%7C0%7C0%7C637850057851179174%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=YtL6DtAEVPfiB38fvJCHyBHJBwbeV8BdwnITjb8vnCI%3D&amp;reserved=0

XING:   https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.xing.com%2Fprofile%2FJuergen_Albert5&amp;data=04%7C01%7Cdirk.fauth%40de.bosch.com%7Cd1d7e7dd0dbd43751f8308da193f5e29%7C0ae51e1907c84e4bbb6d648ee58410f4%7C0%7C0%7C637850057851179174%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=Vz4OOBVmGiEfPrh6dDIZkpOyJoozyx3DyzrcovaMO%2Bs%3D&amp;reserved=0
LinkedIn: https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.linkedin.com%2Fin%2Fjuergen-albert-6a1796%2F&amp;data=04%7C01%7Cdirk.fauth%40de.bosch.com%7Cd1d7e7dd0dbd43751f8308da193f5e29%7C0ae51e1907c84e4bbb6d648ee58410f4%7C0%7C0%7C637850057851179174%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=lAHMsWidkGgw6DI35ep4PcIpJWG05dd%2FMHkv5OmF6cw%3D&amp;reserved=0

Rechtliches

Jena HBR 513025

_______________________________________________
osgi-users mailing list
osgi-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdev.eclipse.org%2Fmailman%2Flistinfo%2Fosgi-users&amp;data=04%7C01%7Cdirk.fauth%40de.bosch.com%7Cd1d7e7dd0dbd43751f8308da193f5e29%7C0ae51e1907c84e4bbb6d648ee58410f4%7C0%7C0%7C637850057851179174%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=N55UO2%2F7kbxbZtyVElzu%2FmWVAgiK2ciAvLhMO0elQfY%3D&amp;reserved=0


Back to the top