T
- the type of the service being loadedpublic class ServiceLoaderWithExceptionControl<T> extends Object implements Iterable<T>
ServiceLoader
that ignores exception encountered when loading services.
The ServiceLoader
class throws an error when it encounters a service that it cannot load. For
ServiceConnectorCreator
, this can be a common occurrence due to missing dependencies. For example, if an app isn't using
MongoDB, thus not declaring dependencies on relevant classes, will cause ServiceConnectorCreator
for MongoDB to fail. We
don't want to abandon other service connector creators in such cases.
Modifier and Type | Method and Description |
---|---|
Iterator<T> |
iterator() |
static <T> Iterable<T> |
load(Class<T> serviceType) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator