Friday, May 27, 2011

Up in the cloud - Trying Amazon EC2

Yesterday I deployed our osgi server process to an amazon ec2 micro instance. It was quite easy, but I had to get used to converting the ssh key for putty, using yum to install things, and notice the difference between stop and terminate an instance. terminate will painfully delete the instance ... as you can get a micro instance for free now this is something to play with. I have to calculate if this is an option for our SaaS offerings as the amazon prizing model is somehow complicated. Next time I'll give Azure a try.

Sunday, May 22, 2011

Classpath scanning with Equinox OSGi

Today I moved some code to OSGi that heavily relies on Classpath scanning.
There's a new API in BundleWiring that lets you scan for resources:
BundleWiring wiring = ctx.getBundle().adapt(BundleWiring.class);
Collection<String> resources= wiring.listResources(DOMAIN,"*.class",BundleWiring.LISTRESOURCES_LOCAL);
Unfortunately due to a bug in NestedBundleDir you need CVS HEAD from the osgi bundle to make this work inside the IDE. It will be fixed in 3.7 RC2.