How to package and consume an existing Java library with OSGI -
After seeking help to manage dependencies on different versions of the same library in Java, it was suggested that I should see, being under a deadline pressure on OSGI implementation, I can actually use some help that will save me from excavation through endless OSG docs. I have a working app, which is going to use a new framework that uses different versions of the framework jar which I'm already using, so I package the new structure as the OSGI bundle Want to do Can I leave my app like this, and can use the OSGI bundle only as a container inside JVM? This would mean that I would use the OGIG bundle only to separate a set of sections from the remaining GVS to avoid conflicts between different versions of GVM. In other words, I want to use all the code without the OSGI based setup, OSGI.
You do not have a complete answer to me, I just want to decide whether Ditterb said:
First, you have to complete your application within the OSGI framework Will happen.
It is not true that there will be another way to embed OSGI container in a host application.
The difficult part here is the interaction between the inside and outside OSGI, because the code lives on different classrooms.
You can make your host class visible to the OSGI part by using the OSGi system square. The other way is more difficult.
One way of host code to interact with bundles is an interface that is visible to both the host application and the bundle, i.e. the share of the host. Another way reflection will be used.
If you have a clear partition between the host and the OSGI, for example a plugin system, it can work quite well.
Under a time limit pressure
It may be a problem that there is a lot to learn with OSGE, and since it can kill mainstream Even though, there is lack of community knowledge, device support, library compatibility, and so on.
At that time you should ask the biggest question: Do I need to manage different versions of dependency on runtime? If not, you can understand things at the time of deployment (by configuration, for example), then there can be a simple solution for you.
Comments
Post a Comment