Search in sources :

Example 1 with SpanService

use of com.navercorp.pinpoint.collector.receiver.grpc.service.SpanService in project pinpoint by naver.

the class SpanServerTestMain method newSpanBindableService.

private ServerServiceDefinition newSpanBindableService(Executor executor) throws Exception {
    GrpcStreamConfiguration streamConfiguration = newStreamConfiguration();
    FactoryBean<ServerInterceptor> interceptorFactory = new StreamExecutorServerInterceptorFactory(executor, Executors.newSingleThreadScheduledExecutor(), streamConfiguration);
    ((StreamExecutorServerInterceptorFactory) interceptorFactory).setBeanName("SpanService");
    ServerInterceptor interceptor = interceptorFactory.getObject();
    SpanService spanService = new SpanService(new MockDispatchHandler(), new DefaultServerRequestFactory());
    return ServerInterceptors.intercept(spanService, interceptor);
}
Also used : GrpcStreamConfiguration(com.navercorp.pinpoint.collector.grpc.config.GrpcStreamConfiguration) ServerInterceptor(io.grpc.ServerInterceptor) SpanService(com.navercorp.pinpoint.collector.receiver.grpc.service.SpanService) DefaultServerRequestFactory(com.navercorp.pinpoint.collector.receiver.grpc.service.DefaultServerRequestFactory) StreamExecutorServerInterceptorFactory(com.navercorp.pinpoint.collector.receiver.grpc.service.StreamExecutorServerInterceptorFactory)

Aggregations

GrpcStreamConfiguration (com.navercorp.pinpoint.collector.grpc.config.GrpcStreamConfiguration)1 DefaultServerRequestFactory (com.navercorp.pinpoint.collector.receiver.grpc.service.DefaultServerRequestFactory)1 SpanService (com.navercorp.pinpoint.collector.receiver.grpc.service.SpanService)1 StreamExecutorServerInterceptorFactory (com.navercorp.pinpoint.collector.receiver.grpc.service.StreamExecutorServerInterceptorFactory)1 ServerInterceptor (io.grpc.ServerInterceptor)1