Wednesday, August 12, 2009

Faster developing in OSGi with '-console' and 'update'

Just a little hint for those who work with OSGi on a daily basis.
Starting and stopping an OSGi-framework takes time, even for small projects. Working on a bundle that requires a lot of playing around can become quite painful when you have to wait those precious 5 seconds or more until the system is restarted.
Thankfully the OSGi-spec already provides an update facility.
Each bundle can be told to update itself from the location it was loaded from.
That last part is the important part and made my life a lot easier.
Most, if not all, OSGi developers already use the console to get handy commands like 'ss' or 'services'. Another nice command is 'update <bundleid>'.
The cool thing about 'update' is that even bundles you included from your workspace can be used.
Just fire up the framework with the '-console' parameter and whenever you changed something in your workspace use update to get those changes into your running framework.

No comments: