public class ServiceLoader extends Object
| Constructor and Description |
|---|
ServiceLoader(ServiceContext serviceContext) |
| Modifier and Type | Method and Description |
|---|---|
Iterable<String> |
listServiceNames() |
<T> T |
load(ClassLoader classLoader,
String serviceName,
Class<T> serviceInterface)
Load service.
|
<T> T |
load(String serviceName,
Class<T> serviceInterface)
Load service.
|
ServiceFactory |
loadServiceFactory(ClassLoader classLoader,
String serviceName)
Load service factory.
|
public ServiceLoader(ServiceContext serviceContext)
public Iterable<String> listServiceNames() throws IOException
IOExceptionpublic <T> T load(String serviceName, Class<T> serviceInterface)
T - the type of service interface.serviceName - the service name.serviceInterface - the service interface.public <T> T load(ClassLoader classLoader, String serviceName, Class<T> serviceInterface)
T - the type of service interface.classLoader - the class loader used for loading service class.serviceName - the service name.serviceInterface - the service interface.public ServiceFactory loadServiceFactory(ClassLoader classLoader, String serviceName)
classLoader - the class loader used for loading service factory.serviceName - the service name.