public class DefaultServiceProvider extends Object implements ServiceProvider
A service provider is used by the framework to be able to change the local services are found
For example, you may want to use a simple service provider for testing purpose to avoid loading the nuxeo runtime framework to register services.
Modifier and Type | Class and Description |
---|---|
static class |
DefaultServiceProvider.ServiceRef |
Modifier and Type | Field and Description |
---|---|
protected Map<Class<?>,DefaultServiceProvider.ServiceRef> |
registry |
Constructor and Description |
---|
DefaultServiceProvider() |
Modifier and Type | Method and Description |
---|---|
static ServiceProvider |
getProvider() |
<T> T |
getService(Class<T> serviceClass)
Gets the service instance given its API class.
|
<T> void |
registerService(Class<T> serviceClass,
Class<?> implClass) |
<T> void |
registerService(Class<T> serviceClass,
Object impl) |
static void |
setProvider(ServiceProvider provider) |
protected final Map<Class<?>,DefaultServiceProvider.ServiceRef> registry
public DefaultServiceProvider()
public static void setProvider(ServiceProvider provider)
public static ServiceProvider getProvider()
public <T> T getService(Class<T> serviceClass)
ServiceProvider
getService
in interface ServiceProvider
public <T> void registerService(Class<T> serviceClass, Class<?> implClass)
public <T> void registerService(Class<T> serviceClass, Object impl)
Copyright © 2015 Nuxeo SA. All rights reserved.