You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by Vamsavardhana Reddy <c1...@gmail.com> on 2008/11/12 22:07:57 UTC

Dynamically adding ModuleBuilderExtensions and NamingBuilders

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.

Thanks,
Vamsi

Re: Dynamically adding ModuleBuilderExtensions and NamingBuilders

Posted by Jarek Gawor <jg...@gmail.com>.
On Wed, Nov 12, 2008 at 6:08 PM, David Jencks <da...@yahoo.com> wrote:
>
>
> 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.
>
> 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.

+1 to that idea. This was/is a problem for a long time and needs to be fixed.

Jarek

Re: Dynamically adding ModuleBuilderExtensions and NamingBuilders

Posted by Gianny Damour <gi...@optusnet.com.au>.
On 15/11/2008, at 5:08 AM, David Jencks wrote:

>
> On Nov 14, 2008, at 12:40 AM, Gianny Damour wrote:
>
>> Hi,
>>
>> The definition of mark-up interfaces may require the definition of  
>> a specific mark-up interface for each deployer type. For instance,  
>> a MBE may be specific to Tomcat and not to Jetty. Hence we may  
>> need WebMBE, TomcatMBE amd JettyMBE.
>
> 1. So far we don't have any examples of such MBEs
> 2. Even if we did, this can easily be handled with a single WebMBE  
> interface by not deploying the e.g. JettyMBEImpl on a tomcat server.

Indeed, we do not have an example yet. Let's assume that we do.

>>
>> Also for kind of the same reason than giving a deployer reference  
>> to the MBE does not work, the mark-up interface is not the silver- 
>> bullet as it is not flexible enough: you may have two deployers  
>> and you may only want to add the MBE to one of them.
>
> I can't think of a remotely plausible example of this, could you  
> suggest one?

Let's also assume that we have Jetty and Tomcat deployers running in  
the same server. In this situation, we cannot selectively deploy the  
MBE as the server is running our two deployers and you only want to  
update one of them.

Obviously the above point w/o an actual example is moot. Do you think  
that we will never see a deployer specific MBE?

>>
>>
>> The explicit addition of a reference pattern provides the best  
>> flexibility. As pointed out, it requires some explicit  
>> configuration. However it is already supported through two  
>> mechanisms: manual update of config.xml or script deployment.
>
> True, but it is not a declarative solution to the problem, it  
> involves procedural code.  Since we've gotten everything else to  
> work with a declarative solution I'd like to see if we can solve  
> this problem declaratively also.

OK. I have started to believe that XML declarations should be  
replaced by DSLs. Also, the introduction of mark-up interfaces  
increases the number of things that developers need to know. What do  
you think of using annotations instead of interfaces? This is the  
preferred style I think.

Thanks,
Gianny

>
> thanks
> david jencks
>
>>
>>
>> Thanks,
>> Gianny
>>
>> On 14/11/2008, at 4:58 AM, Vamsavardhana Reddy wrote:
>>
>>> I agree that we need a general solution to dynamically add MBEs.  
>>> The trick that Gianny showed does got me going with the Tuscany  
>>> plugin work that I am doing.
>>>
>>> On Thu, Nov 13, 2008 at 11:21 PM, David Jencks  
>>> <da...@yahoo.com> wrote:
>>> These solutions certainly work but don't address the fundamental  
>>> problem of adding MBE's dynamically to some builders and not  
>>> others.  For instance we can just modify the tomcat6-deployer  
>>> plan right now to include the tuscany MBE and guess that  
>>> eventually we'll have a jetspeed MBE and try to think of some  
>>> more.  But when someone comes up with a new one we didn't imagine  
>>> -- jspwiki MBE or something -- they'll have to update the list  
>>> again.  I would like to solve the problem once and for all so  
>>> that no specific configuration for particular MBE's is needed.
>>>
>>> Making the reference go the other way -- giving the MBE a  
>>> reference to the web deployer -- won't work well for the same  
>>> reason, we don't know how many web deployers there will be next  
>>> week, even if we only have two this week.
>>>
>>> thanks
>>> david jencks
>>>
>>> On Nov 13, 2008, at 3:21 AM, Vamsavardhana Reddy wrote:
>>>
>>>> Thanks Gianny.  I could add the MBE to TomcatBuilder by  
>>>> modifying config.xml.  I have added the following gbean under  
>>>> "org.apache.geronimo.configs/tomcat6-deployer/2.1.3/car" to  
>>>> modify the reference to include a new MBE:
>>>>
>>>>        <gbean name="TomcatWebBuilder">
>>>>            <reference name="ModuleBuilderExtensions">
>>>>                <pattern>
>>>>                    <name>PersistenceUnitBuilder</name>
>>>>                </pattern>
>>>>                <pattern>
>>>>                    <name>JspModuleBuilderExtension</name>
>>>>                </pattern>
>>>>                <pattern>
>>>>                    <name>MyFacesModuleBuilderExtension</name>
>>>>                </pattern>
>>>>                <pattern>
>>>>                    <name>TuscanyModuleBuilderExtension</name>
>>>>                </pattern>
>>>>            </reference>
>>>>        </gbean>
>>>>
>>>>
>>>> On Thu, Nov 13, 2008 at 4:10 PM, Gianny Damour  
>>>> <gi...@optusnet.com.au> wrote:
>>>> 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
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> -- 
>>>> Vamsi
>>>
>>>
>>>
>>>
>>> -- 
>>> Vamsi
>>
>


