Package org.eclipse.aether.spi.locator
Interface ServiceLocator
-
- All Known Implementing Classes:
DefaultServiceLocator
public interface ServiceLocatorA simple infrastructure to programmatically wire the various components of the repository system together when it is used outside of an IoC container. Once a concrete implementation of a service locator has been setup, clients could useRepositorySystem repoSystem = serviceLocator.getService( RepositorySystem.class );
to acquire the repository system. Components that implementServicewill be given an opportunity to acquire further components from the locator, thereby allowing to create the complete object graph of the repository system.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> TgetService(java.lang.Class<T> type)Gets an instance of the specified service.<T> java.util.List<T>getServices(java.lang.Class<T> type)Gets all available instances of the specified service.
-
-
-
Method Detail
-
getService
<T> T getService(java.lang.Class<T> type)
Gets an instance of the specified service.- Type Parameters:
T- The service type.- Parameters:
type- The interface describing the service, must not benull.- Returns:
- The service instance or
nullif the service could not be located/initialized.
-
getServices
<T> java.util.List<T> getServices(java.lang.Class<T> type)
Gets all available instances of the specified service.- Type Parameters:
T- The service type.- Parameters:
type- The interface describing the service, must not benull.- Returns:
- The (read-only) list of available service instances, never
null.
-
-