You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Daniel Fagerstrom <da...@nada.kth.se> on 2005/06/28 12:56:52 UTC

[osgi] Changing framework?

I have got all the test examples from 
o.a.c.test.components.blocks.BlocksManager to run under OSGi except for 
one, testBlockSource4. The failing test case tests the sitemap local 
classloader (one have to remove the map:classpath part of the sitemap in 
the block test1 to make it runnable at all under OSGi).

As there are more convenient ways to handle block local classloading 
than the current sitemap mechanism when one use OSGi, the test case 
failure isn't that much of a problem. But the reason that it fails is a 
problem. The o.a.c.components.classloader.DefaultClassloaderFactory that 
is used requires that the URL to the classes resolves to a 
TransversableSource and OSGi R3 doesn't support that.

OSGi R3 supports a special bundle: protocol for access to bundle content 
through the java.net.URL mechanism and there is also a "URL 
getResource(Strin name)" method for the Bundle interface. But there is 
no support for listing directory content. And after having looked at the 
Knopflerfish sources I haven't found any workarounds either. This means 
that one cannot use e.g. the DirectoryGenerator on bundle content (at 
least in a portable way) in OSGi R3 implementations.

As I found it unlikely that Eclipse could be implemented without 
directory access I took a more detailed look at the Eclipse 
implementation of the OSGi framework. Not suprisingly it contains what 
we need: "Enumeration getEntryPaths(String path)" and "Enumeration 
findEntries(String path, String filePattern, boolean recurse)", in the 
Bundle interface.

Eclipse (IBM) has worked in close coloboration with OSGi and according 
to the Eclipse platform mail list the Eclipse OSGi framework 
implementation use the interfaces from the forthcomming OSGi R4 
specification.

A problem with using OSGi R4 is that the only available documentation of 
it is the API documentation from Eclipse. OSGi's development process is 
closed for non members so there are no draft documents that we can use. 
It is supposed to be completely backcompatible for bundle developers so 
alothough irritating, the lack of documentation for OSGi R4 shouldn't 
complicate things that much. IIUC, OSGi R4 will be released soon. And 
both Knopflerfish http://www.knopflerfish.org/ and Oscar 
http://oscar.objectweb.org/ have representants in OSGi and work on R4 
implementations.

                                 --- o0o ---

AFAICS, we need to change OSGi framework from Knopflerfish to the one 
from Eclipse as the DirectoryGenerator and similar things are necessary 
in Cocoon. I can't say that I'm to happy about it as the documentation 
for the OSGi framework of Eclipse is sparse and unorganized, while the 
Knopflerfish documentation at least is OK. Furthermore the Eclipse OSGi 
framework has been available for standalone use just a few months while 
Knopflerfish has been available for a couple of years. Despite this 
there are of course all reasons to believe that the Eclispe OSGi 
implementation is of high quality as it is the kernel for Eclipse 3.0 
and 3.1 and as IBM has been a member of OSGi since the starting and has 
another products in the area.

                                 --- o0o ---

For testing the Eclipse OSGi framework (http://www.eclipse.org/osgi/, 
http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/platform-core-home/main.html), 
one extract the org.eclipse.osgi_3.1.0.jar from Eclipse 3.1M7 or later 
(the RCP Runtime Binary is the smallest one):

$ java -jar org.eclipse.osgi_3.1.0.jar -console
osgi> help
...

                                 --- o0o ---


I feel a little bit like geting a Cocoon servlet to run in the current 
OSGi framework before changing, so that we have something that is more 
motivating for others to work at. But then we need to change to the 
Eclipse OSGi framework IMO. Any help would be greatly appriciated.

WDYT?

/Daniel



Re: [osgi] Changing framework?

Posted by Ralph Goers <Ra...@dslextreme.com>.
Daniel Fagerstrom wrote:

