Re: Injecting Http Session

2009-08-31 Thread Damob
I don't know what I'm missing here or if it's because I'm using gwt- Dispatch but, do I need to write something in the module class to get it work ? I keep getting : 1) Error in custom provider, com.google.inject.OutOfScopeException: Cannot access scoped object. Either we are not currently inside

Knowing the stage in a module

2009-08-31 Thread Pablo Fernandez
Hi, I'd like to know the stage (PRODUCTION, DEVELOPMENT) that my injector is in. I basically want to do something like this boolean indentXml = Injector.CURRENT_STAGE != PRODUCTION bind(Boolean.class).annotatedWith(Names.named("xml.indent")).toInstance (indentXml); So that my XmlParser does no

Re: Injecting Http Session

2009-08-31 Thread Max Bowsher
Damob wrote: > I don't know what I'm missing here or if it's because I'm using gwt- > Dispatch but, do I need to write something in the module class to get > it work ? I keep getting : > > 1) Error in custom provider, com.google.inject.OutOfScopeException: > Cannot access scoped object. Either we

Re: Injecting Http Session

2009-08-31 Thread Christian Goudreau
No, but I got my answer from Chris Lowe public class SomeHandler implements ActionHandler { private final Provider httpSession; @Inject public SomeHandler(final Provider httpSession) { this.httpSession = httpSession; } @Override public YourResult execute(final YourAction action, final

Re: Knowing the stage in a module

2009-08-31 Thread Max Bowsher
Pablo Fernandez wrote: > Hi, > > I'd like to know the stage (PRODUCTION, DEVELOPMENT) that my injector > is in. > > I basically want to do something like this > > boolean indentXml = Injector.CURRENT_STAGE != PRODUCTION > bind(Boolean.class).annotatedWith(Names.named("xml.indent")).toInstance >

Re: Injecting Http Session

2009-08-31 Thread Dhanji R. Prasanna
If your object is created outside a request, the session will not be available =( Dhanji. On Tue, Sep 1, 2009 at 9:04 AM, Christian Goudreau < goudreau.christ...@gmail.com> wrote: > No, but I got my answer from Chris Lowe > > public class SomeHandler implements ActionHandler { > > private final

Re: Injecting Http Session

2009-08-31 Thread Christian Goudreau
Does that mean that the solution Chris gave me isn't valid ? Christian On Mon, Aug 31, 2009 at 7:41 PM, Dhanji R. Prasanna wrote: > If your object is created outside a request, the session will not be > available =( > Dhanji. > > > On Tue, Sep 1, 2009 at 9:04 AM, Christian Goudreau < > goudreau.

Re: Injecting Http Session

2009-08-31 Thread Dhanji R. Prasanna
It is valid, so long as you call provider.get() inside an HTTP request. If you step back a moment and look at this without Guice in the picture, just imagine what it means to have access to the session when there is no request running--it is rather meaningless (who's session is it?). What Guice doe

Re: Injecting Http Session

2009-08-31 Thread Christian Goudreau
Sure, thanks for the light ! Christian On Mon, Aug 31, 2009 at 8:01 PM, Dhanji R. Prasanna wrote: > It is valid, so long as you call provider.get() inside an HTTP request. > If you step back a moment and look at this without Guice in the picture, > just imagine what it means to have access to th

Where can I get the package com.google.inject.grapher?

2009-08-31 Thread zhaoyi
I want to visualize google guice and I head read the article http://code.google.com/p/google-guice/wiki/Grapher. In this article, it uses a class to generate a dot file. But I couldn't find the package com.google.inject.grapher in google guice lib. Where can I find it? thanks. --~--~-~--~

Re: Where can I get the package com.google.inject.grapher?

2009-08-31 Thread je...@swank.ca
On Aug 31, 8:36 pm, zhaoyi wrote: > I want to visualize google guice and I head read the > articlehttp://code.google.com/p/google-guice/wiki/Grapher. In this article, > it uses a class to generate a dot file. But I couldn't find the > package com.google.inject.grapher in google guice lib. Where

Re: Guice Emacs Hacks

2009-08-31 Thread Josh McDonald
Oh lord... .. (btw, Textmate or JEdit!) ;-) 2009/8/28 Rory Ye > Vim +1 > > On Thu, Aug 27, 2009 at 10:47 AM, Brandon Atkinson < > brandon.n.atkin...@gmail.com> wrote: > >> Vim, FTW! >> >> >> On Wed, Aug 26, 2009 at 4:31 PM, Tim Peierls wrote: >> >>> >>> Pass. I'm waiting for the Guice vi hac