Returns the ClassLoader-wide default server. @throws ProviderNotFoundException if no provider is available
()
| 39 | * @throws ProviderNotFoundException if no provider is available |
| 40 | */ |
| 41 | public static ServerProvider provider() { |
| 42 | ServerProvider provider = ServerRegistry.getDefaultRegistry().provider(); |
| 43 | if (provider == null) { |
| 44 | throw new ProviderNotFoundException("No functional server found. " |
| 45 | + "Try adding a dependency on the grpc-netty or grpc-netty-shaded artifact"); |
| 46 | } |
| 47 | return provider; |
| 48 | } |
| 49 | |
| 50 | /** |
| 51 | * Whether this provider is available for use, taking the current environment into consideration. |