>
> For block development we should only depend on official APIs. But the 
> way you start an OSGi server is not standardized in R3. And as we want 
> to be able to continue to have the option of having Cocoon packaged as 
> a servlet (or at least some of you, I don't care), we need to be able 
> to start the OSGi server programatically. Also both Knopflerfish and 
> Eclipse has a server configuration file that is used when starting the 
> server that differ somewhat, although the concepts are the same and 
> many of the properties are standardized.

Should be easily handled. Create our own interface and then provide an 
Eclipse and a Knopflerfish implementation. 

Ralph


Re: [osgi] Changing framework?

Posted by Daniel Fagerstrom <da...@nada.kth.se>.
Reinhard Poetz wrote:

> Daniel Fagerstrom wrote:
>
>> I feel a little bit like geting a Cocoon servlet to run in the 
>> current OSGi framework before changing, so that we have something 
>> that is more motivating for others to work at. But then we need to 
>> change to the Eclipse OSGi framework IMO. Any help would be greatly 
>> appriciated.
>
>
> AFAIU, when using OSGi we only use the official API and don't depend 
> on the implementation, do we?

For block development we should only depend on official APIs. But the 
way you start an OSGi server is not standardized in R3. And as we want 
to be able to continue to have the option of having Cocoon packaged as a 
servlet (or at least some of you, I don't care), we need to be able to 
start the OSGi server programatically. Also both Knopflerfish and 
Eclipse has a server configuration file that is used when starting the 
server that differ somewhat, although the concepts are the same and many 
of the properties are standardized.

> What I mean is, if we use the Eclipse OSGi implementation  because of 
> its support for OSGi R4 and let's say in 3 months Knopflerfish or 
> Oscar implement R4 too, changing to one of them should be straight 
> forward, shouldn't it?

Yes it should be straight forward. We probably will want to make the 
"OSGi inside a servlet" option plugable WRT to implementation so that 
people can chose.

/Daniel



Re: [osgi] Changing framework?

Posted by Reinhard Poetz <re...@apache.org>.
Daniel Fagerstrom wrote:

> I feel a little bit like geting a Cocoon servlet to run in the current 
> OSGi framework before changing, so that we have something that is more 
> motivating for others to work at. But then we need to change to the 
> Eclipse OSGi framework IMO. Any help would be greatly appriciated.

AFAIU, when using OSGi we only use the official API and don't depend on the 
implementation, do we?

What I mean is, if we use the Eclipse OSGi implementation  because of its 
support for OSGi R4 and let's say in 3 months Knopflerfish or Oscar implement R4 
too, changing to one of them should be straight forward, shouldn't it?

-- 
Reinhard Pötz           Independent Consultant, Trainer & (IT)-Coach 

{Software Engineering, Open Source, Web Applications, Apache Cocoon}

                                        web(log): http://www.poetz.cc
--------------------------------------------------------------------

Re: [osgi] Changing framework?

Posted by Daniel Fagerstrom <da...@nada.kth.se>.
Torsten Curdt wrote:

>...maybe I've just overreacted. Was
>just a bell that was ringing when
>I read this very thread.
>  
>
I found it frustrating to need to change the framework when I wrote the 
original message. I guess that shined through ;) But I'm over that now, 
I don't think it will going to be such a big deal. We'll see.

>>Hopefully the above clearyfied the situation somewhat.
>>    
>>
>
>Thanks a lot for the extensive reply, Daniel.
>It did help!
>  
>
Great!

/Daniel


Re: [osgi] Changing framework?

Posted by Torsten Curdt <tc...@apache.org>.
...maybe I've just overreacted. Was
just a bell that was ringing when
I read this very thread.

> Hopefully the above clearyfied the situation somewhat.

Thanks a lot for the extensive reply, Daniel.
It did help!

cheers
--
Torsten

Re: [osgi] Changing framework?

Posted by Ugo Cei <u....@pronetics.it>.
Il giorno 29/giu/05, alle 13:44, Nicola Ken Barozzi ha scritto:

> In practice, we *desperately* need real blocks if we want to go ahead.
> This is much more important than any lock-in on another container.

Agreed.

>> TBH, we have discussed containers for years, forked Cocoon a couple of
>> times and Pier have even implemented an own kernel, without getting 
>> that
>> much closer to real blocks. And today we have fewer active developers
>> with container implementation competence and interest than we had a 
>> year
>> or two ago.
>
> I agree in full.

/me too

	Ugo

-- 
Ugo Cei
Tech Blog: http://agylen.com/
Open Source Zone: http://oszone.org/
Wine & Food Blog: http://www.divinocibo.it/


Re: [osgi] Changing framework?

Posted by Nicola Ken Barozzi <ni...@apache.org>.
Daniel Fagerstrom wrote:
> Torsten Curdt wrote:
> 
>> Maybe I should just shut up and let Daniel
>> continue with his awesome job ...but (there
>> is always a but)
> 
> I hope that you and everyone else speaks up and rise your concerns if
> you have any.

In theory, in a perfect world, with all the time and will, with plenty
of developers... I would have Torsten's same concerns.

> We need community involvement in this area sooner rather than later
> if we really want real blocks.

In practice, we *desperately* need real blocks if we want to go ahead.
This is much more important than any lock-in on another container.

...
> TBH, we have discussed containers for years, forked Cocoon a couple of
> times and Pier have even implemented an own kernel, without getting that
> much closer to real blocks. And today we have fewer active developers
> with container implementation competence and interest than we had a year
> or two ago.

I agree in full.

Overall, OSGI seems the best bet ATM, since Eclipse will remain for
years, and presumably will not change framework soon.

-- 
Nicola Ken Barozzi                   nicolaken@apache.org
            - verba volant, scripta manent -
   (discussions get forgotten, just code remains)
---------------------------------------------------------------------


Re: [osgi] Changing framework?

Posted by Daniel Fagerstrom <da...@nada.kth.se>.
Torsten Curdt wrote:
> Maybe I should just shut up and let Daniel
> continue with his awesome job ...but (there
> is always a but)

I hope that you and everyone else speaks up and rise your concerns if 
you have any. I don't want this to be some one man show. I can do 
prototyping and write RTs on my own (altough I would prefer to work 
together with others), but there is a limit for how much I can work and 
still find it stimulating and don't risking burnout. We need community 
involvement in this area sooner rather than later if we really want real 
blocks.

> ...although I really think it makes sense to
> move into this direction I would like to express
> my "Avalon-fear". No documentation, we require
> the latest version, not our community...

I can understand the "Avalon fear". But there are large differences 
between Avalon and OSGi. The problem with Avalon wasn't the technology 
but (after a while) its community dynamics. I'm certain that large 
organizations like OSGi has it own share of community problems, but for 
an organization with maybe 40 member organizations 
http://www.osgi.org/about/member_list.asp?section=1, its qualitatively 
different, and to much money is involved to let it end as Avalon. 
Furthermore they have been around for 6 years and their standard is 
widely used and have 10+ implementations.

I don't like the documentation situation nor requiring the latest 
version. I just don't see any better options. OTH we are not exactly 
talking about an early alpha from some obscure organization. It is after 
all the kernel for Eclipse 3.1 release candidate 4, which IIUC is the 
last release candidate before the real release. And according to its 
developers it fullfills OSGi R4 that will be released rather soon, (it 
was supposed to be released during this spring).

> Am I the only one?
> 
> Daniel, your are the one that spent the
> more time looking into this stuff. Do we
> really need the whole framework? Do we
> want the whole framework or just the
> classloading part?

The framework consist of the class loading part, bundle management and a 
service architecture that supports hot deployment. The standard also 
involve various standard services, typically packaged in separate 
bundles. For Knopflerfish the whole framework and some basic services is 
contained in a 200 kB bundle, so it is not that huge. The minimal 
Eclipse framework bundle contains more and is about 800 kB.

I find the whole framework usefull and have no idea about how one could 
split it. What services we should use, if any, is another question and 
something we can discuss one case at a time when we need them.

> Maybe we could also just rip out parts
> that we need? ...might be a legal problem
> but having full control of the what is so
> core seems to be so desirable to me.

TBH, we have discussed containers for years, forked Cocoon a couple of 
times and Pier have even implemented an own kernel, without getting that 
much closer to real blocks. And today we have fewer active developers 
with container implementation competence and interest than we had a year 
or two ago. I don't see that we have the capacity for building our own 
kernel from scratch. Even if we use an existing kernel, we have a lot of 
work to adapt our current stuff to it. Both building our own kernel and 
adapt our current stuff to it seem unrealistic to me.

> Just me expressing my (stupid?) concerns
> reading this thread...

Hopefully the above clearyfied the situation somewhat.

/Daniel

Re: [osgi] Changing framework?

Posted by Torsten Curdt <tc...@apache.org>.
Maybe I should just shut up and let Daniel
continue with his awesome job ...but (there
is always a but)

...although I really think it makes sense to
move into this direction I would like to express
my "Avalon-fear". No documentation, we require
the latest version, not our community...

Am I the only one?

Daniel, your are the one that spent the
more time looking into this stuff. Do we
really need the whole framework? Do we
want the whole framework or just the
classloading part?

Maybe we could also just rip out parts
that we need? ...might be a legal problem
but having full control of the what is so
core seems to be so desirable to me.

Just me expressing my (stupid?) concerns
reading this thread...

cheers
--
Torsten

Re: [osgi] Changing framework?

Posted by Reinhard Poetz <re...@apache.org>.
Daniel Fagerstrom wrote:

> I think that the use of OSGi will or at least can affect the way we 
> deploy blocks. There are bundle repositories and deployment 
> functionality for OSGi, http://oscar-osgi.sourceforge.net/. Eclipse also 
> has plugin (bundle) repositories and a deplyment framework. Maven2 seem 
> promissing.
> 
> IMO it would be good if we could discuss block deployment at the list a 
> bit, so that we can assure that all parts fit together.

ok, will have a look at the options and report back

-- 
Reinhard Pötz           Independent Consultant, Trainer & (IT)-Coach 

{Software Engineering, Open Source, Web Applications, Apache Cocoon}

                                        web(log): http://www.poetz.cc
--------------------------------------------------------------------

Re: [osgi] Changing framework?

Posted by Daniel Fagerstrom <da...@nada.kth.se>.
Reinhard Poetz wrote:

> Daniel Fagerstrom wrote:
>
> <snip/>
>
>>
>>                                 --- o0o ---
>>
>> AFAICS, we need to change OSGi framework from Knopflerfish to the one 
>> from Eclipse as the DirectoryGenerator and similar things are 
>> necessary in Cocoon. I can't say that I'm to happy about it as the 
>> documentation for the OSGi framework of Eclipse is sparse and 
>> unorganized, while the Knopflerfish documentation at least is OK. 
>> Furthermore the Eclipse OSGi framework has been available for 
>> standalone use just a few months while Knopflerfish has been 
>> available for a couple of years. Despite this there are of course all 
>> reasons to believe that the Eclispe OSGi implementation is of high 
>> quality as it is the kernel for Eclipse 3.0 and 3.1 and as IBM has 
>> been a member of OSGi since the starting and has another products in 
>> the area.
>
>
> Personally I like the idea of building Cocoon on Eclipse but this is 
> just a gut feeling. 

I guess most of us share that feeling. Eclipse has become one of the 
strongest brands in OS.

> Apart from not-existing documentation I can only see one issue as 
> Eclipse is a desktop application (= one single user) and Cocoon a 
> server application (many parallel users). But I know too little about 
> OSGi (and Eclipse) if this could really be a problem.

I don't think the multi user aspect should be a problem. It will mainly 
be the concern for the servlet (Cocoon) and for the servlet container 
bundle (e.g. a Yetty based one). Furthermore OSGi has a standardized 
user admin service and seem to be build for handling multiple users.

>>                                 --- o0o ---
>>
>> For testing the Eclipse OSGi framework (http://www.eclipse.org/osgi/, 
>> http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/platform-core-home/main.html), 
>> one extract the org.eclipse.osgi_3.1.0.jar from Eclipse 3.1M7 or 
>> later (the RCP Runtime Binary is the smallest one):
>>
>> $ java -jar org.eclipse.osgi_3.1.0.jar -console
>> osgi> help
>> ...
>>
>>                                 --- o0o ---
>>
>>
>> I feel a little bit like geting a Cocoon servlet to run in the 
>> current OSGi framework before changing, so that we have something 
>> that is more motivating for others to work at. But then we need to 
>> change to the Eclipse OSGi framework IMO. Any help would be greatly 
>> appriciated.
>
> I will work on the block deployer so that I (hopefully) can 
> demonstrate it at the Blockathon. After finishing it I plan to learn 
> more about the implementation of blocks ...

I think that the use of OSGi will or at least can affect the way we 
deploy blocks. There are bundle repositories and deployment 
functionality for OSGi, http://oscar-osgi.sourceforge.net/. Eclipse also 
has plugin (bundle) repositories and a deplyment framework. Maven2 seem 
promissing.

IMO it would be good if we could discuss block deployment at the list a 
bit, so that we can assure that all parts fit together.

/Daniel


Re: [osgi] Changing framework?

Posted by Reinhard Poetz <re...@apache.org>.
Daniel Fagerstrom wrote:

<snip/>

> 
>                                 --- o0o ---
> 
> AFAICS, we need to change OSGi framework from Knopflerfish to the one 
> from Eclipse as the DirectoryGenerator and similar things are necessary 
> in Cocoon. I can't say that I'm to happy about it as the documentation 
> for the OSGi framework of Eclipse is sparse and unorganized, while the 
> Knopflerfish documentation at least is OK. Furthermore the Eclipse OSGi 
> framework has been available for standalone use just a few months while 
> Knopflerfish has been available for a couple of years. Despite this 
> there are of course all reasons to believe that the Eclispe OSGi 
> implementation is of high quality as it is the kernel for Eclipse 3.0 
> and 3.1 and as IBM has been a member of OSGi since the starting and has 
> another products in the area.

Personally I like the idea of building Cocoon on Eclipse but this is just a gut 
feeling. Apart from not-existing documentation I can only see one issue as 
Eclipse is a desktop application (= one single user) and Cocoon a server 
application (many parallel users). But I know too little about OSGi (and 
Eclipse) if this could really be a problem.

> 
>                                 --- o0o ---
> 
> For testing the Eclipse OSGi framework (http://www.eclipse.org/osgi/, 
> http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/platform-core-home/main.html), 
> one extract the org.eclipse.osgi_3.1.0.jar from Eclipse 3.1M7 or later 
> (the RCP Runtime Binary is the smallest one):
> 
> $ java -jar org.eclipse.osgi_3.1.0.jar -console
> osgi> help
> ...
> 
>                                 --- o0o ---
> 
> 
> I feel a little bit like geting a Cocoon servlet to run in the current 
> OSGi framework before changing, so that we have something that is more 
> motivating for others to work at. But then we need to change to the 
> Eclipse OSGi framework IMO. Any help would be greatly appriciated.

I will work on the block deployer so that I (hopefully) can demonstrate it at 
the Blockathon. After finishing it I plan to learn more about the implementation 
of blocks ...


-- 
Reinhard Pötz           Independent Consultant, Trainer & (IT)-Coach 

{Software Engineering, Open Source, Web Applications, Apache Cocoon}

                                        web(log): http://www.poetz.cc
--------------------------------------------------------------------

Re: [osgi] Changing framework?

Posted by Daniel Fagerstrom <da...@nada.kth.se>.
Bertrand Delacretaz wrote:

> Le 28 juin 05, à 12:56, Daniel Fagerstrom a écrit :
>
>> I feel a little bit like geting a Cocoon servlet to run in the 
>> current OSGi framework before changing, so that we have something 
>> that is more motivating for others to work at. But then we need to 
>> change to the Eclipse OSGi framework IMO. Any help would be greatly 
>> appriciated.
>
>
> I've been playing a bit with this OSGI stuff, and was a bit lost as to 
> what to expect when loading and starting the various bundles.
>
> Could you maybe put a README or STATUS file in the top-level osgi 
> directory, that we can keep current as the samples and tests evolve, 
> to describe what can be tested and how? This would help me, and others 
> I'm sure, to at least keep up with what's happening there, even if 
> we're unable to contribute now.

I'll put a README there.

> Thanks very much for all your work on this, it looks very promising!

:)

/Daniel


Re: [osgi] Changing framework?

Posted by Bertrand Delacretaz <bd...@apache.org>.
Le 28 juin 05, à 12:56, Daniel Fagerstrom a écrit :
> I feel a little bit like geting a Cocoon servlet to run in the current 
> OSGi framework before changing, so that we have something that is more 
> motivating for others to work at. But then we need to change to the 
> Eclipse OSGi framework IMO. Any help would be greatly appriciated.

I've been playing a bit with this OSGI stuff, and was a bit lost as to 
what to expect when loading and starting the various bundles.

Could you maybe put a README or STATUS file in the top-level osgi 
directory, that we can keep current as the samples and tests evolve, to 
describe what can be tested and how? This would help me, and others I'm 
sure, to at least keep up with what's happening there, even if we're 
unable to contribute now.

Thanks very much for all your work on this, it looks very promising!
-Bertrand