Programmatically adding declarative services

Is it possible to add declarative services using some kind of api?

A bit of background:

I have a server application based on dynamic scripts (they can be added, edited or deleted at any time). These scenarios are dependent on OSGi services and possibly on each other. Whenever a script gets edited, the script compiles into javascript and its dependencies are detected.

At this point, I would like to (re) register it as a declarative service, so it will be activated / deactivated when its dependencies come and go.

  • Is it possible? Or is there something important that I'm missing?
  • If this is not possible in the OSGi standard, is there a specific solution for Felix or Equinox?
  • Can you do this in other frameworks like iPojo or a plan?
+4
source share
1 answer

There is no API that would strongly add declarative services. You can use the regular OSGi api to register and use the services. Perhaps this is exactly what you want?

You might want to check out Dependency Manager , which can provide an API model that provides you with the necessary dependency support.

+6
source

Source: https://habr.com/ru/post/1413744/


All Articles