Package jetbrains.buildServer
Interface ServiceLocator
-
- All Known Subinterfaces:
BuildServerEx,ExtensionHolder,SBuildServer,ServerExtensionHolder,SpringContext
- All Known Implementing Classes:
BaseServerTestCase.TestBuildServerImpl,BuildServerCreator,BuildServerImpl,BuildServerServiceLocator,ExtendableServiceLocator,ServiceLocatorImpl,SpringSubContainerFactoryImpl.SpringContextImpl
public interface ServiceLocatorLocates services by their type
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> TfindSingletonService(Class<T> serviceClass)Searches for singleton service of specified type<T> Collection<T>getServices(Class<T> serviceClass)Searches for all bean instances of type<T> TgetSingletonService(Class<T> serviceClass)Searches for singleton service of specified type
-
-
-
Method Detail
-
getSingletonService
@NotNull <T> T getSingletonService(@NotNull Class<T> serviceClass) throws ServiceNotFoundExceptionSearches for singleton service of specified type- Parameters:
serviceClass- type of the service- Returns:
- found service, never null
- Throws:
ServiceNotFoundException- if specified service was not found or if more than one service found
-
findSingletonService
@Nullable <T> T findSingletonService(@NotNull Class<T> serviceClass)Searches for singleton service of specified type- Parameters:
serviceClass- type of the service- Returns:
- found service or null if there's no such service
- Throws:
RuntimeException- if more than one service found
-
getServices
@NotNull <T> Collection<T> getServices(@NotNull Class<T> serviceClass)
Searches for all bean instances of type- Parameters:
serviceClass- - type to search- Returns:
- collection of classes that implements T
-
-