mirror of https://github.com/grpc/grpc-java.git
Mark more server-side pieces experimental
You can't make an interceptor without calling ServerCallHandler, so it is now marked experimental.
This commit is contained in:
parent
491a98afc5
commit
6e0651643e
|
|
@ -46,6 +46,7 @@ import javax.annotation.concurrent.ThreadSafe;
|
||||||
* </ul>
|
* </ul>
|
||||||
*/
|
*/
|
||||||
@ThreadSafe
|
@ThreadSafe
|
||||||
|
@ExperimentalApi
|
||||||
public interface ServerInterceptor {
|
public interface ServerInterceptor {
|
||||||
/**
|
/**
|
||||||
* Intercept {@link ServerCall} dispatch by the {@code next} {@link ServerCallHandler}. General
|
* Intercept {@link ServerCall} dispatch by the {@code next} {@link ServerCallHandler}. General
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@ package io.grpc;
|
||||||
*
|
*
|
||||||
* @see ServerServiceDefinition
|
* @see ServerServiceDefinition
|
||||||
*/
|
*/
|
||||||
|
@ExperimentalApi
|
||||||
public final class ServerMethodDefinition<ReqT, RespT> {
|
public final class ServerMethodDefinition<ReqT, RespT> {
|
||||||
private final MethodDescriptor<ReqT, RespT> method;
|
private final MethodDescriptor<ReqT, RespT> method;
|
||||||
private final ServerCallHandler<ReqT, RespT> handler;
|
private final ServerCallHandler<ReqT, RespT> handler;
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,7 @@ import java.util.Map;
|
||||||
// consider removing ServerServiceDefinition to and let the registry to have a big map of
|
// consider removing ServerServiceDefinition to and let the registry to have a big map of
|
||||||
// handlers.
|
// handlers.
|
||||||
public final class ServerServiceDefinition {
|
public final class ServerServiceDefinition {
|
||||||
|
@ExperimentalApi
|
||||||
public static Builder builder(String serviceName) {
|
public static Builder builder(String serviceName) {
|
||||||
return new Builder(serviceName);
|
return new Builder(serviceName);
|
||||||
}
|
}
|
||||||
|
|
@ -64,6 +65,7 @@ public final class ServerServiceDefinition {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ExperimentalApi
|
||||||
public Collection<ServerMethodDefinition<?, ?>> getMethods() {
|
public Collection<ServerMethodDefinition<?, ?>> getMethods() {
|
||||||
return methods.values();
|
return methods.values();
|
||||||
}
|
}
|
||||||
|
|
@ -93,6 +95,7 @@ public final class ServerServiceDefinition {
|
||||||
* @param method the {@link MethodDescriptor} of this method.
|
* @param method the {@link MethodDescriptor} of this method.
|
||||||
* @param handler handler for incoming calls
|
* @param handler handler for incoming calls
|
||||||
*/
|
*/
|
||||||
|
@ExperimentalApi
|
||||||
public <ReqT, RespT> Builder addMethod(
|
public <ReqT, RespT> Builder addMethod(
|
||||||
MethodDescriptor<ReqT, RespT> method, ServerCallHandler<ReqT, RespT> handler) {
|
MethodDescriptor<ReqT, RespT> method, ServerCallHandler<ReqT, RespT> handler) {
|
||||||
return addMethod(ServerMethodDefinition.create(
|
return addMethod(ServerMethodDefinition.create(
|
||||||
|
|
@ -101,6 +104,7 @@ public final class ServerServiceDefinition {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Add a method to be supported by the service. */
|
/** Add a method to be supported by the service. */
|
||||||
|
@ExperimentalApi
|
||||||
public <ReqT, RespT> Builder addMethod(ServerMethodDefinition<ReqT, RespT> def) {
|
public <ReqT, RespT> Builder addMethod(ServerMethodDefinition<ReqT, RespT> def) {
|
||||||
MethodDescriptor<ReqT, RespT> method = def.getMethodDescriptor();
|
MethodDescriptor<ReqT, RespT> method = def.getMethodDescriptor();
|
||||||
checkArgument(
|
checkArgument(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue