(
AtomicReference<? super ClassNotFoundException> deferredStorageFailure)
| 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 | /** |
no test coverage detected