下面列出了org.springframework.beans.factory.FactoryBean#getObject ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
private ServerServiceDefinition newSpanBindableService(Executor executor) throws Exception {
FactoryBean<ServerInterceptor> interceptorFactory = new StreamExecutorServerInterceptorFactory(executor, 100, Executors.newSingleThreadScheduledExecutor(), 1000, 10);
((StreamExecutorServerInterceptorFactory) interceptorFactory).setBeanName("SpanService");
ServerInterceptor interceptor = interceptorFactory.getObject();
SpanService spanService = new SpanService(new MockDispatchHandler(), new DefaultServerRequestFactory());
return ServerInterceptors.intercept(spanService, interceptor);
}
private ServerServiceDefinition newStatBindableService(Executor executor) throws Exception {
FactoryBean<ServerInterceptor> interceptorFactory = new StreamExecutorServerInterceptorFactory(executor, 100, Executors.newSingleThreadScheduledExecutor(), 1000, 10);
ServerInterceptor interceptor = interceptorFactory.getObject();
StatService statService = new StatService(new MockDispatchHandler(), new DefaultServerRequestFactory());
return ServerInterceptors.intercept(statService, interceptor);
}