Thanks Alen. I'll try to implement it on that way.
Regards, Miroslav On Thu, 2009-01-22 at 11:14 -0800, Alen Vrečko wrote: > Hi, > > check out > > http://tembrel.blogspot.com/2007/09/injecting-method-interceptors-in-guice.html > > one thing to note, you can't use @Inject on constructor since you > create it using new keyword. > > This was discussed before, you can search the group for "injecting > method interceptor". > > Cheers, > Alen > > On Jan 22, 7:42 pm, Miroslav Genov <[email protected]> wrote: > > Hello, > > I have a question regarding injection of an objects in a module. The > > problem which I'm currently having is how to inject an object into > > MethodInterceptor implementation. > > > > Here are some snippets from my code: > > > > public class RestrictionInterceptor implements MethodInterceptor { > > > > @Inject > > public RestrictionInterceptor(RestrictionChecker restrictionChecker) { > > this.restrictionChecker = restrictionChecker; > > > > } > > > > Where the module contains: > > bindInterceptor(subclassesOf(LoginService.class), > > returns(only(String.class)), new RestrictionInterceptor(...)); > > > > And in this case I don't know how to inject the right instance of > > RestrictionChecker. Any ideas how to solve this ? > > > > Thanks in advance > > > > Regards, > > Miroslav > > --~--~---------~--~----~------------~-------~--~----~ 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=en -~----------~----~----~----~------~----~------~--~---
