You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by Jacek Laskowski <jl...@apache.org> on 2005/10/25 10:08:16 UTC
Is double parentId inheritance allowed
Hi,
The question stroke me while I was updating PetStore configuration to
the recent changes. The issue is that supplier ear needs to have a
database, jms and security subsystems configured. The database and jms
configurations are all about resourceadapters, but the security
configuration introduces several GBeans. This led me to the question
about parentId inheritance.
If I had two configurations (plans) with a bunch of GBeans and created
another configuration that should have the GBeans from these two
configurations available, how should I proceed? Is the only option to
copy them to a single plan that will in turn be used as parentId?
Jacek
Re: Is double parentId inheritance allowed
Posted by David Jencks <da...@yahoo.com>.
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
> BUILD SUCCESSFUL
> 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
gbean.
>
> 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
Re: Is double parentId inheritance allowed
Posted by Jacek Laskowski <jl...@apache.org>.
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
BUILD SUCCESSFUL
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?
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?
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.
> david jencks
Jacek
Re: Is double parentId inheritance allowed
Posted by David Jencks <da...@yahoo.com>.
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,
<import>
<uri>o/a/g/2ndparent</uri>
</import>
<import>
<groupID>org.apache.geronimo</groupID>
<type>car<type>
<artifactID>foo</artifactID>
<version>1.0</version>
</import>
are a couple of the styles allowed.
thanks
david jencks
On Oct 25, 2005, at 1:08 AM, Jacek Laskowski wrote:
> Hi,
>
> The question stroke me while I was updating PetStore configuration to
> the recent changes. The issue is that supplier ear needs to have a
> database, jms and security subsystems configured. The database and jms
> configurations are all about resourceadapters, but the security
> configuration introduces several GBeans. This led me to the question
> about parentId inheritance.
>
> If I had two configurations (plans) with a bunch of GBeans and created
> another configuration that should have the GBeans from these two
> configurations available, how should I proceed? Is the only option to
> copy them to a single plan that will in turn be used as parentId?
>
> Jacek
>