I\'m trying to print a \"Hello, AOP!\" message whenever Guice/AOP Alliance intercepts a method marked with a particular (custom) annotation. I have followed the official do
If you don't let Guice construct your object, it can't provide you an instance with the interceptor wrapped around. You must not use new AopTest()
to get an instance of your object. Instead, you must ask Guice to give you one instance:
Injector injector = Guice.createInjector(new ValidatingModule ());
AopTest test = injector.getInstance(AopTest.class);
See http://code.google.com/p/google-guice/wiki/GettingStarted