geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gianny Damour <gianny.dam...@optusnet.com.au>
Subject Re: Dynamically adding ModuleBuilderExtensions and NamingBuilders
Date Thu, 13 Nov 2008 10:40:42 GMT
On 13/11/2008, at 10:08 AM, David Jencks wrote:

>
> On Nov 12, 2008, at 1:07 PM, Vamsavardhana Reddy wrote:
>
>> As part of deploying SCA enhanced Web Applications in Geronimo  
>> with Tuscany Plugin, I am looking to add a ModuleBuilderExtension  
>> (MBE) to TomcatModuleBuilder and a NamingBuilder.  The purpose of  
>> the MBE is to add SCA related EmbeddedRuntimeGBean to the web  
>> application config which will deploy the application composite to  
>> the SCA domain.  The purpose of the NamingBuilder is to add SCA  
>> Domain and other objects (required for injection of SCA references  
>> in servlets etc.) into the WebAppContext.  I am seeing that the  
>> MBE and NamingBuilder GBeans which are added as part of the  
>> Tuscany Plugin can not get dynamically added to the MBEs  
>> configured in tomcat6-builder config and NamingBuilders configured  
>> in j2ee-deployer config.  The one option I see is to update the  
>> plan.xml files in tomcat6-builder and j2ee-deployer configs and  
>> rebuild the server.  But this won't be like the MBE and  
>> NamingBuilder is getting added as part of Tuscany-plugin  
>> installation.  The other option is to add (don't know if it is  
>> easy to do this hack) the MBE and NamingBuilder to the  
>> corresponding collections in TomcatModuleBuilder and NamingBuilder  
>> GBeans.  I appreciate any suggestions/comments or inputs on any  
>> alternate approach that I am not seeing.
>
> Yup, this is a problem.  So far we've sidestepped it by just adding  
> all the known desired MBE's to the appropriate *-deployer plan, and  
> as you have found this is non-extensible.

I do not understand why overriding the relevant TomcatModuleBuilder  
GBean pattern in config.xml does not work. This is better than having  
to redeploy the tomcat6-builder plugin.

If the problem is to provide a way to update the tomcat6-builder  
plugin when the Tuscany Plugin is installed, then an approach is to  
package within the Tuscany plugin a script to update the reference  
patterns of the GBean TomcatWebBuilder. For instance, by dropping a  
file named

GBeansTuscanyEnhancer.groovy

in the folder

repository/org/apache/geronimo/configs/tomcat6-deployer/2.*/tomcat6- 
deployer-2.*.car/

which kind of looks like (indicative...)

import org.apache.geronimo.gbean.AbstractNameQuery

def tomcatWebBuilderGBean = gbeanDatas.find { it.gbeanInfo.className  
== 'org.apache.geronimo.tomcat.deployment.TomcatModuleBuilder' }
def moduleBuilderExtensionsPatterns =  
tomcatWebBuilderGBean.getReferencePatterns('ModuleBuilderExtensions')
Set newPatterns = []
newPatterns.addAll(moduleBuilderExtensionsPatterns.patterns)
newPatterns.add(new AbstractNameQuery(new URI 
(PUT_YOUR_TUSCANY_MBE_PATTERN_NAME_HERE)))
tomcatWebBuilderGBean.setReferencePatterns(newPatterns)


You should be done.

Thanks,
Gianny

>
> One possiblitly would be to define marker interfaces such as  
> WebMBE, EjbMBE, etc that the appropriate MBE's could implement and  
> use the interface in the references pattern.
>
> Anyone have a better idea?
>
> thanks
> david jencks
>
>>
>>
>> Thanks,
>> Vamsi
>


Mime
View raw message