Uses of Class
io.grpc.Context
Packages that use Context
Package
Description
The gRPC core public API.
Interfaces and implementations that are internal to gRPC.
-
Uses of Context in io.grpc
Modifier and TypeClassDescriptionstatic final class
A context which inherits cancellation from its parent but which can also be independently cancelled and which will propagate cancellation to its descendants.Modifier and TypeFieldDescriptionprivate final Context
CompositeCallCredentials.WrappingMetadataApplier.context
private final Context
Context.ExecutableListener.context
private final Context
Contexts.ContextualizedServerCallListener.context
static final Context
Context.ROOT
The logical root context which is the ultimate ancestor of all contexts.private final Context
Context.CancellableContext.uncancellableSurrogate
Modifier and TypeFieldDescription(package private) static final ThreadLocal
<Context> ThreadLocalContextStorage.localContext
Currently bound context.Modifier and TypeMethodDescriptionContext.attach()
Attach this context, thus enter a new scope within which this context iscurrent()
.Context.CancellableContext.attach()
static Context
Context.current()
Return the context associated with the current scope, will never returnnull
.abstract Context
Context.Storage.current()
Implementscurrent()
.ThreadLocalContextStorage.current()
abstract Context
Implementsattach()
.ServerStreamTracer.filterContext
(Context context) Called before the interceptors and the call handlers and make changes to the Context object if needed.Context.fork()
Create a new context which propagates the values of this context but does not cascade its cancellation.<V> Context
Context.withValue
(Context.Key<V> k1, V v1) Create a new context with the given key value set.<V1,
V2> Context Context.withValues
(Context.Key<V1> k1, V1 v1, Context.Key<V2> k2, V2 v2) Create a new context with the given key value set.<V1,
V2, V3>
ContextContext.withValues
(Context.Key<V1> k1, V1 v1, Context.Key<V2> k2, V2 v2, Context.Key<V3> k3, V3 v3) Create a new context with the given key value set.<V1,
V2, V3, V4>
ContextContext.withValues
(Context.Key<V1> k1, V1 v1, Context.Key<V2> k2, V2 v2, Context.Key<V3> k3, V3 v3, Context.Key<V4> k4, V4 v4) Create a new context with the given key value set.Modifier and TypeMethodDescription(package private) static Context.CancellableContext
Context.cancellableAncestor
(Context parent) Returnsparent
if it is aContext.CancellableContext
, otherwise returns the parent'scancellableAncestor
.void
Notifies that a context was cancelled.void
void
Reverse anattach()
, restoring the previous context and exiting the current scope.abstract void
Implementsdetach(io.grpc.Context)
.void
void
Context.CancellableContext.detachAndCancel
(Context toAttach, Throwable cause) Cancel this context and detach it as the current context.abstract Context
Implementsattach()
.ServerStreamTracer.filterContext
(Context context) Called before the interceptors and the call handlers and make changes to the Context object if needed.Get the value from the specified context for this key.static <ReqT,
RespT>
ServerCall.Listener<ReqT> Contexts.interceptCall
(Context context, ServerCall<ReqT, RespT> call, Metadata headers, ServerCallHandler<ReqT, RespT> next) private void
Context.CancellableContext.removeListenerInternal
(Context.CancellationListener cancellationListener, Context context) static Status
Contexts.statusFromCancelled
(Context context) Returns theStatus
of a cancelled context ornull
if the context is not cancelled.ModifierConstructorDescriptionprivate
CancellableContext
(Context parent) Create a cancellable context that does not have a deadline.private
CancellableContext
(Context parent, Deadline deadline) Create a cancellable context that has a deadline.private
Context
(Context parent, PersistentHashArrayMappedTrie.Node<Context.Key<?>, Object> keyValueEntries) Construct a context that cannot be cancelled but will cascade cancellation from its parent if it is cancellable.ContextualizedServerCallListener
(ServerCall.Listener<ReqT> delegate, Context context) (package private)
ExecutableListener
(Executor executor, Context.CancellationListener listener, Context context) WrappingMetadataApplier
(CallCredentials.RequestInfo requestInfo, Executor appExecutor, CallCredentials.MetadataApplier delegate, Context context) -
Uses of Context in io.grpc.grpclb
Fields in io.grpc.grpclb declared as ContextModifier and TypeFieldDescriptionprivate final Context
GrpclbLoadBalancer.context
private final Context
GrpclbState.context
Constructors in io.grpc.grpclb with parameters of type ContextModifierConstructorDescription(package private)
GrpclbLoadBalancer
(LoadBalancer.Helper helper, Context context, SubchannelPool subchannelPool, TimeProvider time, com.google.common.base.Stopwatch stopwatch, BackoffPolicy.Provider backoffPolicyProvider) (package private)
GrpclbState
(GrpclbConfig config, LoadBalancer.Helper helper, Context context, SubchannelPool subchannelPool, TimeProvider time, com.google.common.base.Stopwatch stopwatch, BackoffPolicy.Provider backoffPolicyProvider) -
Uses of Context in io.grpc.internal
Fields in io.grpc.internal declared as ContextModifier and TypeFieldDescriptionprivate final Context
ClientCallImpl.context
private final Context
ContextRunnable.context
private final Context
DelayedClientCall.context
private final Context
DelayedClientTransport.PendingStream.context
private final Context
ManagedChannelImpl.ConfigSelectingClientCall.context
(package private) final Context
ManagedChannelImpl.RealChannel.PendingCall.context
private final Context
MetadataApplierImpl.ctx
private final Context
ServerImpl.rootContext
Methods in io.grpc.internal that return ContextModifier and TypeMethodDescription<ReqT,
RespT>
ContextStatsTraceContext.serverFilterContext
(Context context) Methods in io.grpc.internal with parameters of type ContextModifier and TypeMethodDescriptionvoid
ClientCallImpl.ClientStreamProvider.newStream
(MethodDescriptor<?, ?> method, CallOptions callOptions, Metadata headers, Context context) ManagedChannelImpl.ChannelStreamProvider.newStream
(MethodDescriptor<?, ?> method, CallOptions callOptions, Metadata headers, Context context) <ReqT,
RespT>
ContextStatsTraceContext.serverFilterContext
(Context context) Constructors in io.grpc.internal with parameters of type ContextModifierConstructorDescriptionprotected
ContextRunnable
(Context context) (package private)
PendingCall
(Context context, MethodDescriptor<ReqT, RespT> method, CallOptions callOptions) (package private)
ServerImpl
(ServerImplBuilder builder, InternalServer transportServer, Context rootContext) Construct a server.