public class TopiaServiceSupportImpl extends Object implements TopiaServiceSupport
TopiaServiceSupport implementation.
It will look in TopiaApplicationContext.getConfiguration()
to find services declarations and associated configuration. All of those properties match
the topia.service.* prefix.
A service is declared by giving it a name and the implementation class FQN by following the
pattern.
topia.service.myServiceName=com.my.company.my.app.MyServiceImplHere,
myServiceName is the name of the service, you can choose any String. Value
must be the FQN of class that provide an empty constructor and implements
TopiaService.
To passes configuration to a service, you can do as follow:
topia.service.myServiceName=com.my.company.my.app.MyServiceImpl topia.service.myServiceName.myConfigurationDirective=myConfigurationValueWhen
TopiaService.initTopiaService(org.nuiton.topia.persistence.TopiaApplicationContext, java.util.Map) will be
called, the given map will contain a single entry which key is "myConfigurationDirective" and value
is "myConfigurationValue".| Modifier and Type | Field and Description |
|---|---|
protected com.google.common.collect.ImmutableMap<String,TopiaService> |
services |
| Constructor and Description |
|---|
TopiaServiceSupportImpl() |
| Modifier and Type | Method and Description |
|---|---|
Map<String,TopiaService> |
getServices() |
<T extends TopiaService> |
getServices(Class<T> interfaceService) |
void |
initServices(TopiaApplicationContext topiaApplicationContext) |
protected com.google.common.collect.ImmutableMap<String,TopiaService> services
public void initServices(TopiaApplicationContext topiaApplicationContext)
public Map<String,TopiaService> getServices()
getServices in interface TopiaServiceSupportpublic <T extends TopiaService> Map<String,T> getServices(Class<T> interfaceService)
getServices in interface TopiaServiceSupportT - type of serviceinterfaceService - FIXMETopiaServiceSupport.getServices() but returns only services that implements
given contract (or is instance of given class).Copyright © 2004–2016 CodeLutin. All rights reserved.