public abstract static class Context.Storage extends Object
The default implementation will put the current context in a ThreadLocal
. If an
alternative implementation named io.grpc.override.ContextStorageOverride
exists in the
classpath, it will be used instead of the default implementation.
This API is experimental and subject to change.
Constructor and Description |
---|
Storage() |
Modifier and Type | Method and Description |
---|---|
void |
attach(Context toAttach)
Deprecated.
This is an old API that is no longer used.
|
abstract Context |
current()
Implements
Context.current() . |
abstract void |
detach(Context toDetach,
Context toRestore)
Implements
Context.detach(io.grpc.Context) |
Context |
doAttach(Context toAttach)
Implements
Context.attach() . |
@Deprecated public void attach(Context toAttach)
public Context doAttach(Context toAttach)
Context.attach()
.
Caution: Context.attach()
interprets a return value of null
to mean
the same thing as Context.ROOT
.
See also: current()
.
toAttach
- the context to be attachedContext
that should be passed back into detach(Context, Context)
as the toRestore
parameter. null
is a valid return value, but see
caution note.public abstract void detach(Context toDetach, Context toRestore)
Context.detach(io.grpc.Context)
toDetach
- the context to be detached. Should be, or be equivalent to, the current
context of the current scopetoRestore
- the context to be the current. Should be, or be equivalent to, the context
of the outer scopepublic abstract Context current()
Context.current()
.
Caution: Context
interprets a return value of null
to mean the same
thing as Context{@link #ROOT}
.
See also doAttach(Context)
.
null
is a valid return value, but see
caution note.