You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Mark Menard <ma...@mjm.net> on 2007/07/29 23:53:34 UTC

Adding Groovy Support to Zero Config

I'm in the process of trying to add Groovy support to the Zero Config in
Dispatcher. I have a few questions:

1. It look to me like the ConfigurationManager is instantiated and
initialized once on load of the application. Is that right?

2. Other than adding a method to Dispatcher, is there a way to hook into the
Dispatcher's init process so I can compile and instantiate my Groovy actions
and read their annotations, etc.?

Now, for bonus points... As I see it looks like the ConfigurationManager is
initialized once and that's it. If that is right, and you wanted to have the
ability to add actions dynamically, how might you go about doing it? (I'll
do the lifting, just wondered if someone might have an idea on where first
to start digging.)

Thanks,

Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: Adding Groovy Support to Zero Config

Posted by Brian Pontarelli <br...@pontarelli.com>.
Mark,

What do you think about adding this to SmartURLs? SmartURLs is an update 
to the zero-config and code-behind plugins and I think eventually it 
might be rolled back into core. As long as we make it pluggable and 
don't force a dependency on Groovy in order to use SmartURLs, it could 
work pretty well.

Let me know what you think and I can add you to the Google code project.

-bp


Mark Menard wrote:
> I'm in the process of trying to add Groovy support to the Zero Config in
> Dispatcher. I have a few questions:
>
> 1. It look to me like the ConfigurationManager is instantiated and
> initialized once on load of the application. Is that right?
>
> 2. Other than adding a method to Dispatcher, is there a way to hook into the
> Dispatcher's init process so I can compile and instantiate my Groovy actions
> and read their annotations, etc.?
>
> Now, for bonus points... As I see it looks like the ConfigurationManager is
> initialized once and that's it. If that is right, and you wanted to have the
> ability to add actions dynamically, how might you go about doing it? (I'll
> do the lifting, just wondered if someone might have an idea on where first
> to start digging.)
>
> Thanks,
>
> Mark
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: Adding Groovy Support to Zero Config

Posted by Don Brown <mr...@twdata.org>.
The key plug in point will be a ConfigurationProvider.  You can inject your
provider by setting the init-param configProviders.  As much as possible,
try to scan and set up the configuration ahead of time.  If that won't work,
have your plugin provide an UnknownHandler.  See the codebehind plugin for
examples.

Don

On 7/30/07, Mark Menard <ma...@mjm.net> wrote:
>
> I'm in the process of trying to add Groovy support to the Zero Config in
> Dispatcher. I have a few questions:
>
> 1. It look to me like the ConfigurationManager is instantiated and
> initialized once on load of the application. Is that right?
>
> 2. Other than adding a method to Dispatcher, is there a way to hook into
> the
> Dispatcher's init process so I can compile and instantiate my Groovy
> actions
> and read their annotations, etc.?
>
> Now, for bonus points... As I see it looks like the ConfigurationManager
> is
> initialized once and that's it. If that is right, and you wanted to have
> the
> ability to add actions dynamically, how might you go about doing it? (I'll
> do the lifting, just wondered if someone might have an idea on where first
> to start digging.)
>
> Thanks,
>
> Mark
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>

Re: Adding Groovy Support to Zero Config

Posted by Musachy Barroso <mu...@gmail.com>.
For adding actions dynamically I guess you would have to configure a
list of namespaces and scan them from time to time, or watch a
directory for new configuration files and load them
(XmlConfigurationProvider I think builds the action mappins from xml).

Or, you could check Don's brand new OSGi plugin which would probably
be a perfect fit for that :)

musachy

On 7/29/07, Mark Menard <ma...@mjm.net> wrote:
> I'm in the process of trying to add Groovy support to the Zero Config in
> Dispatcher. I have a few questions:
>
> 1. It look to me like the ConfigurationManager is instantiated and
> initialized once on load of the application. Is that right?
>
> 2. Other than adding a method to Dispatcher, is there a way to hook into the
> Dispatcher's init process so I can compile and instantiate my Groovy actions
> and read their annotations, etc.?
>
> Now, for bonus points... As I see it looks like the ConfigurationManager is
> initialized once and that's it. If that is right, and you wanted to have the
> ability to add actions dynamically, how might you go about doing it? (I'll
> do the lifting, just wondered if someone might have an idea on where first
> to start digging.)
>
> Thanks,
>
> Mark
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>


-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org