apache / celix

Apache Celix is a framework for C and C++14 to develop dynamic modular software applications using component and in-process service-oriented programming.
https://celix.apache.org/
Apache License 2.0
166 stars 87 forks source link

OSGi Condition implementation/adaptation #585

Closed pnoltes closed 1 year ago

pnoltes commented 1 year ago

Adapt and implement the OSGi condition specification.

From the OSGi spec:

In dynamic systems, such as OSGi, one of the more challenging problems can be to define when a system or part of it is ready to do some work. The answer can change depending on the individual perspective. The developer of a web server might say, the system is ready when the server starts listening on port 80. An application developer however would define the system as ready, when the database connection is up and all servlets are registered. Taking the application developers view, the web server should start listening on port 80 when the application is ready and not beforehand.

This should include:

Note that OSGi specification does not specify a "framework.ready" or "framework.error" condition, but IMO this fits the OSGi conditions goal and removes the need for a Celix framework listener. I am not a fan of listener, because with listeners you can miss events.

PengZheng commented 1 year ago

It's a good idea to utilize empty service for system wide synchronization. I have already done that in some forms in my day job.