Berkeley Bits

November 20, 2008

Matterhorn POC: OSGI

Filed under: What I'm Up To — Tags: , , — jholtzman @ 11:58 am

With the deadline for a grant proposal fast approaching, I’ve been placed in charge of writing about the development techniques and technologies we’ll be using in the project.  Apparently, we don’t have to include promises to use specific products, but we should reference the options we’re considering and what standards we’re planning on using.  In order to write a somewhat well thought through proposal, I’ve been researching:

1) Containers: JEE App Servers, OSGI frameworks (Felix and Equinox), and Spring DM
2) Web services frameworks: Axis2, CXF, and JAX-RS implementations (CXF and Jersey)
3) Messaging and Service Buses (Servicemix, Mule, and ActiveMQ)

From my brief experiments with these products, I’ve come up with a pretty trim proof-of-concept that might serve our needs in Matterhorn.  It works like this:

A main class boots an instance of Apache Felix, which is configured to auto-start two OSGI bundles (there are others, but only two are of particular interest): CXF and a Jackrabbit JCR server.  Other OSGI bundles can be added, removed, or refreshed at anytime via Felix’s web interface (I don’t have it up and running yet in this environment, though I have tested the management webapp that comes with Felix, and it’s pretty easy to use).

I’ve added a sample component that uses the JCR server to get or set content (currently a string… it’s just a proof-of-concept afterall :) ) at a particular path in the repository, and this functionality is exposed as a webservice. I was pleasantly surprised that it took only a few minutes to publish a web service.  The implementation of the component is under 100 lines of code, too.

What this setup buys us is a very lightweight way to manage components in a running system, so we should be able to hot-swap services as we make changes during development without stopping/restarting the entire system.

In addition to the cost of migrating code from existing projects (such as REPLAY) into OSGI bundles, the strict classloading rules of the OSGI environment take some time to learn, and will most likely slow developers down (not that everyone will need to work in this area of the system).  Still, with the number of projects moving toward OSGI, it seems like this is becoming the de facto Java component system, and it will behoove us all to become adept in this environment.  That, and we don’t have to get into the business of providing our own container, or trying to use one that doesn’t meet our needs for component isolation.

October 22, 2008

JCR Cluster Experiments

Filed under: What I'm Up To — Tags: , , , , — jholtzman @ 12:59 pm

I’m starting to work on my tasklist for Matterhorn (Opencast v1.0).  One of the research tasks I have is answering how a number components spread across different JVMs (or not running in a JVM at all) and different servers can efficiently access a common content repository.  There may not be an efficient mechanism for non JVM components, but there must be some kind of network access.

I’ve put together some experiments to help me understand JCR in general and Jackrabbit in particular, with the hope that we’ll be able to leverage this JCR implementation in Matterhorn.  So far, I’ve had luck reading and writing to JCR from multiple JVMs.  The writes from JVM1 show up in JVM2, so this looks like a good start.  The code is at https://opencastproject.svn.sourceforge.net/svnroot/opencastproject/jcr/

September 25, 2008

REPLAY –> Opencast update

Filed under: What I'm Up To — Tags: , — jholtzman @ 4:33 pm

Quick progress update…

I’ve managed to get the REPLAY manager webapp to run individual jobs, return the ID of the job, and then return the status of the job.  This proof-of-concept (based on replay v0.4) just executes an indexing job on a pre-defined media bundle.  More work will obviously be needed to make this fully functional.

This is no big deal, really, but it does mean that REPLAY can fulfill the “media processing manager” component, as described in the opencast draft architecture document.

Powered by WordPress