You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wink.apache.org by Jason Dillon <ja...@planet57.com> on 2010/04/05 22:44:42 UTC

Re: wink-guice-server is not enabled in build

Its been working well for me for a while now.  I just had to duplicate the GuiceDeploymentConfiguration bits to allow my own module to be injected also.  This could be easier if GuiceDeploymentConfiguration was more like:

<snip>
    public GuiceDeploymentConfiguration() {
        LifecycleManagersRegistry lifecycleManagersRegistry = new LifecycleManagersRegistry();
        setOfFactoryRegistry(lifecycleManagersRegistry);
        Injector injector = Guice.createInjector(createModules());
        lifecycleManagersRegistry.addFactoryFactory(new GuiceInjectorLifeCycleManager(injector));
    }

    public Module[] createModules() {
        return new Module[] {
            new WinkGuiceModule()
        };
    }
</snip>

Then users could just sub-class GuiceDeploymentConfiguration and configure it to be used in web.xml.  Something along those lines.

Have you folks looked at the GuiceFilter stuff and/or using the WebModule bits to configure the web-app there (instead of using xml)? 

--jason


On Mar 29, 2010, at 6:54 AM, Bryant Luk wrote:

> This code was experimental (but glad you like it) and I think there
> needs to be some work done to fully enable the feature (i.e. make the
> injector configuration easier).  I'll go ahead and add the module
> though since there shouldn't be any harm.
> 
> On Sat, Mar 27, 2010 at 2:36 PM, Jason Dillon <ja...@planet57.com> wrote:
>> ... why not?
>> 
>> --jason
>> 


Re: wink-guice-server is not enabled in build

Posted by Bryant Luk <br...@gmail.com>.
I updated the code with your suggestion.  I've briefly looked at the
various Google Guice bits.  I'm not too sure how much we could
incorporate directly that would add value but let us know if you have
any specific suggestions.

On Mon, Apr 5, 2010 at 3:44 PM, Jason Dillon <ja...@planet57.com> wrote:
> Its been working well for me for a while now.  I just had to duplicate the GuiceDeploymentConfiguration bits to allow my own module to be injected also.  This could be easier if GuiceDeploymentConfiguration was more like:
>
> <snip>
>    public GuiceDeploymentConfiguration() {
>        LifecycleManagersRegistry lifecycleManagersRegistry = new LifecycleManagersRegistry();
>        setOfFactoryRegistry(lifecycleManagersRegistry);
>        Injector injector = Guice.createInjector(createModules());
>        lifecycleManagersRegistry.addFactoryFactory(new GuiceInjectorLifeCycleManager(injector));
>    }
>
>    public Module[] createModules() {
>        return new Module[] {
>            new WinkGuiceModule()
>        };
>    }
> </snip>
>
> Then users could just sub-class GuiceDeploymentConfiguration and configure it to be used in web.xml.  Something along those lines.
>
> Have you folks looked at the GuiceFilter stuff and/or using the WebModule bits to configure the web-app there (instead of using xml)?
>
> --jason
>
>
> On Mar 29, 2010, at 6:54 AM, Bryant Luk wrote:
>
>> This code was experimental (but glad you like it) and I think there
>> needs to be some work done to fully enable the feature (i.e. make the
>> injector configuration easier).  I'll go ahead and add the module
>> though since there shouldn't be any harm.
>>
>> On Sat, Mar 27, 2010 at 2:36 PM, Jason Dillon <ja...@planet57.com> wrote:
>>> ... why not?
>>>
>>> --jason
>>>
>
>