A Forensic Approach
A few months ago, I started looking into using Eclipse ECF to provide a mechanism for moving some OSGi services to a remote OSGi paradigm. The problem that I very quickly ran into is that ECF has the least amount of documentation of any Eclipse project that I have used. Much of the documentation is also geared toward developers who want to develop new protocols, containers, discoverers, etc. I do not want to develop ECF, I want to use it!
Of course, after my rant about lack of documentation, I found that the ECF team is working on an ECF Users Guide.
After a few days of Google exercises, I decided to go to the source and see what I could figure out for myself. I started by cloning the ECF repository available here: ECF Git Repository and then loaded all of the projects into a new workspace.
I checked my Run Configurations and found that there were now several JUnit Plugin tests created from launch configurations included in the test projects.
I launched each of the tests and found that most completed successfully. I was a bit surprised, since I still had several compile issues in the source. As it turns out, the compile issues were either due to missing dependencies or were bundles in an incubation directory:
- There are a few ECF SDO plugins that depend on EMF SDO
- The mylyn plugin had compile issues (probably because I’m running Kepler)
- There is an ECF provider (and test) for dnsdd that has a dependency on org.xbill.dns
- There is an ECF provider (and test) for zookeeper that has a dependency on org.apache.hadoop.zookeper
- There is an ECF plugin with import dependencies on the Spring Framework
- The REST capabilities have a dependency on org.json
- There are twitter bundles that I assume have a dependency on some Twitter packages.
The tests that did not use these items seemed to run correctly. This was important to me so that I could get a baseline of working code to use as a comparison for my learning experiences.
The other great way to learn from the code is to check out all of the example projects that are included in the repository. There are several example client and server bundles with run configurations that show how the different configurations are set up to connect.
For distributed OSGi, there are different configurations of the same remote connection:
- Declarative Services or register the service programmatically
- Service Discovery or static endpoint configuration
- If using Service Discovery, pick from SLP, Zookeeper, or Zeroconf
- r-OSGi or ECF Generic
- Synchronous or Asynchronous with callbacks
I was able to learn a great deal about how the remote OSGi can be configured by focusing on the commonality and differences between the examples:
All in all, I was able to get my services working in a few different configurations. I still have a good bit of work to do because I was using EMF objects as parameters of my service methods, and EMF objects are not serializable without some extra code. But that’s a post for another day…