How to import osgi blueprint xml

I am trying to import an OSGI XML file into another OSGi XML file.

e.g. .: blueprint1.xml:

<?xml version="1.0" encoding="UTF-8"?> <blueprint ....> <bean id="myBean1" class="com.company.Class1"/> <bean id="myBean2" class="com.company.Class2"/> </blueprint> </xml> 

blueprint2.xml:

 <?xml version="1.0" encoding="UTF-8"?> <blueprint ....> <!-- DOES NOT WORK --> <import resource="blueprint1.xml" /> </blueprint> 

<import> works for spring, but not for drawing.

Does anyone know a way to do this in OSGi XML files?

+6
source share
2 answers

Apparently, Spring as an import is currently not possible in the project.

However, if the files are in the same OSGi bundle, they are in the same context and can be used from other drawing files.

Also see here: http://fusesource.com/forums/message.jspa?messageID=15091#15091

+9
source

If you use Gemini Blueprint (formerly Spring DM), you can simply tell it to download both files and basically treat them as if they were one big file:

In the absence of a Spring -Context header, the expander expects each ".xml" in the META-INF / spring folder to be a valid Spring configuration file [...].

It also processes any xml files in /OSGI-INF in the same way.

0
source

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


All Articles