Re: alternate Provider interface

2009-04-23 Thread Adrian Cole
Perhaps... Although if my api interface extends a guice one, I may as well have used the guice one, right? The user would still need guice libraries loaded or the IDE would turn somewhat red. Other alternates might include putting the guice Provider interface into my api jar. However, I'd like

Re: alternate Provider interface

2009-04-23 Thread Adrian Cole
T get() { > return guiceProvider.get(); > } > } > > You can do a similar wrapping if you're accepting Providers from the > client. > > > On Thu, Apr 23, 2009 at 11:00 AM, Adrian Cole wrote: > >> Perhaps... Although if my api interface extends a

Re: alternate Provider interface

2009-04-23 Thread Adrian Cole
ers you are creating, but > wrapping, or using @Provides could get tedious. > > How about having two separate implementations of com.foo.Provider, one > that implements com.google.inject.Provider and one that doesn't and > just ship different jars? > > -Dave > > On

Re: Time plan for google-guice 2.0

2009-04-26 Thread Adrian Cole
. Cheers, -Adrian Cole On Sun, Apr 26, 2009 at 9:35 AM, je...@swank.ca wrote: > > > > On Apr 25, 10:06 pm, Jigar Gosar wrote: > > I understand that specific dates don't work well, but given all that > > we know today, barring any unforeseen changes in the future. W

Please review Log injection design for JClouds

2009-05-04 Thread Adrian Cole
e a look at this and let me know if you have any comments I should consider. http://code.google.com/p/jclouds/wiki/LogDesign Best Regards, -Adrian Cole jclouds --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "goo

jclouds-s3 beta released

2009-05-10 Thread Adrian Cole
where improvements can be made. If you have spare time to help out, please let us know; there are many more services we'd like to stitch together. We hope you enjoy jclouds! -Adrian Cole http://jclouds.tumblr.com/ http://code.google.com/p/jclouds/ --~--~-~--~~~---~--

Re: Updated User Guide

2009-05-11 Thread Adrian Cole
I'm a big fan of reading unit tests. It's the first place I look at when docs don't say enough. Cheers, -Adrian On Mon, May 11, 2009 at 9:07 PM, Robbie Vanbrabant < robbie.vanbrab...@gmail.com> wrote: > All the docs have been moved to the Google Code wiki: > http://code.google.com/p/google-guic

Re: Guice 2 prerelease snapshot 20090512

2009-05-14 Thread Adrian Cole
Great news, Jesse. We were hosting our own pre-release guice 2.0 and I'm happy to drop that! I'll have the next beta of jclouds include this snapshot. Don't worry, we understand getting things right take time, and our impatience on 2.0 implies our excitement fo

Re: Guice 2.0

2009-05-19 Thread Adrian Cole
Great work, Jesse. Thanks to you, jclouds-s3 can now release prior to java one. We really appreciate your efforts and all those documentation updates! All the best, Adrian jclouds On Wed, May 20, 2009 at 3:44 AM, je...@swank.ca wrote: > > Guice 2.0 is out. This release is stable, and suitable

binding defaults

2009-06-24 Thread Adrian Cole
Hello. I like @Inject(optional=true) to a degree, as it helps code become nullsafe and provides a means of adding default values. That said, it keeps more "new"s in my impl classes then I am comfortable with. If I instead go ahead and bind() my defaults, I have the burden of dealing with Modules

Re: binding defaults

2009-06-25 Thread Adrian Cole
On Thu, Jun 25, 2009 at 2:50 AM, je...@swank.ca wrote: > > On Jun 24, 9:31 am, Adrian Cole wrote: > > If I instead go ahead and bind() my defaults, I have the burden of > dealing with Modules.override() hell. > > This is curious; why is Modules.override() hell? As far as I

Re: binding defaults

2009-06-25 Thread Adrian Cole
coupling ImplementedBy implies. Thanks for the idea. Do you know how to achieve the above? Cheers, -Adrian On Thu, Jun 25, 2009 at 3:30 PM, Jean-Francois Poilpret wrote: > > Adrian Cole wrote: > > Here's an example use case: > > > > 1. ErrorHandler > > I ha

better way to work around issue 146: multi-type assisted inject?

2009-06-26 Thread Adrian Cole
iated! Cheers, -Adrian jclouds <http://code.google.com/p/jclouds/> /** * temporary factory until guice can do multi-type assisted inject * * @see http://code.google.com/p/google-guice/issues/detail?id=346"; /> * * @author Adrian Cole */ public class CommandFactory { @Inje

Re: better way to work around issue 146: multi-type assisted inject?

2009-06-26 Thread Adrian Cole
); > createYou(..); > } > > Dhanji. > > On Fri, Jun 26, 2009 at 5:33 PM, Adrian Cole wrote: > >> jclouds is a major consumer of guice 2.0 functionality. We pretty much >> use it for everything. Without guice jclouds would be a lot more complex. >> We love guice wi

Re: Trouble with switching modules in application

2009-06-26 Thread Adrian Cole
Hi, Krishnan, I'd extract MyDao's interface and move the other code to DataSourceMyDao. For unit tests, you can mock the behaviour in MyDao specific to that test. pita perhaps, but fairly normal. Creating a more versatile StubMyDao would involve some work. In jclouds, this proved useful, as it h

Re: better way to work around issue 146: multi-type assisted inject?

2009-06-27 Thread Adrian Cole
hope I didn't distract you guys too much from new development. The new constructor injection of 2.1 is awesome! Cheers, -Adrian On Sat, Jun 27, 2009 at 9:14 AM, je...@swank.ca wrote: > > On Jun 26, 12:33 am, Adrian Cole wrote: > > I understand a patch is written, but not

Re: better way to work around issue 146: multi-type assisted inject?

2009-06-27 Thread Adrian Cole
t 5:59 PM, Adrian Cole wrote: > >> Thanks for your support, Jesse. I guess I forgot the context of assisted >> inject being an extension. >> >> As it is now, I guess the best workaround is to build assistedinject with >> the patch, and publish it to maven somewhere.

Re: Trouble with switching modules in application

2009-06-27 Thread Adrian Cole
> and let Spring framework handling the switch seamlessly. Idon't know > how to get Guice to do it for me without having to change the module > instance. > > On Jun 26, 11:51 pm, Adrian Cole wrote: > > Hi, Krishnan, > > > > I'd extract MyDao's interface and m

Re: Factory that depends on a current context and guice

2009-07-06 Thread Adrian Cole
I use Assisted Inject for this. Basically, assisted inject lets you cooperate with guice to create objects. Constructor parameters annotated with @Assisted are those you need to provide via a factory interface. I hope this helps. -Adrian jclouds On Mon, Jul 6, 2009 at 9:24 PM, Lemao wrote: >

Re: Log4JMembersInjector for Constructor injection?

2009-07-24 Thread Adrian Cole
In jclouds, we use a similar approach, but don't bind ourselves to java or log4j: http://code.google.com/p/jclouds/wiki/LogDesign Here's the configuration class that may help you do what you are looking for: http://code.google.com/p/jclouds/source/browse/trunk/core/src/main/java/org/jclouds/

Re: Style Question: Proper approach to inject multiple constructor arguments

2009-07-24 Thread Adrian Cole
Hi, Karthik. I'd recommend separating the two bits in your provider, and using a binding annotation. Otherwise, guice will assume every time you want a post method you want the google account one. This could be confusing later. Ex. bindConstant().annotatedWith(GoogleAccount.class).toInstan

Re: Log4JMembersInjector for Constructor injection?

2009-07-24 Thread Adrian Cole
for whatever > logging class you like and set it after construction. > Dhanji. > > On Fri, Jul 24, 2009 at 5:49 PM, Adrian Cole wrote: >> >> In jclouds, we use a similar approach, but don't bind ourselves to >> java or log4j: >>     http://code.google.com/p

Re: Dynamic reconfiguration

