public class TopiaServiceSupportImpl extends Object implements TopiaServiceSupport
| Modifier and Type | Field and Description |
|---|---|
protected AbstractTopiaApplicationContext |
applicationContext |
protected com.google.common.collect.ImmutableMap<String,TopiaService> |
services |
| Constructor and Description |
|---|
TopiaServiceSupportImpl(AbstractTopiaApplicationContext applicationContext) |
| Modifier and Type | Method and Description |
|---|---|
protected String |
getProperExceptionMessage(Throwable eee) |
<E extends TopiaService> |
getService(Class<E> interfaceService)
Return the service.
|
protected <E extends TopiaService> |
getServiceName(Class<E> interfaceService)
Retrieve service name using SERVICE_NAME static field on service
interface.
|
Map<String,TopiaService> |
getServices()
The list of registered services.
|
void |
init() |
protected com.google.common.collect.ImmutableMap<String,TopiaService> |
loadServices(com.google.common.collect.ImmutableMap<String,String> configuration) |
protected void |
postInitServices(Map<String,TopiaService> services) |
protected void |
preInitServices(Map<String,TopiaService> services) |
<E extends TopiaService> |
serviceEnabled(Class<E> interfaceService)
Return true if specific service is available.
|
protected com.google.common.collect.ImmutableMap<String,TopiaService> services
protected AbstractTopiaApplicationContext applicationContext
public TopiaServiceSupportImpl(AbstractTopiaApplicationContext applicationContext)
public void init()
protected void preInitServices(Map<String,TopiaService> services)
protected void postInitServices(Map<String,TopiaService> services)
protected <E extends TopiaService> String getServiceName(Class<E> interfaceService) throws IllegalAccessException, NoSuchFieldException
E - type of the service that extends TopiaServiceinterfaceService - class of the serviceIllegalAccessException - if field SERVICE_NAME can't be accessedNoSuchFieldException - if no field SERVICE_NAME is definedprotected com.google.common.collect.ImmutableMap<String,TopiaService> loadServices(com.google.common.collect.ImmutableMap<String,String> configuration)
public <E extends TopiaService> boolean serviceEnabled(Class<E> interfaceService)
TopiaServiceSupportserviceEnabled in interface TopiaServiceSupportinterfaceService - fqn of the servicepublic <E extends TopiaService> E getService(Class<E> interfaceService) throws TopiaNotFoundException
TopiaServiceSupportgetService in interface TopiaServiceSupportinterfaceService - class of the serviceTopiaNotFoundException - if service can't be retrievedpublic Map<String,TopiaService> getServices()
TopiaServiceSupportgetServices in interface TopiaServiceSupportCopyright © 2004–2013 CodeLutin. All rights reserved.