Overview
This page describes how to set up an OSGi runtime for Moomba which enables Spring-OSGi. It also contains 2 small demos.
Note: The terms bundle and plug-in are interchangable
Runtime binaries
The following is a war file that contains an OSGi runtime. Simply deploy this into your web container and away you go. This war file also contains the 2 demo plug-ins as binary jars in the eclipse/plugin directory.
EquinoxRuntime-Moomba-0.5.war (14.31Mb)
Once the runtime has been deployed and has started you should be able to see the Moomba workbench when you direct your browser to http://localhost:8080/EquinoxRuntime-Moomba-0.5/Workbench
Moomba Workbench Demo Plug-ins
The runtime war file also contains the 2 demo plug-ins in the eclipse/plugins directory. The source for the demos can be found at http://svn.karora.org/repos/bundles/trunk
Alternately you can download the sources from here:
moomba-demo-0.0.1-SNAPSHOT-sources.jar
osgi-gui-0.0.1-SNAPSHOT-sources.jar
The initial file path for the explorer view can be set via the system property org.karora.moomba.demo.path. i.e Tomcat users can set the CATALINA_OPTS environment variable to -Dorg.karora.moomba.demo.path=/home
Starting an OSGi plug-in
To display all the OSGi plug-ins within the OSGi environment you can use the 'ss' command. The display should look something like that below.
osgi> ss
Framework is launched.
id State Bundle
0 ACTIVE system.bundle_3.2.2.R32x_v20061101
Fragments=38
1 ACTIVE org.eclipse.equinox.common_3.2.0.v20060603
2 ACTIVE org.eclipse.update.configurator_3.2.1.v20092006
3 ACTIVE org.eclipse.equinox.http.servletbridge_1.0.0.200701051342
4 ACTIVE org.eclipse.equinox.http.registry_1.0.0.200701051342
5 ACTIVE org.eclipse.equinox.registry_3.2.1.R32x_v20060814
6 ACTIVE org.springframework.osgi_1.0.0.m1
7 ACTIVE org.springframework.osgi.extender_1.0.0.m1
8 ACTIVE org.karora.moomba_0.5.0
9 ACTIVE org.karora.cooee_0.2.0
10 ACTIVE org.karora.moomba.demo_0.0.1
11 ACTIVE org.karora.moomba.osgi.ui_0.0.1
12 RESOLVED org.springframework.osgi.aopalliance.osgi_1.0.0.SNAPSHOT
13 RESOLVED org.objectweb.asm_2.2.2
14 RESOLVED org.springframework.osgi.aspectjrt.osgi_1.5.0._SNAPSHOT
15 RESOLVED org.eclipse.core.runtime.compatibility.auth_3.2.0.v20060601
16 RESOLVED org.springframework.osgi.backport-util-concurrent_3.0.0.SNAPSHOT
17 RESOLVED org.springframework.osgi.commons-attributes.osgi_2.2.0.SNAPSHOT
18 RESOLVED org.springframework.osgi.commons-collections.osgi_3.2.0.SNAPSHOT
19 RESOLVED jakarta.commons.logging_1.1.0
20 RESOLVED org.eclipse.core.contenttype_3.2.0.v20060603
22 RESOLVED org.karora.cooee.sandbox_0.2.0
23 RESOLVED org.karora.moomba.resource_1.0.1
24 RESOLVED jcl104.over.slf4j_1.1.0
25 RESOLVED org.eclipse.core.jobs_3.2.0.v20060603
26 RESOLVED org.springframework.osgi.jsp-api.osgi_2.0.0.SNAPSHOT
27 RESOLVED log4j_1.2.13
30 RESOLVED org.karora.orana_0.5.0
35 ACTIVE org.eclipse.equinox.http.servlet_1.0.0.200701051342
36 RESOLVED org.eclipse.equinox.log_1.0.1.R32x_v20060717
38 RESOLVED org.eclipse.equinox.servletbridge.extensionbundle_1.0.0
Master=0
39 RESOLVED org.eclipse.osgi.services_3.1.100.v20060601
43 RESOLVED org.eclipse.equinox.preferences_3.2.1.R32x_v20060717
44 RESOLVED org.eclipse.core.runtime_3.2.0.v20060603
45 RESOLVED org.springframework.osgi.servletapi.osgi_2.4.0.SNAPSHOT
46 RESOLVED slf4j.api_1.1.0
47 RESOLVED slf4j.log4j12_1.1.0
48 RESOLVED org.springframework.aop_2.1.0.SNAPSHOT-204
49 RESOLVED org.springframework.beans_2.1.0.SNAPSHOT-204
50 RESOLVED org.springframework.context_2.1.0.SNAPSHOT-204
51 RESOLVED org.springframework.core_2.1.0.SNAPSHOT-204
54 RESOLVED org.springframework.osgi.io_1.0.0.m1
55 RESOLVED org.springframework.web_2.1.0.SNAPSHOT-204
osgi>
If you look carefully enough above, you will see a bundle called org.karora.moomba.demo_0.0.1 (bundle #10) and a bundle called org.karora.moomba.osgi.ui_0.0.1 (bundle #11). These bundles are the demo bundles. Stopping and starting them will make them available or unavailable to the workbench session. The bundle state 'ACTIVE' means the Moomba workbench will be able to load the perspective and views registered within it and by refreshing the workbench url they should appear in your browser.
Here's some pretty screenshots for those people who can't be bothered ![]()
moomba-demo

osgi-gui

What on earth was that all about?
If you managed to follow the instructions above but you're a little confused as to exactly what all of it was about, then don't worry. We'll be writing some more documentation on OSGi and Spring-OSGi. However, if you're familiar with OSGi then all of this should be child's play.

Add Comment