Programmatically adding declarative services

删除回忆录丶 提交于 2019-12-23 15:26:17

问题


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

A little background:

I have a server application based on dynamic scripts (they can be added, edited or removed at any time). Those scripts have dependencies to OSGi services and possibly each other. Whenever a script gets edited, the script gets compiled to javascript, and its dependencies are detected.

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

  • Is this even possible? Or is there something major I'm missing?
  • If it isn't possible with an OSGi standard, is there a specific solution for Felix or Equinox?
  • Can you do that in the other frameworks, like iPojo or blueprint?

回答1:


There is no API to imperatively add declarative services. You can use the normal OSGi api to register and use services. Perhaps that is what you want?

You may want to checkout the Dependency Manager which may provide an API model giving you the dependency support you want.



来源:https://stackoverflow.com/questions/10702295/programmatically-adding-declarative-services

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!