New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
api, core, services: make ProtoReflectionService interceptor compatible #6967
Changes from 14 commits
4f7462d
7d8547a
1952927
5b51f87
9273cdd
d268012
933d099
130adde
f50789b
acb2a44
19fd730
b0d15a6
d3935fa
e4a6b9b
9a979c5
6277cac
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright 2020 The gRPC Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.grpc.internal; | ||
|
||
import io.grpc.Context; | ||
import io.grpc.Internal; | ||
import io.grpc.Server; | ||
|
||
/** | ||
* Internal accessor for getting the {@link Server} instance inside server RPC {@link Context}. | ||
* This is intended for usage internal to the gRPC team, as it's unclear to us what users would | ||
* need. If you *really* think you need to use this, please file an issue for us to discuss a | ||
* public API. | ||
*/ | ||
@Internal | ||
public class InternalServerAccessor { | ||
public static final Context.Key<Server> SERVER_KEY = ServerImpl.SERVER_CONTEXT_KEY; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since this instance is being used as API and not as convenience, the instance needs to be created in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Moved the creation to |
||
|
||
// Prevent instantiation. | ||
private InternalServerAccessor() { | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's drop the "really". I don't see the need for the emphasis, and no real need to scare off users from filing an issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reworded. Users should refer to the documentation at where the Context key is created (
io.grpc.Server
). The accessor is just for our own usage.