MCPcopy Create free account
hub / github.com/grpc/grpc-java / interceptCall

Method interceptCall

binder/src/main/java/io/grpc/binder/PeerUids.java:87–98  ·  view source on GitHub ↗
(
          ServerCall<ReqT, RespT> call, Metadata headers, ServerCallHandler<ReqT, RespT> next)

Source from the content-addressed store, hash-verified

85 public static ServerInterceptor newPeerIdentifyingServerInterceptor() {
86 return new ServerInterceptor() {
87 @Override
88 public <ReqT, RespT> ServerCall.Listener<ReqT> interceptCall(
89 ServerCall<ReqT, RespT> call, Metadata headers, ServerCallHandler<ReqT, RespT> next) {
90 Context context = Context.current();
91 PeerUid client =
92 new PeerUid(
93 checkNotNull(
94 call.getAttributes().get(BinderTransport.REMOTE_UID),
95 "Expected BinderTransport attribute REMOTE_UID was missing. Is this "
96 + "interceptor installed on an unsupported type of Server?"));
97 return Contexts.interceptCall(context.withValue(REMOTE_PEER, client), call, headers, next);
98 }
99 };
100 }
101

Callers

nothing calls this directly

Calls 6

currentMethod · 0.95
interceptCallMethod · 0.95
withValueMethod · 0.95
checkNotNullMethod · 0.80
getMethod · 0.65
getAttributesMethod · 0.65

Tested by

no test coverage detected