Class DefaultServiceLocator
- java.lang.Object
-
- org.fedoraproject.xmvn.locator.impl.DefaultServiceLocator
-
- All Implemented Interfaces:
ServiceLocator
public class DefaultServiceLocator extends java.lang.Object implements ServiceLocator
Service locator for XMvn.WARNING: This class is part of internal implementation of XMvn and it is marked as public only for technical reasons. This class is not part of XMvn API. Client code using XMvn should not reference it directly.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.Class<?>,java.lang.Class<?>>knownServicesprivate java.util.Map<java.lang.Class<?>,java.lang.Object>runningServices
-
Constructor Summary
Constructors Constructor Description DefaultServiceLocator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> voidaddService(java.lang.Class<T> role, java.lang.Class<? extends T> serviceProvider)<T> TgetService(java.lang.Class<T> role)Load an instance of XMvn service.private java.lang.ObjectloadService(java.lang.Class<?> role)
-
-
-
Method Detail
-
addService
public <T> void addService(java.lang.Class<T> role, java.lang.Class<? extends T> serviceProvider)
-
loadService
private java.lang.Object loadService(java.lang.Class<?> role)
-
getService
public <T> T getService(java.lang.Class<T> role)
Description copied from interface:ServiceLocatorLoad an instance of XMvn service.- Specified by:
getServicein interfaceServiceLocator- Parameters:
role- interface class identifying requested service- Returns:
- instance of XMvn service, never
null.
-
-