On Wednesday, June 26, 2019 at 9:10:24 AM UTC+2, Kasper Nielsen wrote:
>
> >
> > though generally-speaking I avoid Guice Persist in new projects; if only
> because there's no validation that @Transactional is correctly applied and
> will have any effect (and we've had bugs because of that:
On Tuesday, June 25, 2019 at 7:23:07 PM UTC+2, Viraj Jasani wrote:
>
> Although this thread is old, I just happened to come across while trying
> to understands internals of guice @Transactional.
>
> If class A has caller method that calls a public @Transactional method in
> it's own class,
Would that work?
@ProvidedBy(AutoValue_ExampleB.Builder.class)
@AutoValue
abstract class ExampleB {
…
@AutoValue.Builder
abstract static class Builder implements Provider {
@Inject abstract Builder setA(A a);
@Inject abstract Builder setB(B b);
…
abstract ExampleB get();
If you explicitly call the JWTFilter() method, then don't annotate it with
`@Provides`.
The error is that you have more than one bindings for the Filter class with no
qualifier annotation, and not providing into a set (multibinding); but you
don't actually need those bindings.
--
You
On Tuesday, June 19, 2018 at 12:44:07 AM UTC+2, scl wrote:
>
> Unless you tell guice that a dependency is optional it will never inject
> null. It would fail with an exception if it could not fullfil a dependency.
>
> So for me the most likely cause of you seeing null is that the instance
>
FYI https://github.com/google/guice/wiki/KeepConstructorsHidden
--
You received this message because you are subscribed to the Google Groups
"google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to google-guice+unsubscr...@googlegroups.com.
To
Couldn't you inject the Injector?
--
You received this message because you are subscribed to the Google Groups
"google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to google-guice+unsubscr...@googlegroups.com.
To post to this group, send email
AFAIK, Guice doesn't create a proxy, it synthesizes a subclass that overrides
matched methods and then instantiate them instead of the original class.
--
You received this message because you are subscribed to the Google Groups
"google-guice" group.
To unsubscribe from this group and stop
Could you maybe create a Foo subclass?
class SubFoo extends Foo {
public SubFoo() {
super(10);
}
}
…
bind(Foo.class).to(SubFoo.class);
bindInterceptor(…)…
On Friday, November 4, 2016 at 3:48:42 AM UTC+1, lei wang wrote:
>
> I want to add an interceptor to a 3rd party class. Since it does
You need to require the Map, not the raw Map class.
requireBinding(Key.get(new TypeLiteral
Hi,
A few years ago, I did a similar thing at
https://github.com/tbroyer/guice-persist-neo4j
Feel free to borrow some code, but IIRC it didn't do more than yours.
--
You received this message because you are subscribed to the Google Groups
"google-guice" group.
To unsubscribe from this group
I've seen several spams the past two weeks. Can't remember if they were all in
this group or possibly also in Guava. As soon as I see one I try to report it
as spam (can't do that on mobile though).
Note: I follow the group on the web, not by mail; so u don't have the
additional layer of gmail
The Car binding isn't a Singleton; the Vehicle one is. Using separate bind()
calls might do what you want:
bind(Vehicle.class).to(Car.class);
bind(Car.class).in(Singleton.class);
(I don't know listeners much so can't really help beyond the above)
--
You received this message because you are
On Friday, July 10, 2015 at 12:04:20 PM UTC+2, Naresh Janarthanam wrote:
web.xml configuration for servlets can also be removed
using javax.servlet.annotation.WebServlet. Any thoughts, if other Guice
servlet module functionalities like Scopes and filter will be supported by
standard
Which version are you using? This will only work starting with
4.0-beta5:
https://github.com/google/guice/commit/4faa20e3081448792933834aedfe972add806292
On Thursday, June 11, 2015 at 2:10:56 PM UTC+2, Suma Shivaprasad wrote:
Trying to inject a collection of providers which implement an
On Tuesday, September 9, 2014 3:09:21 AM UTC+2, Hanlu Chen wrote:
There are four modules A, B, C, D.
Their dependency is like graph below
A D
| \ /
| B
| /
C
Could I install C B in A and then install C in B again?
The experiment would just work, but I failed to find
On Thursday, August 21, 2014 8:43:18 AM UTC+2, Jochen Wiedmann wrote:
I'm not sure, whether I get you right. But to me this sounds like a
situation where I would create child injectors and somehow make sure that
they are accessible. For example, in a web application, I might create a
On Thursday, August 21, 2014 2:42:04 PM UTC+2, scl wrote:
If you pass dependencies in you constructor which are not required for
the test then your class has most likely too many responsibilities.
If all your dependencies are required for the test you have to adapt the
test any ways and
On Tuesday, May 27, 2014 10:31:37 PM UTC+2, Sam Berlin wrote:
What do folks think of the idea? It'd make accepting patches easier (with
pull requests, etc), and I'm sure there's other benefits for folks using
the code too.
+1
We could also migrate issues if anyone knows a way to do
I had a similar exception when mixing extensions from Guice 3 with Guice 4.
In my project, I use Guice 4.0-beta4, but a few dependencies (namely Jukito
and Closure Templates) use Guice 3.0 and bring guice-multibinding and
guice-assistedinject in their version 3.0.
Because the jarjar-ing
And if you could push that beta to Central, that'd be even better!
Last one was beta1 AFAICT:
http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.google.inject%22%20AND%20a%3A%22guice%22
On Wednesday, March 19, 2014 2:41:44 PM UTC+1, Sam Berlin wrote:
Perfect. I'll fix this up today or
I really dislike how Jersey 2 does
DI: https://java.net/jira/browse/JERSEY-1933
In one project, I use Resteasy, with a custom Guice-based InjectorFactory;
that doesn't provide fail-fast behavior given that resources are not
instantiated at launch time but only lazily, as needed. I could
+1, and as Christian say, rather than override guice to provided in 3)
it's easier/better/clearer to exclude the transitive guice dependency (the
fact that it could be verbose when you use many extension is a problem with
Maven that other libs have too; it's much more concise with Gradle for
On Tuesday, December 10, 2013 7:24:56 PM UTC+1, Sam Berlin wrote:
So far, it's pretty much unanimous that we should make Guava a real
dependency and bump to Java6. So, we're going to do that. If you don't
want us to do that, please speak up and explain why!
We're probably going to
Who's responsible for instantiating the TestEndpoint class? Is it really
instantiated by Guice or is Guice only injecting its members (in which case
AOP won't work) ?
On Friday, October 18, 2013 11:06:53 AM UTC+2, Dirk Vranckaert wrote:
I'm building a backend application for one of my Android
to RESOURCE_LOCAL that I would have a
session per transaction...
Kr
Dirk
Op vrijdag 18 oktober 2013 11:27:40 UTC+2 schreef Thomas Broyer:
Who's responsible for instantiating the TestEndpoint class? Is it really
instantiated by Guice or is Guice only injecting its members (in which case
AOP won't
On Wednesday, June 5, 2013 11:49:04 AM UTC+2, Moandji Ezana wrote:
Resteasy 3.0 (JBoss's JAX-RS implementation) is coming out soon. I just
wanted to let people know that I and a few others have been giving its
Guice integration some much-needed attention and new features for the first
On Tuesday, June 11, 2013 8:49:13 PM UTC+2, Moandji Ezana wrote:
On Tue, Jun 11, 2013 at 2:47 PM, Thomas Broyer t.br...@gmail.comjavascript:
wrote:
Am I missing something or each and every resource or provider has to be
explicitly bound in the Guice Module?
No, you aren't missing
On Thursday, April 25, 2013 8:04:49 AM UTC+2, mmonti wrote:
Hi guys,
I really appreciate your replies. I took a look at both solutions Tim's
micro-fwk and magic-config, but unfortunately I couldn't make it work, and
also I am not sure if what i need. To be honest I think that I am pretty
On Thursday, April 18, 2013 3:41:11 PM UTC+2, Robert Voliva wrote:
Try filter(/*/abc/*).through(MyFilter.class, params). I would advise
you to be careful, however. You might want to make the path a little more
explicit incase you have other servlets that might erroneously match that
Dependency Injection 101: only objects created by the DI container (Guice
in this case) are injected; this means only objects that have been
retrieved from the Injector (through its getInstance method generally) or
have themselves been injected into other classes. It's possible to inject
On Saturday, January 5, 2013 11:34:22 AM UTC+1, Michael wrote:
Hi All,
I found a very interesting thing about the scope of the provider. Here is
the code of BaseModelProvider
public class BaseModelProvider implements ProviderModel {
private int num;
@Override
public Model get() {
On Monday, December 17, 2012 3:52:51 PM UTC+1, Dirk Nimerem wrote:
Hello Moandji,
could you please make an example how to specifiy a binding via annotation
for this?
Any other class should use the CachedFileReader for an IFileReader, only
the CachedFileReader itself should use the
On Monday, November 12, 2012 10:55:32 PM UTC+1, Alper Akture wrote:
I'm using a game server that instantiates objects (Event handlers, etc)
that I would like to inject references into. Since they construct these
instances, is there an approach other than doing something in a default
On Friday, October 5, 2012 8:24:23 PM UTC+2, Arthur Gregório wrote:
Yes,
in the initial message I sent a code where I set the injector in the
session,
No, it was put in the ServletContext.
and this was exactly my question: is it correct to do that? how to handle
the injector so
This is known as the robot legs problem, see
http://code.google.com/p/google-guice/wiki/FrequentlyAskedQuestions#How_do_I_build_two_similar_but_slightly_different_trees_of_objec
On Thursday, September 6, 2012 9:14:24 AM UTC+2, robertdup wrote:
Hello there,
I trying to implement default
Hi all,
I was playing with Neo4j lately at work and missed Guice Persist's
@Transactional, so I created guice-persist-neo4j.
https://github.com/tbroyer/guice-persist-neo4j
For now only used it with the *impermanent* and *remote* databases (where
it proved to work great), and I'm struggling as
On Friday, May 25, 2012 10:35:27 AM UTC+2, Roger Gilliar wrote:
Is it possible to retrieve an object with a specific annotation.
Example:
@ExtensionId(value=123)
class Test {
}
@ExtensionId(value=124)
class Test2 {
}
Object obj = injector.getInstance(???); // retrieve the object
On Saturday, April 21, 2012 3:52:48 AM UTC+2, Mirko Raner wrote:
On Apr 19, 11:04 am, Mirko Raner mi...@raner.ws wrote:
The closest I can come expressing this in Guice is
binder.bind(new TypeLiteralMap?,?(){}).to(new
TypeLiteralHashMap?,?(){});
but that doesn't seem to
Is this what you're looking for:
http://code.google.com/p/google-guice/wiki/InjectionPoints
Injections are performed in a specific order. All fields are injected and
then all methods. Within the fields, supertype fields are injected before
subtype fields. Similarly, supertype methods are
Isn't that what
ServletScopes.scopeRequesthttp://google-guice.googlecode.com/git/javadoc/com/google/inject/servlet/ServletScopes.html#scopeRequest(java.util.concurrent.CallableT,
java.util.Mapcom.google.inject.Key?, java.lang.Object) is for? (never
used it though, so I can't help using it,
See http://code.google.com/p/google-guice/issues/detail?id=62
(commit for the linked issue 78 is now
http://code.google.com/p/google-guice/source/detail?r=132a5db7c643b8f367eb5f09024cf13ea37c9831
)
According to the javadoc, you should be able to do something similar (that
wouldn't work in all
On Sunday, January 8, 2012 7:08:21 AM UTC+1, Aladdin wrote:
@Thomas I think you MultiBinder is what I need but I'm using GIN and
it's not supported :(
Any other suggestions ?
Could possibly be as simple as (in your GinModule):
@Provides SetServiceConsumer?
As others, I'm not sure I understood your problem, but maybe you're looking
for the multibindings
extensionhttp://code.google.com/p/google-guice/wiki/Multibindings
:
MultiBinderServiceConsumer multi = Multibinder.newSetBinder(binder(),
ServiceConsumer.class);
How about using a MapBinder and injecting a MapString, ProviderPlugin?
That way, you could get the ProviderPlugin from the map for a given name,
and then get a new Plugin instance by calling the Provider's get().
--
You received this message because you are subscribed to the Google Groups
How about trying to use AssistedInject instead?
--
You received this message because you are subscribed to the Google Groups
google-guice group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-guice/-/vQXgGZZ_Q_4J.
To post to this group, send email to
On Tuesday, May 10, 2011 9:25:08 AM UTC+2, dhoffer wrote:
Thanks for the reply...
Regarding 1 at a minimum I need the code/refactoring support one would
get if using manual factories. E.g. If I add a constructor parameter
or change parameter order I need it to keep the module/factory in
On Tuesday, May 10, 2011 10:47:51 AM UTC+2, dhoffer wrote:
1. Hum, perhaps I'm doing more work than I need to...perhaps just out
of habit of previously using manual factories...but I think I got this
from the Guice online docs. Here is what I do:
Class A takes 4 parameters where all are
It should work. I mean, I *do* that and it just works!
(my factory return types are the concrete types though, so I install them as
simply as new GinFactoryModuleBuilder().build(MyFactory.class) so maybe it
makes a difference with having to use implement())
--
You received this message
On Wednesday, February 16, 2011 1:34:23 AM UTC+1, mcculls wrote:
On 15 February 2011 05:40, Josh paces...@gmail.com wrote:
This question is somewhat related to Guice, but I think this is a good
place to ask...
I'm currently working on an API where I need to wrap the usage of the
API to
[cc: google-gin group]
Phil,
to make it clearer on the GIN side, how about a GinScope annotation taking
as value a scope annotation, and having GIN use that scope annotation when
JIT-binding to the GWT.create() call?
I.e.
@GinScope(@Singleton)
public interface MyRequestFactory extends
51 matches
Mail list logo