本文整理匯總了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);
}