Re: Dynamically adding ModuleBuilderExtensions and NamingBuilders

Posted by David Jencks <da...@yahoo.com>.
On Nov 14, 2008, at 12:40 AM, Gianny Damour wrote:

> Hi,
>
> The definition of mark-up interfaces may require the definition of a  
> specific mark-up interface for each deployer type. For instance, a  
> MBE may be specific to Tomcat and not to Jetty. Hence we may need  
> WebMBE, TomcatMBE amd JettyMBE.

1. So far we don't have any examples of such MBEs
2. Even if we did, this can easily be handled with a single WebMBE  
interface by not deploying the e.g. JettyMBEImpl on a tomcat server.

>
>
> Also for kind of the same reason than giving a deployer reference to  
> the MBE does not work, the mark-up interface is not the silver- 
> bullet as it is not flexible enough: you may have two deployers and  
> you may only want to add the MBE to one of them.

I can't think of a remotely plausible example of this, could you  
suggest one?

>
>
> The explicit addition of a reference pattern provides the best  
> flexibility. As pointed out, it requires some explicit  
> configuration. However it is already supported through two  
> mechanisms: manual update of config.xml or script deployment.

True, but it is not a declarative solution to the problem, it involves  
procedural code.  Since we've gotten everything else to work with a  
declarative solution I'd like to see if we can solve this problem  
declaratively also.

thanks
david jencks

>
>
> Thanks,
> Gianny
>
> On 14/11/2008, at 4:58 AM, Vamsavardhana Reddy wrote:
>
>> I agree that we need a general solution to dynamically add MBEs.  
>> The trick that Gianny showed does got me going with the Tuscany  
>> plugin work that I am doing.
>>
>> On Thu, Nov 13, 2008 at 11:21 PM, David Jencks <david_jencks@yahoo.com 
>> > wrote:
>> These solutions certainly work but don't address the fundamental  
>> problem of adding MBE's dynamically to some builders and not  
>> others.  For instance we can just modify the tomcat6-deployer plan  
>> right now to include the tuscany MBE and guess that eventually  
>> we'll have a jetspeed MBE and try to think of some more.  But when  
>> someone comes up with a new one we didn't imagine -- jspwiki MBE or  
>> something -- they'll have to update the list again.  I would like  
>> to solve the problem once and for all so that no specific  
>> configuration for particular MBE's is needed.
>>
>> Making the reference go the other way -- giving the MBE a reference  
>> to the web deployer -- won't work well for the same reason, we  
>> don't know how many web deployers there will be next week, even if  
>> we only have two this week.
>>
>> thanks
>> david jencks
>>
>> On Nov 13, 2008, at 3:21 AM, Vamsavardhana Reddy wrote:
>>
>>> Thanks Gianny.  I could add the MBE to TomcatBuilder by modifying  
>>> config.xml.  I have added the following gbean under  
>>> "org.apache.geronimo.configs/tomcat6-deployer/2.1.3/car" to modify  
>>> the reference to include a new MBE:
>>>
>>>        <gbean name="TomcatWebBuilder">
>>>            <reference name="ModuleBuilderExtensions">
>>>                <pattern>
>>>                    <name>PersistenceUnitBuilder</name>
>>>                </pattern>
>>>                <pattern>
>>>                    <name>JspModuleBuilderExtension</name>
>>>                </pattern>
>>>                <pattern>
>>>                    <name>MyFacesModuleBuilderExtension</name>
>>>                </pattern>
>>>                <pattern>
>>>                    <name>TuscanyModuleBuilderExtension</name>
>>>                </pattern>
>>>            </reference>
>>>        </gbean>
>>>
>>>
>>> On Thu, Nov 13, 2008 at 4:10 PM, Gianny Damour <gianny.damour@optusnet.com.au 
>>> > wrote:
>>> 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
>>>
>>>
>>>
>>>
>>>
>>> -- 
>>> Vamsi
>>
>>
>>
>>
>> -- 
>> Vamsi
>


