/** * @see Binder#bindInterceptor(com.google.inject.matcher.Matcher, * com.google.inject.matcher.Matcher, org.aopalliance.intercept.MethodInterceptor[]) */ protected void bindInterceptor( Matcher<? super Class<?>> classMatcher, Matcher<? super Method> methodMatcher, org.aopalliance.intercept.MethodInterceptor... interceptors) { binder().bindInterceptor(classMatcher, methodMatcher, interceptors); } /*end[AOP]*/
@Override public void applyTo(Binder binder) { binder .withSource(getSource()) .bindInterceptor( classMatcher, methodMatcher, interceptors.toArray(new MethodInterceptor[interceptors.size()])); } }
@Override public void bindInterceptor(Matcher<? super Class<?>> classMatcher, Matcher<? super Method> methodMatcher, MethodInterceptor... interceptors) { binder.bindInterceptor(classMatcher, methodMatcher, interceptors); }
/** * @see Binder#bindInterceptor(com.google.inject.matcher.Matcher, * com.google.inject.matcher.Matcher, * org.aopalliance.intercept.MethodInterceptor[]) */ protected void bindInterceptor(Matcher<? super Class<?>> classMatcher, Matcher<? super Method> methodMatcher, org.aopalliance.intercept.MethodInterceptor... interceptors) { binder.bindInterceptor(classMatcher, methodMatcher, interceptors); } /*end[AOP]*/
@Test public void test_interceptor() throws ClassNotFoundException { Injector injector = Guice.createInjector((Module) binder -> binder.bindInterceptor( Matchers.identicalTo(TestedRpcHandler.class), Matchers.any(), new RpcHandlerMethodInterceptor() )); TestedRpcHandler methodHandler = injector.getInstance(TestedRpcHandler.class); methodHandler.handleRequest(RpcEnvelope.Request.newBuilder().build(), new OrangeContext()); SameGuiceModuleAssertionOnInterceptorInvokation sameGuiceModuleAssertionOnInterceptorInvokation = injector.getInstance(SameGuiceModuleAssertionOnInterceptorInvokation.class); sameGuiceModuleAssertionOnInterceptorInvokation.test_that_intercepted_rpc_handler_still_verified(); assertThat(ReflectionUtil.findSubClassParameterType(methodHandler, 0)). isEqualTo(RpcEnvelope.Request.class); assertThat(ReflectionUtil.findSubClassParameterType(methodHandler, 1)). isEqualTo(RpcEnvelope.Response.class); }
public void configure(Binder binder) { if(widgetInterceptionEnabled){ binder.bindInterceptor(Matchers.any(), Matchers.any(), new WidgetInterceptor()); } }
/** * @see Binder#bindInterceptor(com.google.inject.matcher.Matcher, * com.google.inject.matcher.Matcher, * org.aopalliance.intercept.MethodInterceptor[]) */ protected void bindInterceptor(Matcher<? super Class<?>> classMatcher, Matcher<? super Method> methodMatcher, MethodInterceptor... interceptors) { builder.bindInterceptor(classMatcher, methodMatcher, interceptors); } }
@Override public void bindInterceptor(Matcher<? super Class<?>> classMatcher, Matcher<? super Method> methodMatcher, MethodInterceptor... interceptors) { binder.bindInterceptor(classMatcher, methodMatcher, interceptors); }
/** * @see Binder#bindInterceptor(com.google.inject.matcher.Matcher, * com.google.inject.matcher.Matcher, org.aopalliance.intercept.MethodInterceptor[]) */ @Override public void bindInterceptor(Matcher<? super Class<?>> classMatcher, Matcher<? super Method> methodMatcher, org.aopalliance.intercept.MethodInterceptor... interceptors) { binder().bindInterceptor(classMatcher, methodMatcher, interceptors); }
@Override default void bindInterceptor(final Matcher<? super Class<?>> classMatcher, final Matcher<? super Method> methodMatcher, final MethodInterceptor... interceptors) { this.binder().bindInterceptor(classMatcher, methodMatcher, interceptors); }
/** * @see Binder#bindInterceptor(com.google.inject.matcher.Matcher, * com.google.inject.matcher.Matcher, org.aopalliance.intercept.MethodInterceptor[]) */ protected void bindInterceptor( Matcher<? super Class<?>> classMatcher, Matcher<? super Method> methodMatcher, org.aopalliance.intercept.MethodInterceptor... interceptors) { binder().bindInterceptor(classMatcher, methodMatcher, interceptors); } /*end[AOP]*/
/** * @see Binder#bindInterceptor(com.google.inject.matcher.Matcher, * com.google.inject.matcher.Matcher, org.aopalliance.intercept.MethodInterceptor[]) */ @Override public void bindInterceptor(Matcher<? super Class<?>> classMatcher, Matcher<? super Method> methodMatcher, org.aopalliance.intercept.MethodInterceptor... interceptors) { binder().bindInterceptor(classMatcher, methodMatcher, interceptors); }
/** * @see Binder#bindInterceptor(com.google.inject.matcher.Matcher, * com.google.inject.matcher.Matcher, org.aopalliance.intercept.MethodInterceptor[]) */ protected void bindInterceptor( Matcher<? super Class<?>> classMatcher, Matcher<? super Method> methodMatcher, org.aopalliance.intercept.MethodInterceptor... interceptors) { binder().bindInterceptor(classMatcher, methodMatcher, interceptors); } /*end[AOP]*/
/** * @see Binder#bindInterceptor(com.google.inject.matcher.Matcher, * com.google.inject.matcher.Matcher, org.aopalliance.intercept.MethodInterceptor[]) */ @Override public void bindInterceptor(Matcher<? super Class<?>> classMatcher, Matcher<? super Method> methodMatcher, org.aopalliance.intercept.MethodInterceptor... interceptors) { binder().bindInterceptor(classMatcher, methodMatcher, interceptors); }
@Override public void bindInterceptor(Matcher<? super Class<?>> classMatcher, Matcher<? super Method> methodMatcher, MethodInterceptor... interceptors) { for (MethodInterceptor interceptor : interceptors) { requestInjection(interceptor); } binder.bindInterceptor(classMatcher, methodMatcher, interceptors); }
@Override public void bindInterceptor(Matcher<? super Class<?>> classMatcher, Matcher<? super Method> methodMatcher, MethodInterceptor... interceptors) { for (MethodInterceptor interceptor : interceptors) { requestInjection(interceptor); } binder.bindInterceptor(classMatcher, methodMatcher, interceptors); }
@Override public void bindInterceptor(Matcher<? super Class<?>> classMatcher, Matcher<? super Method> methodMatcher, MethodInterceptor... interceptors) { for (MethodInterceptor interceptor : interceptors) { requestInjection(interceptor); } binder.bindInterceptor(classMatcher, methodMatcher, interceptors); }
@Override public void applyTo(Binder binder) { binder .withSource(getSource()) .bindInterceptor( classMatcher, methodMatcher, interceptors.toArray(new MethodInterceptor[interceptors.size()])); } }
@Override public void applyTo(Binder binder) { binder .withSource(getSource()) .bindInterceptor( classMatcher, methodMatcher, interceptors.toArray(new MethodInterceptor[interceptors.size()])); } }
public void applyTo(Binder binder) { binder.withSource(getSource()).bindInterceptor(classMatcher, methodMatcher, interceptors.toArray(new MethodInterceptor[interceptors.size()])); } }