Im having two osgi bundles .
Bundle A (Consumer Bundle)
Consumer.java
myService = new MyImpl((InputStream) Client.class.getClassLoader().getResourceAsStream(DEF_FILE));
DEF_FILE is in src/main/resources
Bundle B (Service Bundle)
Contains the service and the implementation classes .
MyImpl.java
public MyImpl(InputStream inputStream)
{
try
{
readFunction(inputStream);
LOG.info(" ReadFunction in " + inputStream);
}
catch (Exception e)
{
LOG.error("Could not define Readfunction in " + inputStream, e);
}
}
The main intention is to read the resources file declared in one bundle in the other bundle. I could use the maven-resource-plugin or assembly plugin but in that also I need to add the dependent bundles in the pom , which I don't prefer because of cyclic dependency problems . Is there any other way to read the files from one bundle to the other in a efficient way ?
NOTE : I may have alot of consumer bundles for the Service .