Re: Dynamically adding ModuleBuilderExtensions and NamingBuilders

Posted by Gianny Damour <gi...@optusnet.com.au>.
Hi,

The definition of mark-up interfaces may require the definition of a  
specific mark-up interface for each deployer type. For instance, a  
MBE may be specific to Tomcat and not to Jetty. Hence we may need  
WebMBE, TomcatMBE amd JettyMBE.

Also for kind of the same reason than giving a deployer reference to  
the MBE does not work, the mark-up interface is not the silver-bullet  
as it is not flexible enough: you may have two deployers and you may  
only want to add the MBE to one of them.

The explicit addition of a reference pattern provides the best  
flexibility. As pointed out, it requires some explicit configuration.  
However it is already supported through two mechanisms: manual update  
of config.xml or script deployment.

Thanks,
Gianny

On 14/11/2008, at 4:58 AM, Vamsavardhana Reddy wrote:

> I agree that we need a general solution to dynamically add MBEs.  
> The trick that Gianny showed does got me going with the Tuscany  
> plugin work that I am doing.
>
> On Thu, Nov 13, 2008 at 11:21 PM, David Jencks  
> <da...@yahoo.com> wrote:
> These solutions certainly work but don't address the fundamental  
> problem of adding MBE's dynamically to some builders and not  
> others.  For instance we can just modify the tomcat6-deployer plan  
> right now to include the tuscany MBE and guess that eventually  
> we'll have a jetspeed MBE and try to think of some more.  But when  
> someone comes up with a new one we didn't imagine -- jspwiki MBE or  
> something -- they'll have to update the list again.  I would like  
> to solve the problem once and for all so that no specific  
> configuration for particular MBE's is needed.
>
> Making the reference go the other way -- giving the MBE a reference  
> to the web deployer -- won't work well for the same reason, we  
> don't know how many web deployers there will be next week, even if  
> we only have two this week.
>
> thanks
> david jencks
>
> On Nov 13, 2008, at 3:21 AM, Vamsavardhana Reddy wrote:
>
>> Thanks Gianny.  I could add the MBE to TomcatBuilder by modifying  
>> config.xml.  I have added the following gbean under  
>> "org.apache.geronimo.configs/tomcat6-deployer/2.1.3/car" to modify  
>> the reference to include a new MBE:
>>
>>         <gbean name="TomcatWebBuilder">
>>             <reference name="ModuleBuilderExtensions">
>>                 <pattern>
>>                     <name>PersistenceUnitBuilder</name>
>>                 </pattern>
>>                 <pattern>
>>                     <name>JspModuleBuilderExtension</name>
>>                 </pattern>
>>                 <pattern>
>>                     <name>MyFacesModuleBuilderExtension</name>
>>                 </pattern>
>>                 <pattern>
>>                     <name>TuscanyModuleBuilderExtension</name>
>>                 </pattern>
>>             </reference>
>>         </gbean>
>>
>>
>> On Thu, Nov 13, 2008 at 4:10 PM, Gianny Damour  
>> <gi...@optusnet.com.au> wrote:
>> 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
>>
>>
>>
>>
>>
>> -- 
>> Vamsi
>
>
>
>
> -- 
> Vamsi


Re: Dynamically adding ModuleBuilderExtensions and NamingBuilders

Posted by Vamsavardhana Reddy <c1...@gmail.com>.
I agree that we need a general solution to dynamically add MBEs. The trick
that Gianny showed does got me going with the Tuscany plugin work that I am
doing.

On Thu, Nov 13, 2008 at 11:21 PM, David Jencks <da...@yahoo.com>wrote:

