MCPcopy Index your code
hub / github.com/grpc/grpc-java / Storage

Class Storage

api/src/context/java/io/grpc/Context.java:1001–1039  ·  view source on GitHub ↗

Defines the mechanisms for attaching and detaching the "current" context. The constructor for extending classes must not trigger any activity that can use Context, which includes logging, otherwise it can trigger an infinite initialization loop. Extending classes must not assume that only o

Source from the content-addressed store, hash-verified

999 * subject to change.
1000 */
1001 public abstract static class Storage {
1002 /**
1003 * Implements {@link io.grpc.Context#attach}.
1004 *
1005 * <p>Caution: {@link Context#attach()} interprets a return value of {@code null} to mean
1006 * the same thing as {@link Context#ROOT}.
1007 *
1008 * <p>See also: {@link #current()}.
1009
1010 * @param toAttach the context to be attached
1011 * @return A {@link Context} that should be passed back into {@link #detach(Context, Context)}
1012 * as the {@code toRestore} parameter. {@code null} is a valid return value, but see
1013 * caution note.
1014 */
1015 public abstract Context doAttach(Context toAttach);
1016
1017 /**
1018 * Implements {@link io.grpc.Context#detach}.
1019 *
1020 * @param toDetach the context to be detached. Should be, or be equivalent to, the current
1021 * context of the current scope
1022 * @param toRestore the context to be the current. Should be, or be equivalent to, the context
1023 * of the outer scope
1024 */
1025 public abstract void detach(Context toDetach, Context toRestore);
1026
1027 /**
1028 * Implements {@link io.grpc.Context#current}.
1029 *
1030 * <p>Caution: {@link Context} interprets a return value of {@code null} to mean the same
1031 * thing as {@link Context#ROOT}.
1032 *
1033 * <p>See also {@link #doAttach(Context)}.
1034 *
1035 * @return The context of the current scope. {@code null} is a valid return value, but see
1036 * caution note.
1037 */
1038 public abstract Context current();
1039 }
1040
1041 /**
1042 * Stores listener and executor pair.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected