Modifier and Type | Class | Description |
---|---|---|
static class |
Context.CancellableContext |
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 Type | Field | Description |
---|---|---|
static Context |
Context.ROOT |
The logical root context which is the ultimate ancestor of all contexts.
|
Modifier and Type | Method | Description |
---|---|---|
Context |
Context.attach() |
Attach this context, thus enter a new scope within which this context is
current() . |
Context |
Context.CancellableContext.attach() |
|
static Context |
Context.current() |
Return the context associated with the current scope, will never return
null . |
abstract Context |
Context.Storage.current() |
Implements
current() . |
Context |
Context.Storage.doAttach(Context toAttach) |
Implements
attach() . |
Context |
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.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> |
Context.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> |
Context.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 Type | Method | Description |
---|---|---|
void |
Context.Storage.attach(Context toAttach) |
Deprecated.
This is an old API that is no longer used.
|
void |
Context.CancellationListener.cancelled(Context context) |
|
void |
Context.CancellableContext.detach(Context toAttach) |
|
void |
Context.detach(Context toAttach) |
Reverse an
attach() , restoring the previous context and exiting the current scope. |
abstract void |
Context.Storage.detach(Context toDetach,
Context toRestore) |
Implements
detach(io.grpc.Context) |
void |
Context.CancellableContext.detachAndCancel(Context toAttach,
java.lang.Throwable cause) |
Cancel this context and detach it as the current context.
|
Context |
Context.Storage.doAttach(Context toAttach) |
Implements
attach() . |
T |
Context.Key.get(Context context) |
Get the value from the specified context for this key.
|