I found a solution to this problem. This is actually more easy than I
thought. You can do the same thing as in constructor. Instead of
having multiple injected setters you can have a single injected method
like this.
@Inject
public void setAll( A a, B b, C c){
this.setA(a);
this.setB(b);
this.setC(c);
this.init();
}
On Nov 10, 6:11 pm, "cristian.vrabie" <[email protected]>
wrote:
> Hi all,
> I currently use Google-Gin with my GWT projects. I know I should
> post on their group but my problem is related to one of those features
> that Guice needs to do first so I've decided to post here.
> I need to call an initialization method, on some injected objects,
> right after all the properties have been set. For Spring users, this
> would be the equivalent of afterPropertiesSet(). Up until now this
> hasn't been a problem as I was doing the injection in the constructor
> and i could call this method myself at the end of the constructor.
> However, constructor injection and the GWT split points don't like
> each other so I need to do method injection (i like this better
> anyway).
> I've looked on the archives and I see some people asking the same
> question in the past (2007), and at that point this was not possible.
> Has this feature been added in the meantime?
> If this is still not possible I guess i could solve this by creating
> a custom provider that would use dependency injection itself to
> instantiate the object the it would call the init method. However this
> doesn't seem very scalable. Got any other ideas?
> Thanks for your time,
> Cristian
--
You received this message because you are subscribed to the Google Groups
"google-guice" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-guice?hl=.