public class SPIServiceRegistry extends Object implements ServiceRegistry
ServiceRegistry
that uses standard ServiceLoader
to get
the providersConstructor and Description |
---|
SPIServiceRegistry() |
Modifier and Type | Method and Description |
---|---|
<T> Collection<T> |
lookupProviders(Class<T> providerClass)
Searches for implementations of a particular service class
|
<T> Collection<T> |
lookupProviders(Class<T> providerClass,
ClassLoader classLoader)
Searches for implementations of a particular service class
using the given class loader.
|
public <T> Collection<T> lookupProviders(Class<T> providerClass, ClassLoader classLoader)
lookupProviders
in interface ServiceRegistry
providerClass
- a Class
object indicating the
class or interface of the service providers being detected.classLoader
- the class loader to be used to load
provider-configuration files and instantiate provider classes,
or null
if the system class loader (or, failing that
the bootstrap class loader) is to be used.Collection
that yields provider objects
for the given service, in some arbitrary order.public <T> Collection<T> lookupProviders(Class<T> providerClass)
lookupProviders
in interface ServiceRegistry
providerClass
- a Class
object indicating the
class or interface of the service providers being detected.Collection
that yields provider objects for the given service, in some arbitrary order.Copyright © 2003–2015 MuleSoft, Inc.. All rights reserved.