Package org.rundeck.app.spi
Class SimpleServiceProvider
- java.lang.Object
-
- org.rundeck.app.spi.SimpleServiceProvider
-
- All Implemented Interfaces:
Services
,ServicesProvider
public class SimpleServiceProvider extends java.lang.Object implements Services, ServicesProvider
A simple implementation of Services and ServicesProvider that returns services from the map supplied during construction.
-
-
Constructor Summary
Constructors Constructor Description SimpleServiceProvider(java.util.Map<java.lang.Class<? extends AppService>,java.lang.Object> services)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends AppService>
TgetService(java.lang.Class<T> type)
Returns the service of the given type if availableServices
getServices()
boolean
hasService(java.lang.Class<? extends AppService> type)
-
-
-
Constructor Detail
-
SimpleServiceProvider
public SimpleServiceProvider(java.util.Map<java.lang.Class<? extends AppService>,java.lang.Object> services)
- Parameters:
services
- Map of service types to service instances
-
-
Method Detail
-
hasService
public boolean hasService(java.lang.Class<? extends AppService> type)
- Specified by:
hasService
in interfaceServices
- Parameters:
type
- service type- Returns:
- true if the service type is available
-
getService
public <T extends AppService> T getService(java.lang.Class<T> type)
Description copied from interface:Services
Returns the service of the given type if available- Specified by:
getService
in interfaceServices
- Type Parameters:
T
- service tye- Parameters:
type
- type class- Returns:
- service
-
getServices
public Services getServices()
- Specified by:
getServices
in interfaceServicesProvider
-
-