本文整理汇总了Java中com.google.inject.Binder.bindInterceptor方法的典型用法代码示例。如果您正苦于以下问题:Java Binder.bindInterceptor方法的具体用法?Java Binder.bindInterceptor怎么用?Java Binder.bindInterceptor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.inject.Binder
的用法示例。
在下文中一共展示了Binder.bindInterceptor方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: configure
import com.google.inject.Binder; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void configure(Binder binder) {
logger.debug("NORAUI NoraUiModule configure");
binder.bindInterceptor(any(), annotatedWith(Conditioned.class), new ConditionedInterceptor());
binder.bindInterceptor(Matchers.subclassesOf(com.github.noraui.application.steps.Step.class).or(Matchers.subclassesOf(BrowserSteps.class)), any(), new StepInterceptor());
}
示例2: configure
import com.google.inject.Binder; //导入方法依赖的package包/类
/**
* module implements
*
* @param binder
*/
@Override
public void configure(Binder binder) {
// 设置 TypeListener
binder.bindListener(Matchers.any(), this);
// 设置 Metrics 相关的统计拦截
binder.bindInterceptor(Matchers.any(), Matchers.annotatedWith(EnableMetricCounter.class), new JbootMetricConterAopInterceptor());
binder.bindInterceptor(Matchers.any(), Matchers.annotatedWith(EnableMetricHistogram.class), new JbootMetricHistogramAopInterceptor());
binder.bindInterceptor(Matchers.any(), Matchers.annotatedWith(EnableMetricMeter.class), new JbootMetricMeterAopInterceptor());
binder.bindInterceptor(Matchers.any(), Matchers.annotatedWith(EnableMetricTimer.class), new JbootMetricTimerAopInterceptor());
// 设置 hystricx 的拦截器
binder.bindInterceptor(Matchers.any(), Matchers.annotatedWith(EnableHystrixCommand.class), new JbootHystrixCommandInterceptor());
// 设置 Jfinal AOP 相关的拦截器
binder.bindInterceptor(Matchers.any(), Matchers.annotatedWith(Before.class), new JFinalBeforeInterceptor());
binder.bindInterceptor(Matchers.annotatedWith(Before.class), Matchers.any(), new JFinalBeforeInterceptor());
// 设置缓存相关的拦截器
binder.bindInterceptor(Matchers.any(), Matchers.annotatedWith(Cacheable.class), new JbootCacheInterceptor());
binder.bindInterceptor(Matchers.any(), Matchers.annotatedWith(CacheEvict.class), new JbootCacheEvictInterceptor());
binder.bindInterceptor(Matchers.any(), Matchers.annotatedWith(CachePut.class), new JbootCachePutInterceptor());
/**
* Bean 注解
*/
beanBind(binder);
//自定义aop configure
JbootAppListenerManager.me().onGuiceConfigure(binder);
}