public class ServiceFactory
extends Object
In the example below SqlService binded to the SqlServiceImpl, ServiceProxyWeb is used if network.appserverurl is not null, otherwise ServiceProxyLocal:
com.toolsverse.etl.sql.service.SqlService=com.toolsverse.etl.sql.service.SqlServiceImpl com.toolsverse.etl.sql.service.SqlService.proxy.client=@decode(network.appserverurl,@null,@com.toolsverse.service.ServiceProxyLocal,@com.toolsverse.service.web.ServiceProxyWeb
Modifier and Type | Field and Description |
---|---|
static String |
GLOBAL_SERVICE_PROXY_PROP
GLOBAL SERVICE PROXY property.
|
protected static String |
IMPL
The default IMPL suffix
|
protected static String |
PROXY_TYPE
PROXY_TYPE suffix.
|
Constructor and Description |
---|
ServiceFactory() |
Modifier and Type | Method and Description |
---|---|
static <T extends Service> |
getService(Class<T> serviceClass)
Gets the service implementation using given serviceClass.
|
static <T extends Service> |
getService(Class<T> serviceClass,
Class<T> impl,
String proxyClassName)
Gets the service implementation using given service class, default implementation and a service proxy class name.
|
static <T extends Service> |
getService(Class<T> serviceClass,
String proxyClassName)
Gets the service implementation using given service class and service proxy class name.
|
static ServiceProxy |
getServiceProxy(String proxyClassName,
Class<? extends Service> serviceClass,
Class<? extends Service> impl)
Gets the service proxy using given proxy class name, service class and default service implementation.
|
public static final String GLOBAL_SERVICE_PROXY_PROP
protected static final String IMPL
protected static final String PROXY_TYPE
public static <T extends Service> T getService(Class<T> serviceClass) throws Exception
serviceClass
- the service classException
- in case of any errorpublic static <T extends Service> T getService(Class<T> serviceClass, Class<T> impl, String proxyClassName) throws Exception
serviceClass
- the service classimpl
- the default implementation class nameproxyClassName
- the service proxy class nameException
- in case of any errorpublic static <T extends Service> T getService(Class<T> serviceClass, String proxyClassName) throws Exception
serviceClass
- the service classproxyClassName
- the service proxy class nameException
- in case of any errorpublic static ServiceProxy getServiceProxy(String proxyClassName, Class<? extends Service> serviceClass, Class<? extends Service> impl) throws Exception
proxyClassName
- the proxy class nameserviceClass
- the service classimpl
- the default implementationException
- in case of any errorCopyright © 2010-2020 Toolsverse. All Rights Reserved.