I am attaching a patch that does the following:
i) Makes all artifacts bundles, using the maven-bundle-plugin.
ii) Adds blueprint descriptor to core & services, that export ControllerFactories, HandlerMapFactories & ActionHandlers as OSGi services (louse coupling to OSGi, no dependency to OSGi).
iii) Added dynamic factories for ClusterController & HandlerMap, so that they can work in a dynamic environment (they are plain pojos, that are handled by the OSGi blueprint if available).
iv) BindLoginCredentialsPatchForEC2 is moved to a new module (extention/jclouds), so that it can be attached to jclouds-core when running in OSGi
v) Modified the commands so that they also provide jopt-free versions of the run method. This is useful for anyone that wants to reuse the commands inside an other shell (e.g. karaf, gogo shell).
vi) Added a feature descriptor for Apache Karaf, so that whirr can be easilly installed inside Karaf, ServiceMix, Geronumo etc.
vii) Provided an OSGi version of most of the shell commands. These commands can also leverage the OSGi configuration admin in order to read the cluster config (if the user doesn't want to just use a file, but want to retrieve its config from a service).
i) The Karaf commands, will require a slight modification to jclouds. I created a patch and will be sent shortly (only affects runtime).
ii) The provided Karaf feature uses commons-configuration 1.6, because version 1.7 bundles require the world (lots of unecessary imports).
iii) Due to jclouds design whirr bundles have to be fragments that are attached jclouds-core and jclouds-scriptbuilder. Not the best way to do things, but the unfortunately the only way.
iv) I plan to add support for reusing existing ComputeServices from the OSGi service registry. This patch is already quite big, so this will be part of a second iteration.