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>
|
||||
*/
|
||||
@ThreadSafe
|
||||
@ExperimentalApi
|
||||
public interface ServerInterceptor {
|
||||
/**
|
||||
* Intercept {@link ServerCall} dispatch by the {@code next} {@link ServerCallHandler}. General
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ package io.grpc;
|
|||
*
|
||||
* @see ServerServiceDefinition
|
||||
*/
|
||||
@ExperimentalApi
|
||||
public final class ServerMethodDefinition<ReqT, RespT> {
|
||||
private final MethodDescriptor<ReqT, RespT> method;
|
||||
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
|
||||
// handlers.
|
||||
public final class ServerServiceDefinition {
|
||||
@ExperimentalApi
|
||||
public static Builder builder(String serviceName) {
|
||||
return new Builder(serviceName);
|
||||
}
|
||||
|
|
@ -64,6 +65,7 @@ public final class ServerServiceDefinition {
|
|||
return name;
|
||||
}
|
||||
|
||||
@ExperimentalApi
|
||||
public Collection<ServerMethodDefinition<?, ?>> getMethods() {
|
||||
return methods.values();
|
||||
}
|
||||
|
|
@ -93,6 +95,7 @@ public final class ServerServiceDefinition {
|
|||
* @param method the {@link MethodDescriptor} of this method.
|
||||
* @param handler handler for incoming calls
|
||||
*/
|
||||
@ExperimentalApi
|
||||
public <ReqT, RespT> Builder addMethod(
|
||||
MethodDescriptor<ReqT, RespT> method, ServerCallHandler<ReqT, RespT> handler) {
|
||||
return addMethod(ServerMethodDefinition.create(
|
||||
|
|
@ -101,6 +104,7 @@ public final class ServerServiceDefinition {
|
|||
}
|
||||
|
||||
/** Add a method to be supported by the service. */
|
||||
@ExperimentalApi
|
||||
public <ReqT, RespT> Builder addMethod(ServerMethodDefinition<ReqT, RespT> def) {
|
||||
MethodDescriptor<ReqT, RespT> method = def.getMethodDescriptor();
|
||||
checkArgument(
|
||||
|
|
|
|||
Loading…
Reference in New Issue