Re: Desktop scoping and lifecycles

2013-09-05 Thread Jordi Gerona
maybe you can try to use Onami Lifecycle Dispose support [1] or Lifecycle Management in Governator [2] hth, jordi [1] http://onami.apache.org/lifecycle/org.apache.onami.lifecycle.standard/dispose.html [2] https://github.com/Netflix/governator/wiki/Lifecycle-Management On Wed, Sep 4, 2013 at 7

Re: Factories

2013-09-03 Thread Jordi Gerona
it this way SitemapListService wil be also injected mapbinder.addBinding(SitemapService.class.getName()).to(SitemapService. class) // and so on } Now in your client code you can inject the map of services: @Inject Foo(Map services>) { this.services = services; } hth, jordi [1] ht

Re: Managing non-obvious Scopes in complex Systems

2013-01-15 Thread Jordi Gerona
On Sun, Jan 13, 2013 at 7:10 PM, Roger Kapsi wrote: > The difficulty is that I can't simply slap a @RequestScoped annotation > onto them. Why can't you just annotate the type (eg: Account)? If the instance is not constructed by Guice, it will give enough information about the intended use. --

Re: Testing AOP and method names

2012-12-28 Thread Jordi Gerona
annotation for that and apply it only on the methods you want logging. Then configure your interceptor like: bindInterceptor( any(), // classes annotatedWith(YourAnnon.class), // methods new YourLoggingInterceptor()); I think the examples about AOP in the wiki [1] are pretty clear, but let me know if I

Re: "Current connection" injection for a FTP client

2012-07-06 Thread jordi
I think that you're looking for Assisted Inject: http://code.google.com/p/google-guice/wiki/AssistedInject On Thu, Jul 5, 2012 at 9:14 PM, cheez wrote: > I have a FTP client which has multiple servers configured by the user at > runtime: > > class FTPConnection > { > FTPConnection(ServerInfo s

Re: Can DI be used for Instantiating Value Objects

2012-05-16 Thread jordi
isn't to say you "can't" do it, and several frameworks built on > top of guice or other DI systems do just that, but it's tricky and very > likely to get subtle implicit behaviour that's hard for other developers to > reason about. Common cases are for things

Re: Can DI be used for Instantiating Value Objects

2012-05-11 Thread jordi
r to just use a regular, old-fashioned new. If what you're looking for is to inject a Service in conjunction with some value class, take a look at Assisted Inject [1] hth, jordi [1] http://code.google.com/p/google-guice/wiki/AssistedInject On Thu, May 10, 2012 at 10:45 PM, Bubba 42 wrote:

Could not expose() suggestion

2012-04-04 Thread jordi
"Did you forget to explicitly bind it?". I think it would be pretty much clear. cheers, jordi -- You received this message because you are subscribed to the Google Groups "google-guice" group. To post to this group, send email to google-guice@googlegroups.com. To unsubscribe fro

Re: binding date using properties

2012-01-31 Thread jordi
use a regular guice Matcher [1], I guess this would do the trick: import static com.google.inject.matcher.Matchers.annotatedWith; // ... protected void configure() { convertToTypes(annotatedWith(Names.named("YOUR_KEY")), typeConverter); } jordi [1] http://google-guice.googleco

Re: Guice and Hadoop

2011-12-30 Thread jordi
e and this is > > why I went into Guice (my preferable choice over Spring). > > > > So I was wondering how to integrate them both. > > > > On Dec 30, 12:41 pm, jordi wrote: > >> Hey Eyal > >> > >> There's an old jira with a patch [1] to suppo

Re: Guice and Hadoop

2011-12-30 Thread jordi
ent Hadoop API hope this helps, jordi [1] https://issues.apache.org/jira/browse/HADOOP-3261 [2] http://esammer.blogspot.com/2009/09/map-reduce-and-dependency-injection.html On Wed, Dec 28, 2011 at 6:13 PM, egolan wrote: > Hi everyone, > Is there some documentation regarding integration o

Re: Customising java.util.Logger

2011-11-17 Thread jordi
gle-guice.googlecode.com/svn/trunk/javadoc/com/google/inject/util/Modules.html#override(java.lang.Iterable)> hth, jordi On Thu, Nov 17, 2011 at 1:16 PM, Moandji Ezana wrote: > Hi, > > In introducing Guice to a project, I discovered that there's a built-in > binding to j.u.Logg

Re: creating a community of 3rd parties integrations

2011-11-17 Thread jordi
ven by the community needs. If we can join forces around 3rd party integrations I believe big things will happen! have a nice day, jordi On Thu, Nov 17, 2011 at 10:12 AM, Simone Tripodi wrote: > Hi Daniel, > the main "issue" I see indeed is that efforts are defragmented - just

Re: Providers based in strings

2011-05-25 Thread jordi
if MapBinder doesn't make the trick, maybe AssistedInject<http://code.google.com/p/google-guice/wiki/AssistedInject>can help you too jordi On Fri, May 20, 2011 at 7:19 AM, Martin Cavanagh < martin.andrew.cavan...@googlemail.com> wrote: > Hi Colin. > > That sounds ver

Re: Yet another Guice+Quartz integration

2011-05-05 Thread jordi
great job! i'm looking forward to use it in my code, thanks for sharing that jordi On Wed, May 4, 2011 at 5:38 PM, Simone Tripodi wrote: > Hi all guys, > after Terracotta announced the new Quartz API release, I started > working on GitHub on a new implementation of Guice+Quar

Re: Cannot use optimized @Assisted provider outside the scope of the constructor. (This should never happen. If it does, please report it.)

2011-01-27 Thread jordi
I've opened (finally) an issue with a testcase for this: http://code.google.com/p/google-guice/issues/detail?id=594 <http://code.google.com/p/google-guice/issues/detail?id=594>keep up your amazing job with guice! jordi On Tue, Jan 18, 2011 at 6:41 PM, Sam Berlin wrote: > Ya.

Cannot use optimized @Assisted provider outside the scope of the constructor. (This should never happen. If it does, please report it.)

2011-01-18 Thread jordi
tory to get the instance: factory.create(gappsConfig); Do you want me to open an issue? hth, guice is truly amazing jordi -- Here's the full stacktrace: com.google.inject.CreationException: Guice creation errors: 1) Error in custom provider, java.lang.IllegalStateException: Cannot use

Re: configure Singleton

2010-12-13 Thread jordi
Maybe @Provides will handle this for you? @Provides @Singleton public MaxBoundSet providesMaxBoundSet() { // instantiate the way you need return maxBoundSet; } http://code.google.com/p/google-guice/wiki/ProvidesMethods hth, jordi On Sun, Dec 12, 2010 at 1:02 AM, Peter wrote: > Hi, &g

Re: Guice 3.0 RC1 Available

2010-12-10 Thread jordi
0-rc1/javadoc/packages.html>I guess that's a mistake since it's back... thanks! jordi On Thu, Dec 9, 2010 at 2:16 PM, Sam Berlin wrote: > So long as it's clear that it's an RC and not the full release, I don't see > how it could hurt having it in maven central. If you&#x

Re: New Guice 3.0 Snapshot

2010-11-25 Thread jordi
jordi On Thu, Nov 25, 2010 at 2:35 PM, Sam Berlin wrote: > The struts2 extension included in guice2 was broken, and the workaround > included on trunk had its own issues. > sam > > > On Thu, Nov 25, 2010 at 6:44 AM, Stuart McCulloch wrote: > >> On Nov 25, 2010, at 10:44,

Re: New Guice 3.0 Snapshot

2010-11-25 Thread jordi
Where's Struts 2 Extension? It's bundled in the .zip's but I can't find it in the Javadoc API pointed by Guice30 wiki or in the source code via Google Code source browser jordi On Wed, Nov 24, 2010 at 9:22 PM, Simone Tripodi wrote: > sorry if I misunderstood, I thought y

Guice @ GTUG Barcelona

2010-10-29 Thread jordi
Hey there, if there's any Spaniards in this list maybe you're interested in the tech talk i made in GTUG Barcelona last weekend Here's the link (keynote in spanish): http://www.slideshare.net/giro9/dependency-injection-con-guice-gtug thanks! @jordi9 -- You received this message because you a

Re: FYI: JSR-330 support now in Guice SVN

2009-09-08 Thread jordi
It already happens if you're using struts 2, every time you need to choose @Inject betwen guice or xwork. anyways, nobody had complained before ;) On Tue, Sep 8, 2009 at 11:00 PM, Robbie Vanbrabant < robbie.vanbrab...@gmail.com> wrote: > Maybe the next Guice release could have two guice.jar's, on

Re: Knowing the stage in a module

2009-09-01 Thread jordi
you can inject Stage in your classes too: @Inject public Foo(Stage stage) { this.stage = stage } On Tue, Sep 1, 2009 at 1:06 AM, Max Bowsher wrote: > Pablo Fernandez wrote: > > Hi, > > > > I'd like to know the stage (PRODUCTION, DEVELOPMENT) that my injector > > is in. > > > > I basically want

Re: tracking down a dependency path

2009-07-28 Thread jordi
hey there! i didn't try it but sure this helps you: http://code.google.com/p/google-guice/wiki/Grapher hope this helps jordi On 7/28/09, saltyazar wrote: > > hi all, > > first of all, thank you for the great contribution, keep up the good > work! > > I am looki

Re: Issue 396 in google-guice: Struts2 plugin NPE if server bounced

2009-06-29 Thread jordi
ice test module params.put("struts.objectFactory", "guice-test"); params.put("guice.module", "com.eventuo.guice.StrutsTestCaseModule"); servletContext = new MockServletContext(); dispatcher = new Dispatcher(servletContext, params); dispatcher.init(); hope th

Re: G2 Struts 2 plugin exception

2009-06-22 Thread jordi
Thanks for the pacth! i was having this problem but i didn't have the time to debug it On Fri, Jun 19, 2009 at 10:41 PM, Greg Lindholm wrote: > > Here is a patch which seems to work. > > Index: struts2/plugin/src/com/google/inject/struts2/ > GuiceObjectFactory.java >

Re: @Inject always creating new object

2009-06-19 Thread jordi
bject: bind(MyObject.class).in(Scopes.SINGLETON); hope this helps! jordi On Fri, Jun 19, 2009 at 6:28 AM, Matt wrote: > > I'm new to Guice, and I'm using injection within an interceptor, with > requestInjection() in my module. > > The interceptor is being called just fi

Re: Guice 2.0 issue when running my unit tests

2009-05-22 Thread jordi
dhanji, i'm having similar issues with struts 2.1.6 and guice 2.0 it would be awesome if you patch the struts2 plugin! ;D On Thu, May 21, 2009 at 5:05 PM, Greg Lindholm wrote: > > > On May 21, 9:33 am, "Dhanji R. Prasanna" wrote: > > you can go new GuiceFilter().destroy() though that's kinda k

Re: G2 and Struts2 plugin (problems)

2009-05-20 Thread jordi
not bogus... nice to know it before i replace new jars on my Struts2 apps ;P On 5/20/09, Greg Lindholm wrote: > > Sorry, you can ignore the startup problem. > Eclipse WTP didn't clean out the old jars from the deployment area so > it had both the Guice 1.0 and 2.0 jars. > Once I cleaned out the

Re: Struts 2.1.6 + Guice 1.0

2009-04-28 Thread jordi
download the struts2 plugin version 1.0.1. http://google-guice.googlecode.com/files/guice-struts2-plugin-1.0.1.jar it should fix your problem! jordi On 4/28/09, ampyx wrote: > > Hey guys, > > I am new to Guice 1.0. I was trying to integrate guice 1.0 with > struts2.1.6.

Re: How do you bind to generics?

2009-04-14 Thread jordi
Literal>() {}; bind(inpc).to(npc); and similar for the other binding hope this helps! jordi On Tue, Apr 14, 2009 at 10:57 PM, aemami wrote: > > Hi, I am trying to accomplish the following: > > bind(ICache.class).to(Cache.class); > > and > > bind(IMyMapper.class).to(N

Re: Guice 2 prerelease snapshot 20090205

2009-02-09 Thread jordi
there's a lot more documentation on google code site: http://code.google.com/p/google-guice/wiki/Changes20 btw, thanks jesse and all of you bringing in all this new documentation! On Mon, Feb 9, 2009 at 11:32 AM, alexander.gruenew...@googlemail.com < alexander.gruenew...@googlemail.com> wrote:

Re: Google Guice Peformance: CPU and Memory

2008-11-25 Thread jordi
, Nov 25, 2008 at 8:27 PM, Dhanji R. Prasanna <[EMAIL PROTECTED]>wrote: > > On Tue, Nov 25, 2008 at 11:22 AM, jordi <[EMAIL PROTECTED]> wrote: > ... > > > > Looking at the console log i see this message when redeploying: > > > > A C3P0Registry mbean is

Re: Google Guice Peformance: CPU and Memory

2008-11-25 Thread jordi
assloader. I doubt Hibernate or c3p0 > is to blame specifically--this can be caused by just about anything > (most typically, a logging instance from commons-logging.jar in a > parent CL). > > Dhanji. > > On Tue, Nov 25, 2008 at 10:49 AM, jordi <[EMAIL PROTECTED]> wr

Re: Google Guice Peformance: CPU and Memory

2008-11-25 Thread jordi
I'm having similar problems using Guice with Struts 2 + Hibernate. I dunno if Guice is part of the problem, when the PermGen error appears always is related to C3P0 pool created by Hibernate and the Logger stuff. jordi On Tue, Nov 25, 2008 at 7:41 PM, Dhanji R. Prasanna <[EMAIL PROTECTE

Re: Struts2 and Guice 2.0 Snapshot

2008-10-20 Thread jordi
get the latest struts2-guice-plugin, that version is buggy http://google-guice.googlecode.com/files/guice-struts2-plugin-1.0.1.jar On Tue, Oct 21, 2008 at 8:03 AM, Adam Ruggles <[EMAIL PROTECTED]> wrote: > > Has anyone had any problems using the latest guice 2.0 snapshot with > struts2? > > I ad

Re: Guice newbie question: creating N objects on-demand

2008-10-16 Thread jordi
i was about to tell you also about injecting Provider when i saw Bob's solution.. I guess if you inject that provider you can't tell him about the Predictor, at least at construction time.. jordi On Thu, Oct 16, 2008 at 6:24 PM, Andrew Clegg <[EMAIL PROTECTED]>wrote: > >

Should i use @Singleton?

2008-10-08 Thread jordi
ere. To simplify, every Action call it's Service, who has a DAO to access database and retrieve that type. That question arise from the easiness of making Singletons, so should i do it? or better each request has it's own instantiated Service? thanks jordi --~--~-~--~~---

Re: How to choose appropriate one from various implementations?

2008-09-29 Thread jordi
hey, maybe a Provider could be a solution and get what you need at runtime. otherwise you can inject that Provider, or one Provider for each Store you have,. like Provider, Provider anyways, using Guice API is not bad at all! is there for something good jordi On Mon, Sep 29, 2008 at 11:33 AM