Help with JIT Bindings

2013-09-03 Thread John Nham
I have the following scenario that I thought would fall under JIT bindingshttps://code.google.com/p/google-guice/wiki/JustInTimeBindings, but it's not working. Is it even possible, either with JIT bindings or another Guice feature? interface MyInterface {} @Anno class ImplA implements

Guice for platform modules

2013-09-03 Thread Adrian Wilkins
Ok, so my situation is that I have a rich-client Java app that I want to run on Windows, Mac, and Linux The original code for this unfortunately has some horrible platform-specifisms. - The code that works out where the user configuration is - This isn't too hard to do with a

Desktop scoping and lifecycles

2013-09-03 Thread jon . mithe
Hi, Guice has had a big impact with the things I code, particular in developing and bringing together a modular system + then the testing that goes with it. However, I am struggling to find a nice way to do reusable components and in part is due to my inexperience with all of this. Examples

Factories

2013-09-03 Thread jpcook04
Hi, I've been reading quite a lot of documentation around named bindings, factorymodulebuilder, mapped bindings and it is still not clear if I can achieve something along the following lines. For example I want a Factory to be able to look up different services at runtime based a key. In

Guice's AOP extension not working on super type

2013-09-03 Thread mayumi
I have a following hierarchical structure: public class ItemImpl extends RepositoryBaseItemImpl { @Inject ItemImpl( dependency ) { super( dependency ) } } public class RepositoryBaseT extends BaseT { public RepositoryBase( dependency ) { //Constructor without @Inject

Giving a value to Provider in guice binding

2013-09-03 Thread Aman Gupta
The question is detailed here. http://stackoverflow.com/questions/18505960/giving-a-value-to-provider-in-guice/18520477 I don't know if any of the following are possible: - Obtain the instance of ClassX within the module code, without partitioning the the modules into separate injectors. - If

Re: JAX-WS Webservice in GUICE 3.0 framework

2013-09-03 Thread Santosh Kumar
I have used a singleton EJB. First time when Guice constructs the injector, give the reference to an EJB. Later on always access EJB to get Injector reference. On Mon, Aug 12, 2013 at 4:38 PM, dim5b dmpou...@gmail.com wrote: Did you fin a solution /example implementation to your problem facing

Re: Factories

2013-09-03 Thread Jordi Gerona
you can achieve that with a Multibindings [1] and MapBinder [2] In your module: public void configure() { MapBinderString, Service mapbinder = MapBinder.newMapBinder(binder(), String.class, Service.class);

Re: Desktop scoping and lifecycles

2013-09-03 Thread Sam Berlin
It is usually hard to manage scopes that aren't dependent on threads. Non thread-based scopes usually require a only one context is active at a time mode, and you can just switch between the contexts. If that applies to you, then that's doable -- you'll just need some static external state

Re: Help with JIT Bindings

2013-09-03 Thread Sam Berlin
Guice cannot do JIT bindings that include binding/qualifier annotations. Binding annotations are not valid on classes, and Guice does not look for them there. sam On Mon, Aug 26, 2013 at 9:28 PM, John Nham jn...@google.com wrote: I have the following scenario that I thought would fall under

Re: Guice's AOP extension not working on super type

2013-09-03 Thread Sam Berlin
What matcher are you using? sam On Wed, Aug 28, 2013 at 2:55 PM, mayumi mayumi.liyan...@gmail.com wrote: I have a following hierarchical structure: public class ItemImpl extends RepositoryBaseItemImpl { @Inject ItemImpl( dependency ) { super( dependency ) } } public

Re: Desktop scoping and lifecycles

2013-09-03 Thread Nate Bauernfeind
In this kind of situation I would try to put my non-reusable code behind [well-thought] interfaces as much as possible. Think about all the [known] use-cases and really try and separate the common logic from the custom logic. If you can hide the state behind a logical interface that has always

Re: How do I inject Mock classes for all subclasses of particular class

2013-09-03 Thread Nate Bauernfeind
Have you considered crawling all of your classes and writing a generic bind method that you can call for any found class that extends View? (see: http://www.javaworld.com/javaworld/javatips/jw-javatip113.html?page=2) On Tue, Sep 3, 2013 at 3:44 PM, David Parish dpar...@gmail.com wrote: We use

How do I inject Mock classes for all subclasses of particular class

2013-09-03 Thread David Parish
We use GWT, GIN and the MVP pattern. All the views inherit from the same base interface (our.View). I'm trying to create more tests but the number of views has gotten rather large. Can I take advantage of the fact that all views inherit from the base View and somehow inject a Mock of the

Would it be a good practice to always inject the *provider* of a dependency?

2013-09-03 Thread electrotype
I had a problem because I did not use a dependency in the appropriate scope. The dependency was *request scoped* but I injected it directy in a *singleton *object... Fun stuff followed! I was wondering about best practices to help reduce those wrong scopes bugs. Would it be a good pattern to

Re: Would it be a good practice to always inject the *provider* of a dependency?

2013-09-03 Thread electrotype
I just realized that it may be wrong to always get two different instances of a dependency when calling two times its getter, when the dependency has no scope... Anyway, I'll still interested by suggestions on how to minimize those scope bugs! -- You received this message because you are

Re: Would it be a good practice to always inject the *provider* of a dependency?

2013-09-03 Thread Christian Gruber
So, I would personally recommend not doing that except at the edges of a system that uses D-I and a system that doesn't. Generally speaking, I would tend to suggest that if you need to inject a request-scoped object into a singleton, then it isn't really a singleton, or the other isn't really

[google-guice.wiki] push by - Edited wiki page ExternalDocumentation through web user interface. on 2013-09-03 17:07 GMT

2013-09-03 Thread google-guice
Revision: 9a9e69672f18 Author: sberlin sber...@gmail.com Date: Tue Sep 3 17:07:44 2013 UTC Log: Edited wiki page ExternalDocumentation through web user interface. http://code.google.com/p/google-guice/source/detail?r=9a9e69672f18repo=wiki Modified: /ExternalDocumentation.wiki

Re: Comment on Guice40 in google-guice

2013-09-03 Thread google-guice
Comment by alexandr...@gmail.com: Guice 4 supports async servlet? https://code.google.com/p/google-guice/issues/detail?id=650 For more information: https://code.google.com/p/google-guice/wiki/Guice40 -- You received this message because you are subscribed to the Google Groups