2009-07-25 Thread Adrian Cole
Hello. I'd say JMX would be a good way to handle changing settings at runtime. If the default JVM platform mbean server [1] isn't good enough, you can use jboss, weblogic, or something. However, the default one is pretty painless to use and jconsole [2] will detect if it is running. Logging:

Re: Log4JMembersInjector for Constructor injection?

2009-07-25 Thread Adrian Cole
log) >   { >     this.log = log; >   } > } > >        Also, I am not necessarily doing this for jdk loggers so please provide > more detail on how to write a custom injection listener to do this. > > Thanks, > Gili > > Adrian Cole wrote: >> If just injecting

Re: Log4JMembersInjector for Constructor injection?

2009-07-25 Thread Adrian Cole
ooking for a way to set the Constructor argument to the right > value in the first place, instead of fixing it after the fact. It seems > to me that Guice 2.0 is missing a facility for this sort of thing. Are > there any plans for adding one in Guice 2.1 or 3.0? > > Thanks, > Gili

Re: Log4JMembersInjector for Constructor injection?

2009-07-26 Thread Adrian Cole
ger logger = please.passMeTheLogger(); > logger.debug("thanks!"); >} > } > > There is the obvious drawback: now you have to bind a LoggerFor for > every of its clients. > > -- Rodrigo Couto > > On 25 jul, 14:17, Adrian Cole wrote: > > Indeed you are co

Re: Guice 2.1 timeline?

2009-08-05 Thread Adrian Cole
+1 to James' implementation suggestion -Adrian On Wed, Aug 5, 2009 at 12:25 AM, James Strachan wrote: > > 2009/8/5 Martin Lukasiewycz : > > > > Hi Jesse, > > I would wish a specific feature that is not listed in the "issues". > > Its about a simplified binding of constants and somehow analog to

Re: Application architecture guidance?

2009-08-07 Thread Adrian Cole
Hi, Brandon. jclouds is a heavy user of guice and internally uses about 350 classes (excluding unit tests). The way we work is that we create a context into our framework, which implies creation of an injector. Where needed (rarely), Injectors are injected into classes. Getting this context is

Re: Google App Engine API Environment use in Module Configuration?

2009-11-19 Thread Adrian Cole
guice (even trunk) most certainly works in gae. This looks like a problem in your unit test. There's setup needed per gae docs. http://code.google.com/appengine/docs/java/howto/unittesting.html Cheers, Adrian jclouds On Wed, Nov 18, 2009 at 1:07 PM, Tristan wrote: > I should clarify that the

Re: What does google guice not support google initiated standards (javax.inject) ?

2010-07-19 Thread Adrian Cole
Optional inject is a key missing part of the JSR. Agreed that the spec is way too immature. Is anyone moving the javax.inject spec since last year? +1 on doing a release, but for a different reason. It would be nice not to have to play the classpath dance (ex. testng) in order to coexist with a

Re: What does google guice not support google initiated standards (javax.inject) ?

2010-07-19 Thread Adrian Cole
ogle.com/group/google-guice-dev/browse_thread/thread/a36fd54df262ae1a > . > > sam > > On Mon, Jul 19, 2010 at 12:24 PM, Adrian Cole wrote: > >> Optional inject is a key missing part of the JSR. Agreed that the spec is >> way too immature. Is anyone moving the javax.inje

Re: Modules: Switching Private or not

2010-08-21 Thread Adrian Cole
Wow! I love this SPI. Thanks for the tip, Sam. -Adrian jclouds On Aug 21, 2010 8:55 AM, "Sam Berlin" wrote: What you're doing seems like a good solution. You could also approach the test by using the Elements SPI to get to the private bindings and build a module out of those. Something like

Re: Google Guice 3.0 Release

2010-11-10 Thread Adrian Cole
heh.. thanks for testing! -Adrian jclouds On Wed, Nov 10, 2010 at 7:40 PM, Tim Peierls wrote: > On Wed, Nov 10, 2010 at 1:17 PM, Sam Berlin wrote: > >> The more people who use the guice3 snapshot & report back how it worked >> for them (either good or bad), the sooner a release will come. > >

