Package org.nuxeo.runtime.api
Class DefaultServiceProvider
- java.lang.Object
-
- org.nuxeo.runtime.api.DefaultServiceProvider
-
- All Implemented Interfaces:
ServiceProvider
public class DefaultServiceProvider extends Object implements ServiceProvider
A service provider.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.
- Author:
- Bogdan Stefanescu
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DefaultServiceProvider.ServiceRef
-
Field Summary
Fields Modifier and Type Field Description protected Map<Class<?>,DefaultServiceProvider.ServiceRef>
registry
-
Constructor Summary
Constructors Constructor Description DefaultServiceProvider()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method 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)
-
-
-
Field Detail
-
registry
protected final Map<Class<?>,DefaultServiceProvider.ServiceRef> registry
-
-
Method Detail
-
setProvider
public static void setProvider(ServiceProvider provider)
-
getProvider
public static ServiceProvider getProvider()
-
getService
public <T> T getService(Class<T> serviceClass)
Description copied from interface:ServiceProvider
Gets the service instance given its API class.- Specified by:
getService
in interfaceServiceProvider
-
-