> These solutions certainly work but don't address the fundamental problem of
> adding MBE's dynamically to some builders and not others.  For instance we
> can just modify the tomcat6-deployer plan right now to include the tuscany
> MBE and guess that eventually we'll have a jetspeed MBE and try to think of
> some more.  But when someone comes up with a new one we didn't imagine --
> jspwiki MBE or something -- they'll have to update the list again.  I would
> like to solve the problem once and for all so that no specific configuration
> for particular MBE's is needed.
> Making the reference go the other way -- giving the MBE a reference to the
> web deployer -- won't work well for the same reason, we don't know how many
> web deployers there will be next week, even if we only have two this week.
>
> thanks
> david jencks
>
> On Nov 13, 2008, at 3:21 AM, Vamsavardhana Reddy wrote:
>
> Thanks Gianny.  I could add the MBE to TomcatBuilder by modifying
> config.xml.  I have added the following gbean under
> "org.apache.geronimo.configs/tomcat6-deployer/2.1.3/car" to modify the
> reference to include a new MBE:
>
>         <gbean name="TomcatWebBuilder">
>             <reference name="ModuleBuilderExtensions">
>                 <pattern>
>                     <name>PersistenceUnitBuilder</name>
>                 </pattern>
>                 <pattern>
>                     <name>JspModuleBuilderExtension</name>
>                 </pattern>
>                 <pattern>
>                     <name>MyFacesModuleBuilderExtension</name>
>                 </pattern>
>                 <pattern>
>                     <name>TuscanyModuleBuilderExtension</name>
>                 </pattern>
>             </reference>
>         </gbean>
>
>
> On Thu, Nov 13, 2008 at 4:10 PM, Gianny Damour <
> gianny.damour@optusnet.com.au> wrote:
>
>> 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
>>>>
>>>
>>>
>>
>
>
> --
> Vamsi
>
>
>


-- 
Vamsi

Re: Dynamically adding ModuleBuilderExtensions and NamingBuilders

Posted by David Jencks <da...@yahoo.com>.
These solutions certainly work but don't address the fundamental  
problem of adding MBE's dynamically to some builders and not others.   
For instance we can just modify the tomcat6-deployer plan right now to  
include the tuscany MBE and guess that eventually we'll have a  
jetspeed MBE and try to think of some more.  But when someone comes up  
with a new one we didn't imagine -- jspwiki MBE or something --  
they'll have to update the list again.  I would like to solve the  
problem once and for all so that no specific configuration for  
particular MBE's is needed.

Making the reference go the other way -- giving the MBE a reference to  
the web deployer -- won't work well for the same reason, we don't know  
how many web deployers there will be next week, even if we only have  
two this week.

thanks
david jencks

On Nov 13, 2008, at 3:21 AM, Vamsavardhana Reddy wrote:

> Thanks Gianny.  I could add the MBE to TomcatBuilder by modifying  
> config.xml.  I have added the following gbean under  
> "org.apache.geronimo.configs/tomcat6-deployer/2.1.3/car" to modify  
> the reference to include a new MBE:
>
>         <gbean name="TomcatWebBuilder">
>             <reference name="ModuleBuilderExtensions">
>                 <pattern>
>                     <name>PersistenceUnitBuilder</name>
>                 </pattern>
>                 <pattern>
>                     <name>JspModuleBuilderExtension</name>
>                 </pattern>
>                 <pattern>
>                     <name>MyFacesModuleBuilderExtension</name>
>                 </pattern>
>                 <pattern>
>                     <name>TuscanyModuleBuilderExtension</name>
>                 </pattern>
>             </reference>
>         </gbean>
>
>
> On Thu, Nov 13, 2008 at 4:10 PM, Gianny Damour <gianny.damour@optusnet.com.au 
> > wrote:
> 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
>
>
>
>
>
> -- 
> Vamsi


Re: Dynamically adding ModuleBuilderExtensions and NamingBuilders

Posted by Vamsavardhana Reddy <c1...@gmail.com>.
Thanks Gianny.  I could add the MBE to TomcatBuilder by modifying
config.xml.  I have added the following gbean under
"org.apache.geronimo.configs/tomcat6-deployer/2.1.3/car" to modify the
reference to include a new MBE:

        <gbean name="TomcatWebBuilder">
            <reference name="ModuleBuilderExtensions">
                <pattern>
                    <name>PersistenceUnitBuilder</name>
                </pattern>
                <pattern>
                    <name>JspModuleBuilderExtension</name>
                </pattern>
                <pattern>
                    <name>MyFacesModuleBuilderExtension</name>
                </pattern>
                <pattern>
                    <name>TuscanyModuleBuilderExtension</name>
                </pattern>
            </reference>
        </gbean>


On Thu, Nov 13, 2008 at 4:10 PM, Gianny Damour <
gianny.damour@optusnet.com.au> wrote:

> 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
>>>
>>
>>
>


-- 
Vamsi

Re: Dynamically adding ModuleBuilderExtensions and NamingBuilders

Posted by Gianny Damour <gi...@optusnet.com.au>.
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
>


Re: Dynamically adding ModuleBuilderExtensions and NamingBuilders

Posted by David Jencks <da...@yahoo.com>.
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.

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