Remove previous BindService implementation

pull/17837/head
= 6 years ago
parent d98de1facf
commit bf0d1d6bfc
  1. 39
      src/compiler/csharp_generator.cc
  2. 64
      src/csharp/Grpc.Core/ServiceBinderBase.cs
  3. 12
      src/csharp/Grpc.Examples/MathGrpc.cs
  4. 10
      src/csharp/Grpc.HealthCheck/HealthGrpc.cs
  5. 13
      src/csharp/Grpc.IntegrationTesting/BenchmarkServiceGrpc.cs
  6. 8
      src/csharp/Grpc.IntegrationTesting/EmptyServiceGrpc.cs
  7. 10
      src/csharp/Grpc.IntegrationTesting/MetricsGrpc.cs
  8. 9
      src/csharp/Grpc.IntegrationTesting/ReportQpsScenarioServiceGrpc.cs
  9. 35
      src/csharp/Grpc.IntegrationTesting/TestGrpc.cs
  10. 12
      src/csharp/Grpc.IntegrationTesting/WorkerServiceGrpc.cs
  11. 9
      src/csharp/Grpc.Reflection/ReflectionGrpc.cs

@ -609,43 +609,7 @@ void GenerateBindServiceMethod(Printer* out, const ServiceDescriptor* service) {
out->Print("\n");
}
void GenerateBindServiceWithBinderMethod(Printer* out,
const ServiceDescriptor* service) {
out->Print(
"/// <summary>Register service method implementations with a service "
"binder. Useful when customizing the service binding logic.\n"
"/// Note: this method is part of an experimental API that can change or "
"be "
"removed without any prior notice.</summary>\n");
out->Print(
"/// <param name=\"serviceBinder\">Service methods will be bound by "
"calling <c>AddMethod</c> on this object."
"</param>\n");
out->Print(
"/// <param name=\"serviceImpl\">An object implementing the server-side"
" handling logic.</param>\n");
out->Print(
"public static void BindService(grpc::ServiceBinderBase serviceBinder, "
"$implclass$ "
"serviceImpl)\n",
"implclass", GetServerClassName(service));
out->Print("{\n");
out->Indent();
for (int i = 0; i < service->method_count(); i++) {
const MethodDescriptor* method = service->method(i);
out->Print(
"serviceBinder.AddMethod($methodfield$, serviceImpl.$methodname$);\n",
"methodfield", GetMethodFieldName(method), "methodname",
method->name());
}
out->Outdent();
out->Print("}\n");
out->Print("\n");
}
void GenerateBindServiceWithBinderMethodWithoutImplementation(
void GenerateBindServiceWithBinderMethod(
Printer* out, const ServiceDescriptor* service) {
out->Print(
"/// <summary>Register service method with a service "
@ -704,7 +668,6 @@ void GenerateService(Printer* out, const ServiceDescriptor* service,
if (generate_server) {
GenerateBindServiceMethod(out, service);
GenerateBindServiceWithBinderMethod(out, service);
GenerateBindServiceWithBinderMethodWithoutImplementation(out, service);
}
out->Outdent();

@ -34,70 +34,6 @@ namespace Grpc.Core
/// </summary>
public class ServiceBinderBase
{
/// <summary>
/// Adds a definition for a single request - single response method.
/// </summary>
/// <typeparam name="TRequest">The request message class.</typeparam>
/// <typeparam name="TResponse">The response message class.</typeparam>
/// <param name="method">The method.</param>
/// <param name="handler">The method handler.</param>
public virtual void AddMethod<TRequest, TResponse>(
Method<TRequest, TResponse> method,
UnaryServerMethod<TRequest, TResponse> handler)
where TRequest : class
where TResponse : class
{
throw new NotImplementedException();
}
/// <summary>
/// Adds a definition for a client streaming method.
/// </summary>
/// <typeparam name="TRequest">The request message class.</typeparam>
/// <typeparam name="TResponse">The response message class.</typeparam>
/// <param name="method">The method.</param>
/// <param name="handler">The method handler.</param>
public virtual void AddMethod<TRequest, TResponse>(
Method<TRequest, TResponse> method,
ClientStreamingServerMethod<TRequest, TResponse> handler)
where TRequest : class
where TResponse : class
{
throw new NotImplementedException();
}
/// <summary>
/// Adds a definition for a server streaming method.
/// </summary>
/// <typeparam name="TRequest">The request message class.</typeparam>
/// <typeparam name="TResponse">The response message class.</typeparam>
/// <param name="method">The method.</param>
/// <param name="handler">The method handler.</param>
public virtual void AddMethod<TRequest, TResponse>(
Method<TRequest, TResponse> method,
ServerStreamingServerMethod<TRequest, TResponse> handler)
where TRequest : class
where TResponse : class
{
throw new NotImplementedException();
}
/// <summary>
/// Adds a definition for a bidirectional streaming method.
/// </summary>
/// <typeparam name="TRequest">The request message class.</typeparam>
/// <typeparam name="TResponse">The response message class.</typeparam>
/// <param name="method">The method.</param>
/// <param name="handler">The method handler.</param>
public virtual void AddMethod<TRequest, TResponse>(
Method<TRequest, TResponse> method,
DuplexStreamingServerMethod<TRequest, TResponse> handler)
where TRequest : class
where TResponse : class
{
throw new NotImplementedException();
}
/// <summary>
/// Adds a method without a handler.
/// </summary>

@ -287,18 +287,6 @@ namespace Math {
.AddMethod(__Method_Sum, serviceImpl.Sum).Build();
}
/// <summary>Register service method implementations with a service binder. Useful when customizing the service binding logic.
/// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary>
/// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>
/// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
public static void BindService(grpc::ServiceBinderBase serviceBinder, MathBase serviceImpl)
{
serviceBinder.AddMethod(__Method_Div, serviceImpl.Div);
serviceBinder.AddMethod(__Method_DivMany, serviceImpl.DivMany);
serviceBinder.AddMethod(__Method_Fib, serviceImpl.Fib);
serviceBinder.AddMethod(__Method_Sum, serviceImpl.Sum);
}
/// <summary>Register service method with a service binder without implementation. Useful when customizing the service binding logic.
/// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary>
/// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>

@ -233,16 +233,6 @@ namespace Grpc.Health.V1 {
.AddMethod(__Method_Watch, serviceImpl.Watch).Build();
}
/// <summary>Register service method implementations with a service binder. Useful when customizing the service binding logic.
/// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary>
/// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>
/// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
public static void BindService(grpc::ServiceBinderBase serviceBinder, HealthBase serviceImpl)
{
serviceBinder.AddMethod(__Method_Check, serviceImpl.Check);
serviceBinder.AddMethod(__Method_Watch, serviceImpl.Watch);
}
/// <summary>Register service method with a service binder without implementation. Useful when customizing the service binding logic.
/// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary>
/// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>

@ -324,19 +324,6 @@ namespace Grpc.Testing {
.AddMethod(__Method_StreamingBothWays, serviceImpl.StreamingBothWays).Build();
}
/// <summary>Register service method implementations with a service binder. Useful when customizing the service binding logic.
/// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary>
/// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>
/// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
public static void BindService(grpc::ServiceBinderBase serviceBinder, BenchmarkServiceBase serviceImpl)
{
serviceBinder.AddMethod(__Method_UnaryCall, serviceImpl.UnaryCall);
serviceBinder.AddMethod(__Method_StreamingCall, serviceImpl.StreamingCall);
serviceBinder.AddMethod(__Method_StreamingFromClient, serviceImpl.StreamingFromClient);
serviceBinder.AddMethod(__Method_StreamingFromServer, serviceImpl.StreamingFromServer);
serviceBinder.AddMethod(__Method_StreamingBothWays, serviceImpl.StreamingBothWays);
}
/// <summary>Register service method with a service binder without implementation. Useful when customizing the service binding logic.
/// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary>
/// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>

@ -80,14 +80,6 @@ namespace Grpc.Testing {
return grpc::ServerServiceDefinition.CreateBuilder().Build();
}
/// <summary>Register service method implementations with a service binder. Useful when customizing the service binding logic.
/// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary>
/// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>
/// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
public static void BindService(grpc::ServiceBinderBase serviceBinder, EmptyServiceBase serviceImpl)
{
}
/// <summary>Register service method with a service binder without implementation. Useful when customizing the service binding logic.
/// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary>
/// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>

@ -193,16 +193,6 @@ namespace Grpc.Testing {
.AddMethod(__Method_GetGauge, serviceImpl.GetGauge).Build();
}
/// <summary>Register service method implementations with a service binder. Useful when customizing the service binding logic.
/// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary>
/// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>
/// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
public static void BindService(grpc::ServiceBinderBase serviceBinder, MetricsServiceBase serviceImpl)
{
serviceBinder.AddMethod(__Method_GetAllGauges, serviceImpl.GetAllGauges);
serviceBinder.AddMethod(__Method_GetGauge, serviceImpl.GetGauge);
}
/// <summary>Register service method with a service binder without implementation. Useful when customizing the service binding logic.
/// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary>
/// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>

@ -143,15 +143,6 @@ namespace Grpc.Testing {
.AddMethod(__Method_ReportScenario, serviceImpl.ReportScenario).Build();
}
/// <summary>Register service method implementations with a service binder. Useful when customizing the service binding logic.
/// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary>
/// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>
/// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
public static void BindService(grpc::ServiceBinderBase serviceBinder, ReportQpsScenarioServiceBase serviceImpl)
{
serviceBinder.AddMethod(__Method_ReportScenario, serviceImpl.ReportScenario);
}
/// <summary>Register service method with a service binder without implementation. Useful when customizing the service binding logic.
/// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary>
/// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>

@ -539,22 +539,6 @@ namespace Grpc.Testing {
.AddMethod(__Method_UnimplementedCall, serviceImpl.UnimplementedCall).Build();
}
/// <summary>Register service method implementations with a service binder. Useful when customizing the service binding logic.
/// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary>
/// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>
/// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
public static void BindService(grpc::ServiceBinderBase serviceBinder, TestServiceBase serviceImpl)
{
serviceBinder.AddMethod(__Method_EmptyCall, serviceImpl.EmptyCall);
serviceBinder.AddMethod(__Method_UnaryCall, serviceImpl.UnaryCall);
serviceBinder.AddMethod(__Method_CacheableUnaryCall, serviceImpl.CacheableUnaryCall);
serviceBinder.AddMethod(__Method_StreamingOutputCall, serviceImpl.StreamingOutputCall);
serviceBinder.AddMethod(__Method_StreamingInputCall, serviceImpl.StreamingInputCall);
serviceBinder.AddMethod(__Method_FullDuplexCall, serviceImpl.FullDuplexCall);
serviceBinder.AddMethod(__Method_HalfDuplexCall, serviceImpl.HalfDuplexCall);
serviceBinder.AddMethod(__Method_UnimplementedCall, serviceImpl.UnimplementedCall);
}
/// <summary>Register service method with a service binder without implementation. Useful when customizing the service binding logic.
/// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary>
/// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>
@ -692,15 +676,6 @@ namespace Grpc.Testing {
.AddMethod(__Method_UnimplementedCall, serviceImpl.UnimplementedCall).Build();
}
/// <summary>Register service method implementations with a service binder. Useful when customizing the service binding logic.
/// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary>
/// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>
/// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
public static void BindService(grpc::ServiceBinderBase serviceBinder, UnimplementedServiceBase serviceImpl)
{
serviceBinder.AddMethod(__Method_UnimplementedCall, serviceImpl.UnimplementedCall);
}
/// <summary>Register service method with a service binder without implementation. Useful when customizing the service binding logic.
/// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary>
/// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>
@ -827,16 +802,6 @@ namespace Grpc.Testing {
.AddMethod(__Method_Stop, serviceImpl.Stop).Build();
}
/// <summary>Register service method implementations with a service binder. Useful when customizing the service binding logic.
/// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary>
/// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>
/// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
public static void BindService(grpc::ServiceBinderBase serviceBinder, ReconnectServiceBase serviceImpl)
{
serviceBinder.AddMethod(__Method_Start, serviceImpl.Start);
serviceBinder.AddMethod(__Method_Stop, serviceImpl.Stop);
}
/// <summary>Register service method with a service binder without implementation. Useful when customizing the service binding logic.
/// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary>
/// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>

@ -321,18 +321,6 @@ namespace Grpc.Testing {
.AddMethod(__Method_QuitWorker, serviceImpl.QuitWorker).Build();
}
/// <summary>Register service method implementations with a service binder. Useful when customizing the service binding logic.
/// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary>
/// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>
/// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
public static void BindService(grpc::ServiceBinderBase serviceBinder, WorkerServiceBase serviceImpl)
{
serviceBinder.AddMethod(__Method_RunServer, serviceImpl.RunServer);
serviceBinder.AddMethod(__Method_RunClient, serviceImpl.RunClient);
serviceBinder.AddMethod(__Method_CoreCount, serviceImpl.CoreCount);
serviceBinder.AddMethod(__Method_QuitWorker, serviceImpl.QuitWorker);
}
/// <summary>Register service method with a service binder without implementation. Useful when customizing the service binding logic.
/// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary>
/// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>

@ -123,15 +123,6 @@ namespace Grpc.Reflection.V1Alpha {
.AddMethod(__Method_ServerReflectionInfo, serviceImpl.ServerReflectionInfo).Build();
}
/// <summary>Register service method implementations with a service binder. Useful when customizing the service binding logic.
/// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary>
/// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>
/// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
public static void BindService(grpc::ServiceBinderBase serviceBinder, ServerReflectionBase serviceImpl)
{
serviceBinder.AddMethod(__Method_ServerReflectionInfo, serviceImpl.ServerReflectionInfo);
}
/// <summary>Register service method with a service binder without implementation. Useful when customizing the service binding logic.
/// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary>
/// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>

Loading…
Cancel
Save