| Modifier and Type | Class and Description |
|---|---|
| public static interface | ServiceProviders.PriorityAccessor<T>
An interface that allows us to get priority information about a provider. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private static <T> T | |
| pack-priv static <T> Iterable | getCandidatesViaHardCoded(Class<T> klass, Iterable<Class<?>> hardcoded)
Load providers from a hard-coded list. |
| public static <T> Iterable | getCandidatesViaServiceLoader(Class<T> klass, ClassLoader cl)
Loads service providers for the |
| pack-priv static boolean | |
| public static <T> T | load(Class<T> klass, Iterable<Class<?>> hardcoded, ClassLoader cl, ServiceProviders.
If this is not Android, returns the highest priority implementation of the class via
|
| public static <T> List | loadAll(Class<T> klass, Iterable<Class<?>> hardcoded, ClassLoader cl, final ServiceProviders.
If this is not Android, returns all available implementations discovered via
|
| ServiceProviders | back to summary |
|---|---|
| private ServiceProviders() | |
| createForHardCoded | back to summary |
|---|---|
| private static <T> T createForHardCoded(Class<T> klass, Class<?> rawClass) | |
| getCandidatesViaHardCoded | back to summary |
|---|---|
| pack-priv static <T> Iterable Load providers from a hard-coded list. This avoids using getResource(), which has performance problems on Android (see https://github.com/grpc/grpc-java/issues/2037).
| |
| getCandidatesViaServiceLoader | back to summary |
|---|---|
| public static <T> Iterable Loads service providers for the
| |
| isAndroid | back to summary |
|---|---|
| pack-priv static boolean isAndroid(ClassLoader cl) Returns true if the | |
| load | back to summary |
|---|---|
| public static <T> T load(Class<T> klass, Iterable<Class<?>> hardcoded, ClassLoader cl, ServiceProviders. If this is not Android, returns the highest priority implementation of the class via
| |
| loadAll | back to summary |
|---|---|
| public static <T> List If this is not Android, returns all available implementations discovered via
| |
| Modifier and Type | Method and Description |
|---|---|
| public int | getPriority(T provider)
A priority, from 0 to 10 that this provider should be used, taking the current environment into consideration. |
| public boolean | isAvailable(T provider)
Checks this provider is available for use, taking the current environment into consideration. |
| getPriority | back to summary |
|---|---|
| public int getPriority(T provider) A priority, from 0 to 10 that this provider should be used, taking the current environment into consideration. 5 should be considered the default, and then tweaked based on environment detection. A priority of 0 does not imply that the provider wouldn't work; just that it should be last in line. | |
| isAvailable | back to summary |
|---|---|
| public boolean isAvailable(T provider) Checks this provider is available for use, taking the current environment into consideration.
If | |