Bundles in OSGi
July 28, 2008
Interestingly, there is a new project called OSGi which is a specification for developing and managing software components life cycle in Java.
There is a new concept called “Bundle.” A bundle is actually a group of required Java files and resouces. It is similar to a Jar file which is a zip file containing java class file and resources. However, a Jar file does not have information about OSGi which is used for managing the software component life cycle. It allows developers to add or remove a Java component (bundle) during runtime. Read here for more info on OSGi. Costin Leau wrote a good article on Bundle.
You can simply develop a bundle according to OSGi with Eclipse. Simply select a Plugin Project and choose Equinox as a platform. Equinox is like a container implementing the OSGi specification. You can run your bundles on Equinox.
For a typical java application, you would make sure that you have all necessary jar files. For OSGi, you have to specify the required bundles. Each required bundles will look for its required bundles on its own. If you have a legazy Jar file, you can turn an old jar files into a bundle as well.
If your applications need some kind of modifying components during runtime, you may consider OSGi.
Entry Filed under: Java. .
Trackback this post | Subscribe to the comments via RSS Feed