Re: New Guice 3.0 Snapshot

2010-11-24 Thread Adrian Cole
Hi, Simone. One of the reasons jclouds really wants a guice release is that we've been jsr330ed for over a year now. There are holes in that spec like optional inject, but we are not limited by guice at the moment. Cheers, -Adrian On Nov 24, 2010 12:56 PM, "Simone Tripodi" wrote: > Hi Adrian! :

Re: New Guice 3.0 Snapshot

2010-11-24 Thread Adrian Cole
gt; > http://people.apache.org/~simonetripodi/<http://people.apache.org/%7Esimonetripodi/> > http://www.99soft.org/ > > > > On Wed, Nov 24, 2010 at 4:10 PM, Adrian Cole wrote: > > Hi, Simone. > > > > One of the reasons jclouds really wants a guice release is th

Re: Guice 3.0 RC1 Available

2010-12-09 Thread Adrian Cole
Thanks for cutting RC1 and +1 to having this in maven central Cheers, -Adrian On Thu, Dec 9, 2010 at 10:53 AM, Josh Kamau wrote: > +1  I would also like to see it in a maven central . > > On Thu, Dec 9, 2010 at 1:44 PM, Max Bowsher wrote: >> >> On 09/12/10 04:23, Sam Berlin wrote: >> > All, >>

Re: Guice RC2 Available

2011-01-10 Thread Adrian Cole
Thanks for pushing this to central. I've tested this with a couple cloud services via jclouds with no problems. This or the final guice 3.0 release will be in our next cut. http://code.google.com/p/jclouds/issues/detail?id=446 Cheers, -Adrian On Sun, Jan 9, 2011 at 8:38 PM, Stuart McCulloch w

Re: Guice exception on App Engine

2011-02-27 Thread Adrian Cole
Yes, it tries, but also gracefully handles problems doing so. This being logged at INFO level is a bit verbose, considering there's a reasonable workaround employed. -a On Sun, Feb 27, 2011 at 10:48 AM, zixzigma wrote: > Thank You. > > I want to clarify, I don't think my code is spawning a new

Re: Announcing Guice 3.0

2011-03-25 Thread Adrian Cole
Thanks for pushing this through. We'll switch over as soon as it's up in maven. -Adrian jclouds On Fri, Mar 25, 2011 at 9:09 AM, di wang wrote: > nice,,great job > > > On Friday, March 25, 2011, Sam Berlin wrote: >> Guice 3.0 is now released. >> >> Release Notes are at: >>  http://code

Re: Guice, Guava, and ProGuard

2011-07-06 Thread Adrian Cole
I receive complaints about the size of jclouds dependencies. Our only dependencies of any size are guava and guice. These happen in a context of embedding or android, most recently a chat with Glassfish guys. I'd prefer a solution that minimizes size, and takes a couple hundred extra kilobytes

Re: Call an init method after injection is done

2012-03-03 Thread Adrian Cole
Considering normally, init methods perform some sort of heavy stuff, I'd recommend against using providers for this. In jclouds, we internally wire up @PostConstruct, and add a runnable to call said methods to an executionlist, which is invoked after the injector is created. This seems to be very

Re: Determine an Injected Instance "@Named" Value

2012-07-24 Thread Adrian Cole
Not necessarily endorsing this, but here goes... 1. convert things bound to something you can inject https://github.com/jclouds/jclouds/blob/master/core/src/main/java/org/jclouds/internal/FilterStringsBoundToInjectorByName.java 2. convert that into the form desired: https://github.com/jclouds/j

Re: Error-prone and compile-time errors

2013-07-24 Thread Adrian Cole
Really happy to see this. Thanks for kicking it off! -A On Wednesday, July 24, 2013, Christian Gruber wrote: > Hey folks, > > So, just a quick note to this community about the tool "error-prone" and > its impact on Guice. > > Guice modules are not static, because of the configure() method, with