geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <>
Subject Re: Is double parentId inheritance allowed
Date Wed, 26 Oct 2005 00:19:09 GMT

On Oct 25, 2005, at 2:35 PM, Jacek Laskowski wrote:

> David Jencks wrote:
>> We now have multiple parents in a configuration.  You can specify the 
>> first one with the parentID attribute.  The other need to be the 
>> first elements in the plan,
> Thanks Dave! That was it!
> petstore:start:
>     [echo] Waiting for server at: 
> c:\projs\geronimo\sandbox\petstore/target/geronimo-1.0-SNAPSHOT
> Booting Geronimo Kernel (in Java 1.4.2_09)...
>     [echo] PetStore has started
> Total time: 59 seconds
> Finished at: Tue Oct 25 23:31:28 CEST 2005
> Just curious, what made you think it's going to be necessary? Is it 
> already used somewhere?

Yes, very very heavily.  As soon as I started thinking about how to 
break up the giant monolithic server plan into smaller pieces it became 
really clear that a configuration has to be able to get classes from 
many parent classloaders.  Fortunately Dain had just developed the 
classloader we needed :-)  I think in the post-geronimo-1.0 timeframe 
we may be getting an even better system that uses OSGI classloaders.
> I also wonder about the single vs multiple parent issue in a 
> configuration. I can't describe one at the moment, but I guess there 
> might be some where two GBeans are defined in two configurations and 
> one would need to inherit them to create a new one. Which GBean would 
> win?

Be careful to distinguish between a gbean's implementation class and an 
instance of it.  You want to be very very careful to make sure the 
class is only loaded in one classloader, but numerous configurations 
that are descendants of that configuration can have instances of the 
> BTW Which module is it in? I'm going to test it out in some unit tests 
> to see if there's anything I should really be concerned about.

The MultiParentClassLoader is in the kernel module.  There are some 
examples of multiple parents in the plans we supply, but the main use 
is really for e.g. ears: an ear with a jetty web app and some ejbs 
would have the jetty and server configs as parents.  See especially the 
defaultParentIds in the various module builders.

Hope this clears things up a bit
david jencks

View raw message