Search in sources :

Example 1 with DefaultServerRequestFactory

use of com.navercorp.pinpoint.collector.receiver.grpc.service.DefaultServerRequestFactory 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)

Example 2 with DefaultServerRequestFactory

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

the class StatServerTestMain method newStatBindableService.

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

Aggregations

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