Updates:
Status: WorkingAsIntended
Comment #1 on issue 702 by sberlin: Private modules and aop interceptors do
not work together - test code in description
http://code.google.com/p/google-guice/issues/detail?id=702
Although I haven't analyzed it as closely, this I think this is the same
issue as described in issue 722. The problem is that your bind statement is:
bind(Intercepted.class).to(MethodIntercepted.class);
and there's no separate binding for MethodIntercepted.class. So Guice
doesn't know you want MethodIntercepted to be private, it just knows you
want Intercepted to link to whatever MethodIntercepted is.
MethodIntercepted gets promoted to the parent module, and the interceptor
doesn't apply to the parent module.
Adding bind(MethodIntercepted.class) to your PrivateModule should fix it.
Alternately, adding binder().requireExplicitBindings() to the parent Module
will tell Guice that just-in-time bindings aren't allowed, and it won't
attempt to promote MethodIntercepted to the parent module.
--
You received this message because you are subscribed to the Google Groups
"google-guice-dev" 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-dev?hl=en.