You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by Sachin Patel <sp...@gmail.com> on 2006/09/15 15:03:33 UTC

help resolving class (GERONIMO-1526)

So I need some help on the following...

In the sachin branch, we're working on generalizing the builders, and  
replacing many of the methods that get passed in and process on a  
JarFile with a new interface IDeployableModule.  Now the default impl  
of this class represents a JarFile.  We want to provide different  
implementations that can be plugged into geronimo for improved  
support for deploying from eclipse for example.  Now my idea is the  
following...

 From eclipse we will deploy a gbean to geronimo that provides a new  
impl of IDeployableModule that provides Eclipse support so Geronimo  
can build the configuration directly from the Eclipse projects.  So  
I've added a new method to the DeploymentManager that can be used by  
a client to set the impl classname (might be better to be a gbean ref  
name or something I don't know) to be used for that particular  
deployment.  This gets passed to a Factory class, and if null, the  
default impl is created, and if not then we need to be able to load  
an instance of this impl class.

So my question is how can this be done? How can the deployment module  
and this factory class resolve the class from a gbean it doesn't have  
direct visibility to?

Any help or code snippets would be appreciated.

Thanks.

-sachin



Re: help resolving class (GERONIMO-1526)

Posted by Dain Sundstrom <da...@iq80.com>.
On Sep 15, 2006, at 1:33 PM, Sachin Patel wrote:

>>> So my question is how can this be done? How can the deployment  
>>> module and this factory class resolve the class from a gbean it  
>>> doesn't have direct visibility to?
>>
>> It need to know the name of the target module.  From there you can  
>> grab the class loader.  Alternatively, if you know the name of the  
>> target service you can call kernel.getClassLoaderFor(name).
>
> Ok, thanks.  I get the first way... but could you clarify the  
> second way... what do you mean by target service? Is this the  
> qualified service name (i.e ..j2eeType=blah....)

I'm not sure what I meant by target service.... I think I was  
responding to your comment "this factory class resolve the class from  
a gbean it doesn't have direct visibility to".  Anyway, if you have  
the abstract name for a service loaded in the kernel, you can simply  
call kernel.getClassLoaderFor(abstractName).

-dain

Re: help resolving class (GERONIMO-1526)

Posted by Sachin Patel <sp...@gmail.com>.
Sorry out of habbit typing "I...", as its Eclipse convention... But  
yeah the actual interface name is DeployableModule that I'm adding to G.

See inline...

On Sep 15, 2006, at 3:35 PM, Dain Sundstrom wrote:

> Is IDeployableModule an eclipse thing?  If not, the coding  
> convention for geronimo is to give the interface the premiere name  
> and the implementations the clunky names.
>
> On Sep 15, 2006, at 6:03 AM, Sachin Patel wrote:
>
>> So I need some help on the following...
>>
>> In the sachin branch, we're working on generalizing the builders,  
>> and replacing many of the methods that get passed in and process  
>> on a JarFile with a new interface IDeployableModule.  Now the  
>> default impl of this class represents a JarFile.  We want to  
>> provide different implementations that can be plugged into  
>> geronimo for improved support for deploying from eclipse for  
>> example.  Now my idea is the following...
>>
>> From eclipse we will deploy a gbean to geronimo that provides a  
>> new impl of IDeployableModule that provides Eclipse support so  
>> Geronimo can build the configuration directly from the Eclipse  
>> projects.  So I've added a new method to the DeploymentManager  
>> that can be used by a client to set the impl classname (might be  
>> better to be a gbean ref name or something I don't know) to be  
>> used for that particular deployment.  This gets passed to a  
>> Factory class, and if null, the default impl is created, and if  
>> not then we need to be able to load an instance of this impl class.
>>
>> So my question is how can this be done? How can the deployment  
>> module and this factory class resolve the class from a gbean it  
>> doesn't have direct visibility to?
>
> It need to know the name of the target module.  From there you can  
> grab the class loader.  Alternatively, if you know the name of the  
> target service you can call kernel.getClassLoaderFor(name).

Ok, thanks.  I get the first way... but could you clarify the second  
way... what do you mean by target service? Is this the qualified  
service name (i.e ..j2eeType=blah....)

>
> -dain
>
>


-sachin



Re: help resolving class (GERONIMO-1526)

Posted by Dain Sundstrom <da...@iq80.com>.
Is IDeployableModule an eclipse thing?  If not, the coding convention  
for geronimo is to give the interface the premiere name and the  
implementations the clunky names.

On Sep 15, 2006, at 6:03 AM, Sachin Patel wrote:

> So I need some help on the following...
>
> In the sachin branch, we're working on generalizing the builders,  
> and replacing many of the methods that get passed in and process on  
> a JarFile with a new interface IDeployableModule.  Now the default  
> impl of this class represents a JarFile.  We want to provide  
> different implementations that can be plugged into geronimo for  
> improved support for deploying from eclipse for example.  Now my  
> idea is the following...
>
> From eclipse we will deploy a gbean to geronimo that provides a new  
> impl of IDeployableModule that provides Eclipse support so Geronimo  
> can build the configuration directly from the Eclipse projects.  So  
> I've added a new method to the DeploymentManager that can be used  
> by a client to set the impl classname (might be better to be a  
> gbean ref name or something I don't know) to be used for that  
> particular deployment.  This gets passed to a Factory class, and if  
> null, the default impl is created, and if not then we need to be  
> able to load an instance of this impl class.
>
> So my question is how can this be done? How can the deployment  
> module and this factory class resolve the class from a gbean it  
> doesn't have direct visibility to?

It need to know the name of the target module.  From there you can  
grab the class loader.  Alternatively, if you know the name of the  
target service you can call kernel.getClassLoaderFor(name).

-dain