ider) {
img = imgProvider.get(IMG_NAME);
}
}
Then a static analysis tool could go through a jar and know from which
things need to be "preconfigured", whatever that means.
On Sunday, October 18, 2015 at 7:30:06 AM UTC-7, Tim Peierls wrote:
>>
>> What benefits would this ha
What benefits would this have over what I imagine your colleagues are doing?
public interface ResourceEnvironment {
Image getImage(String name);
// ... other resource-providing methods ...
}
public class SomeService {
private final Image image;
@Inject public
Whoa!
On Apr 28, 2015 6:33 PM, Ben McCann b...@benmccann.com wrote:
Woohoo! Thank you guys so much!!!
On Tue, Apr 28, 2015 at 3:29 PM, 'Colin Decker' via google-guice
google-guice@googlegroups.com wrote:
Hey all, you'll be happy to know that Guice 4.0 is at long last released!
It's easy to go overboard with custom scopes, but sometimes they're just
what you need. Check out Tim Boudreau's custom scopes framework.
https://github.com/timboudreau/scopes
--tim
On Fri, Oct 24, 2014 at 11:26 PM, Kevin Burton burtona...@gmail.com wrote:
I have a complex stats system to
On Thu, Oct 16, 2014 at 7:19 PM, Kevin Burton burtona...@gmail.com wrote:
I humbly propose that these concepts are rather confusing in Guice
@Provides vs Providers
They both use similar mechanisms... IE providing the value of an object,
but they do it differently and the semantics are
On Mon, Apr 7, 2014 at 5:47 PM, Sam Berlin sber...@gmail.com wrote:
I'd be open to any of the following:
a) Hard-error on a qualifer/bindingannotation on types
b) Support qualifer/bindingannotation on types, but fail if it also
exists on the variable
Though, since this'd be a change to
If you can abstract the kinds of configuring that you need to do as
configuration elements, you can use Multibinder.
In modules that contribute to the configuration (e.g., your ModuleA and
ModuleB):
Multibinder.newSetBinder(binder(), ConfigurationElement.class)
On Mon, Dec 9, 2013 at 10:32 AM, Sam Berlin sber...@gmail.com wrote:
1) Do you want Guice to embed Guava or to make it a real dependency?
Real dep.
2) Is it OK for Guice to bump its minimum requirements up to Java6?
Yes, it's OK.
--tim
--
You received this message because you are
On Sun, Nov 24, 2013 at 1:24 PM, Cédric Beust ♔ ced...@beust.com wrote:
I would be totally on board with constructor injection if finalguaranteed
structural immutability, but all it does is guarantee reference
immutability (“this field is only assigned once”), ...
That's *not* all it does.
On Sun, Nov 24, 2013 at 2:20 PM, Cédric Beust ♔ ced...@beust.com wrote:
On Sun, Nov 24, 2013 at 10:57 AM, Tim Peierls t...@peierls.net wrote:
On Sun, Nov 24, 2013 at 1:24 PM, Cédric Beust ♔ ced...@beust.com wrote:
I would be totally on board with constructor injection if finalguaranteed
On Sun, Nov 24, 2013 at 4:06 PM, Cédric Beust ♔ ced...@beust.com wrote:
Let's be concrete: can you write a program that gets initialized correctly
with constructor injection and incorrectly with field injection? I've tried
to come up with one with various techniques (misusing volatile,
What I'm hearing in this exchange is akin to: I do this all the time, and
I've never had a problem, so you shouldn't worry about doing it, either.
That's a dangerous attitude to take with anything in general and with
concurrency in particular.
Even if you could show that no current JVM for x86
On Tue, Apr 30, 2013 at 12:24 PM, Charles huang@gmail.com wrote:
I tried to assign an environment variable to a property i.e.
xxx.xxx.db.username = ${env.USERNAME} and got the error
a binding to @Named(xxx) was already configured at Rocoto.configure
Whenever I've seen the a binding to
Are you talking about com.google.inject.Provider or javax.inject.Provider
or both?
Calling javax.inject.Provider an internal type seems a bit harsh.
--tim
On Thu, Apr 11, 2013 at 3:06 AM, Christian Gruber cgru...@google.comwrote:
It is easier, but please don't. While the two are practically
On Mon, Apr 8, 2013 at 7:18 AM, Tim Boudreau niftin...@gmail.com wrote:
I just moved a framework for working with Netty, which relies on Guice
very heavily, to GitHub. It's called Acteur. It has a somewhat unusual
programming model, as it's more-or-less functional programming in Java,
using
Right, but the question was whether there is way to inject before
@BeforeSuite, and that's a TestNG question.
--tim
On Tue, Jan 8, 2013 at 12:10 PM, Cédric Beust ♔ ced...@beust.com wrote:
TestNG supports Guice:
http://beust.com/weblog/2010/12/10/testng-and-guice-a-marriage-made-in-heaven/
At least they aren't guilty of the sin of Onami! :-)
On Wed, Dec 12, 2012 at 2:31 PM, Cédric Beust ♔ ced...@beust.com wrote:
The Onami maintainers might want to rephrase this section:
[image: Inline image 1]
:-)
(+cc Simone)
--
Cédric
On Wed, Dec 12, 2012 at 12:59 AM, Michael
On Tue, Jul 24, 2012 at 2:44 PM, MarvinToll.com marvint...@gtcgroup.comwrote:
The Rocoto example enables access to a property value via @Inject
as follows:
public final class JdbcConfiguration
{
@Inject
@Named( JDBC.url )
private String jdbcUrl; //
I'm still a little lost, but I think you should probably either be looking
at AssistedInject or MapBinder.
I agree with Craig McClanahan that @Named is probably not the right
construct. It's just a way to create a distinct qualifier that you can use
at the binding site and at the injection site.
On Mon, Jul 23, 2012 at 12:25 PM, Leigh Klotz, Jr. leigh.kl...@gmail.com
wrote:
@LazySingleton @Provides CachedThings cachedThings(DB db) {
MapString, String cache = readCache(db);
return new CachedThings(cache);
}
This last seems like the nicest approach because
I didn't know about a Guice prohibition on doing things in constructors,
unless it was to avoid problems with circular dependencies. (So don't have
circular dependencies!)
I don't see a problem with Proposals A or D. I have yet to see it
documented this way, but the Guice folks have assured me
I recommend using Rocoto, too, but here's an example that shows how to do
it yourself, expressed as a JUnit test:
http://pastebin.com/mWx9xG4M
--tim
On Tue, Jan 31, 2012 at 10:10 AM, Stuart McCulloch mccu...@gmail.comwrote:
On 31 Jan 2012, at 14:42, egolan wrote:
Hi,
I am using
On Mon, Jan 23, 2012 at 6:35 AM, ich du tantea...@hotmail.com wrote:
i try to sort up the deployment of my webapp. so i need to override
contextInitilaized in GuiceServletContextListener. there i need to check
the state of some module-bound objects.
but i get problems:
i field-injected the
Sam,
This is great. It should become part of the documentation, color-coding and
all.
--tim
On Thu, Oct 20, 2011 at 11:26 AM, Sam Berlin sber...@gmail.com wrote:
Do you have a concrete example of a few bindings and how you want them
organized? I'm having trouble understanding what you're
http://tembrel.blogspot.com/2009/11/concurrently-initialized-singletons-in.html
On Sun, Oct 16, 2011 at 10:04 AM, Noel noel@gmail.com wrote:
I would like to do eager initialization of multiple singletons but the
initialization can take on the order of minutes so I would like the
On Sun, Oct 16, 2011 at 5:08 PM, Noel Yap noel@gmail.com wrote:
This looks really good! Can it work with Providers?
I don't know what you mean. It works just like any other scope annotation.
And what about diamond dependencies (ie what happens if both A and B depend
upon C)?
As long
On Fri, Jun 24, 2011 at 3:03 AM, Aekold helbr...@gmail.com wrote:
SwingWorker is supposed to be constructed in EDT too,
Really? I can't find anything that supports that, and a sentence in the
javadochttp://download.oracle.com/javase/6/docs/api/javax/swing/SwingWorker.html,
Often, the Current
Has anyone else been bitten by the fact that javax.inject.Scope is like
com.google.inject.ScopeAnnotation and not like com.google.inject.Scope? Who
serves on these so-called Expert Groups, anyway? :-)
--tim
--
You received this message because you are subscribed to the Google Groups
On Wed, Nov 10, 2010 at 1:17 PM, Sam Berlin sber...@gmail.com 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.
I was delighted to discover that a library that I want to use (jclouds) that
previously
How about removing the @Inject annotation from the B field of C and adding
c.b = b after the injectMembers call?
--tim
On Tue, Sep 7, 2010 at 5:17 PM, Mauricio gmauricio.mu...@gmail.com wrote:
I'm using Guice on a restful web service. I'm binding some object
instances as RequestScoped. One of
Guice guarantees that a *happens-before* edge exists between injection
actions that arise as the result of a call to Injector.getInstance and
actions in the thread following that call in program order, so if you only
call getInstance in the EDT when injecting Swing components it doesn't
matter
If you can decompose the expensive start-up operations into a set of
independent (or weakly interdependent) singleton services, you can inject
those services concurrently (in spite of the single-threadedness of injector
creation). I wrote a blog entry about this:
I decided this was worth blogging about:
http://tembrel.blogspot.com/2009/11/concurrently-initialized-singletons-in.html
--tim
On Nov 26, 11:36 pm, Tim Peierls tpeie...@gmail.com wrote:
William,
It bothered me to be so close to a solution and not get it, so I tried
again, and this time I
try the experimental lifecycle module which takes
an executor and calls a bunch of services in parallel.
Tim Peierls wrote:
[...] I
don't see how you would deal with interdependencies between
Startables, and it seemed like that was the main issue you were hoping
Guice could quasi-magically
On Nov 20, 11:24 am, William Pietri will...@scissor.com wrote:
Do you have an opinion on Jesse's proposed solution, the one involving
Guava? I don't yet know enough about Guice's internals to know whether
your discovery means that his approach would also founder on the same
rocks you
to proceed.
--tim
On Nov 19, 11:48 pm, Tim Peierls tpeie...@gmail.com wrote:
I've sketched an approach here that might work for
you:http://pastie.org/707072
The idea is that ConcurrentSingletonScope, when the injector is
created, eagerly starts computing in background the instances
the things you'd do different this time? I might take a
stab at some of them...
On Oct 28, 4:21 am, Tim Peierls tpeie...@gmail.com wrote:
I don't have time to do it, and I don't think anyone else is working
on it ... go for it! (I gave up when it wasn't a simple recompile
I don't have time to do it, and I don't think anyone else is working
on it ... go for it! (I gave up when it wasn't a simple recompile.)
There are a number of things I would do differently given the new
features of Guice 2.0, but maybe a minimal patch that works is the
best thing for now.
--tim
Pass. I'm waiting for the Guice vi hacks. :-) :-)
--tim
On Aug 25, 2:16 pm, Leigh Klotz leigh.kl...@gmail.com wrote:
I've started collecting some Guice Emacs hacks.
Here's one, M-x guice-inject-dependency
Position point inside constructor arglist
Pick your class name or generic type
On Aug 3, 9:16 pm, Paul Lindner lind...@inuus.com wrote:
I've been looking into Reqest Scopes and GuiceFilter and noticed that
it uses a ThreadLocal to store the request state. This works fine for
single threaded request/response model. However if an application
uses a cached thread pool or
That makes it sound like a particular deficiency of Java, but it's a
concern in any language/environment where thread-safety is the
responsibility of the programmer. If multiple threads access a mutable
object, either the object is thread-safe or the code is broken.
If you can arrange for access
On Mar 5, 8:14 pm, Dhanji R. Prasanna dha...@gmail.com wrote:
- It makes it difficult for me to get the Injector for use by Tim Peierls'
Restlet integration
Hmm, I'll ask Tim if I can update his restlet thing for GS2. He will be
loads happier to use ctor injection I am sure!
(Tim
42 matches
Mail list logo