MCPcopy Create free account
hub / github.com/grpc/grpc-java / createStorage

Method createStorage

api/src/context/java/io/grpc/Context.java:126–139  ·  view source on GitHub ↗
(
        AtomicReference<? super ClassNotFoundException> deferredStorageFailure)

Source from the content-addressed store, hash-verified

124 }
125
126 private static Storage createStorage(
127 AtomicReference<? super ClassNotFoundException> deferredStorageFailure) {
128 try {
129 Class<?> clazz = Class.forName("io.grpc.override.ContextStorageOverride");
130 // The override's constructor is prohibited from triggering any code that can loop back to
131 // Context
132 return clazz.asSubclass(Storage.class).getConstructor().newInstance();
133 } catch (ClassNotFoundException e) {
134 deferredStorageFailure.set(e);
135 return new ThreadLocalContextStorage();
136 } catch (Exception e) {
137 throw new RuntimeException("Storage override failed to initialize", e);
138 }
139 }
140 }
141
142 /**

Callers 1

LazyStorageClass · 0.95

Calls 3

newInstanceMethod · 0.65
setMethod · 0.65
forNameMethod · 0.45

Tested by

no test coverage detected