@Override protected void bindInterceptor(final Matcher<? super Class<?>> classMatcher, final Matcher<? super Method> methodMatcher, final MethodInterceptor... interceptors) { // hack to correctly bind @Transactional annotation for java8: // aop tries to intercept synthetic methods which cause a lot of warnings // (and generally not correct) super.bindInterceptor(classMatcher, new AbstractMatcher<Method>() { @Override public boolean matches(final Method method) { return !method.isSynthetic() && !method.isBridge() && methodMatcher.matches(method); } }, interceptors); }
@Override protected final void configure() { configurePersistence(); requireBinding(PersistService.class); requireBinding(UnitOfWork.class); /*if[AOP]*/ // wrapping in an if[AOP] just to allow this to compile in NO_AOP -- it won't be used // class-level @Transacational bindInterceptor(annotatedWith(Transactional.class), any(), getTransactionInterceptor()); // method-level @Transacational bindInterceptor(any(), annotatedWith(Transactional.class), getTransactionInterceptor()); /*end[AOP]*/ }
@Override protected final void configure() { configurePersistence(); requireBinding(PersistService.class); requireBinding(UnitOfWork.class); /*if[AOP]*/ // wrapping in an if[AOP] just to allow this to compile in NO_AOP -- it won't be used // class-level @Transacational bindInterceptor(annotatedWith(Transactional.class), any(), getTransactionInterceptor()); // method-level @Transacational bindInterceptor(any(), annotatedWith(Transactional.class), getTransactionInterceptor()); /*end[AOP]*/ }