cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Fagerstrom <>
Subject [osgi] Initial code
Date Wed, 08 Jun 2005 22:07:11 GMT
I have committed some initial osgi code in whiteboard (whiteboard/osgi) 
so that we can start experiment with a microkernel based Cocoon,

This far we have the following:


I decided to use the OSGi framework from 
because it seemed easy to get going with and lightweight. It would have 
been nice to use  the OSGi framework from Eclipse, but I didn't find any 
good documentaion and I wanted to start doing something. This is not 
such a big deal anyway, most of our work will be on the bundles, and we 
should make them work in any OSGi container.


For testing it you should check out in the same 
directory as the Cocoon trunk. The OSGi kernel is started by cd to the 
osgi directory and:

$ java -jar framework.jar

The first time you execute this the commands in init.xargs will be 
executed. It will download a minimal set of bundles for getting a tty 
console so that one can interact with the framework. Take a look at for more details. I wanted a 
rather minimal environment, you can download a more complete distro from 
knopflerfish and use a init scripts that install and start a gui and 
some other stuff as well.

My start script also install and start a JUnit bundle. I put it in the 
SVN to be able to refer to classes in it. When the framework is started 
next time it will use restart.xargs instead and continue where you 
stoped it. If you want to start from scartch you either remove the 
directory fwdir or use the swithch -init, (-help for other options).

Write "help" in the console to get a command listing and 
and for more info.

I sat file:jars/ as current directory in init.xargs so bundle URLs is 
relative to that, but it can be changed by cd.

Build system

I just copied the build system from knopflerfish and changed some 
default params, take a look in the ant directory and read for more info. To use it 
you need a rather new ant (don't know which is the minimal version) with in $ANT_HOME/lib.

You can build all the bundles by using ant in the top directory or 
compile then individually in the bundles/* directories.

I used the knopflerfish build system to get something that worked 
without to much work. But we should replace it with something that is 
better integrated with Cocoon's build system and the block build system 


The source code is in bundles, take a look at the build file for 
configuration info. When build the bundle will be placed in jars and the 
  manifest file can be seen in out.


A "hello world" bundle.

 > enter framework
framework> install test/test-1.0.0.jar
framework> start test
framework> stop test
( > update test - if you change the bundle and start it again)
framework> uninstall test


The cocoon bundle is a passive library bundle (see for the design I 
aim at). It contains cocoon.jar and all libraries in lib/core and 
lib/endorsed. I just manually exported the packages I needed.

Puting everything in one bundle is not such a great idea. We should have 
separate bundles for many of the jars in core and endorsed.

Install the bundle with:

framework> install cocoon/cocoon_all-1.0.0.jar


Here I try to use the cocoon bundle and run the block manager test cases 
from cocoon-test.jar. This bundle also depend on the junit bundle, see

for details. It installs a test service when started.

framework> install cocoon_testcase/cocoon_testcase-1.0.0.jar
framework> start cocoon_testcase
framework> enter junit
junit> help
junit> run org.apache.cocoon.test.components.blocks.BlocksManagerTestCase

But it doesn't work yet, I do some tricks in the base class of the 
BlocksManagerTestCase, SitemapTestCase, to get the context URL for the 
test sitemap and files. And there are some subtilities with loading 
resources from bundles that I don't understand all the details of yet.

                  --- o0o ---

My plan is to continue along whats outlined in It would be 
more fun to work together on this, I would apprciate any involvement.


View raw message