use of com.navercorp.pinpoint.grpc.server.lifecycle.PingEventHandler in project pinpoint by naver.
the class AgentServerTestMain method run.
public void run() throws Exception {
GrpcReceiver grpcReceiver = new GrpcReceiver();
grpcReceiver.setEnable(true);
grpcReceiver.setBeanName("AgentServer");
BindAddress.Builder builder = BindAddress.newBuilder();
builder.setPort(PORT);
builder.setIp(IP);
grpcReceiver.setBindAddress(builder.build());
PingEventHandler pingEventHandler = mock(PingEventHandler.class);
BindableService agentService = new AgentService(new MockDispatchHandler(), pingEventHandler, Executors.newFixedThreadPool(8), serverRequestFactory);
grpcReceiver.setBindableServiceList(Arrays.asList(agentService, new MetadataService(new MockDispatchHandler(), Executors.newFixedThreadPool(8), serverRequestFactory)));
grpcReceiver.setAddressFilter(new MockAddressFilter());
grpcReceiver.setExecutor(Executors.newFixedThreadPool(8));
grpcReceiver.setServerOption(ServerOption.newBuilder().build());
grpcReceiver.afterPropertiesSet();
grpcReceiver.blockUntilShutdown();
grpcReceiver.destroy();
}
Aggregations