Top Description Fields Constructors Methods
io.grpc

pack-priv final Class ThreadLocalContextStorage

extends Storage
Class Inheritance
Imports
java.util.logging.Level, .Logger

A ThreadLocal-based context storage implementation. Used by default.

Field Summary

Modifier and TypeField and Description
pack-priv static final ThreadLocal<Context>
localContext

Currently bound context.

private static final Logger

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public Context
public void
detach(Context
the context to be detached. Should be, or be equivalent to, the current context of the current scope
toDetach
,
Context
the context to be the current. Should be, or be equivalent to, the context of the outer scope
toRestore
)

Implements abstract io.grpc.Context.Storage.detach.

Implements io.grpc.Context#detach.
public Context
doAttach(Context
the context to be attached
toAttach
)

Implements abstract io.grpc.Context.Storage.doAttach.

Implements io.grpc.Context#attach.

Field Detail

localContextback to summary
pack-priv static final ThreadLocal<Context> localContext

Currently bound context.

logback to summary
private static final Logger log

Constructor Detail

ThreadLocalContextStorageback to summary
pack-priv ThreadLocalContextStorage()

Method Detail

currentback to summary
public Context current()

Implements abstract io.grpc.Context.Storage.current.

Doc from io.grpc.Context.Storage.current.

Implements io.grpc.Context#current.

Caution: Context interprets a return value of null to mean the same thing as Context#ROOT.

See also doAttach(Context).

Returns:Context

The context of the current scope. null is a valid return value, but see caution note.

Annotations
@Override
detachback to summary
public void detach(Context toDetach, Context toRestore)

Implements abstract io.grpc.Context.Storage.detach.

Doc from io.grpc.Context.Storage.detach.

Implements io.grpc.Context#detach.

Parameters
toDetach:Context

the context to be detached. Should be, or be equivalent to, the current context of the current scope

toRestore:Context

the context to be the current. Should be, or be equivalent to, the context of the outer scope

Annotations
@Override
doAttachback to summary
public Context doAttach(Context toAttach)

Implements abstract io.grpc.Context.Storage.doAttach.

Doc from io.grpc.Context.Storage.doAttach.

Implements io.grpc.Context#attach.

Caution: Context#attach() interprets a return value of null to mean the same thing as Context#ROOT.

See also: current().

Parameters
toAttach:Context

the context to be attached

Returns:Context

A Context that should be passed back into detach(Context, Context) as the toRestore parameter. null is a valid return value, but see caution note.

Annotations
@Override