@Singleton public class ServiceLookup extends Object implements Serializable, Closeable
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
static ServiceLookup |
create()
Creates a new
ServiceLookup. |
protected <T> T |
createServiceClient(ServiceDescriptor serviceDescriptor)
Create a service client which proxies the calls to the service server.
|
RegistryCache |
getRegistryCache()
Gets the
RegistryCache of the RegistryDiscovererConfiguration. |
<T> T |
getServiceClient(Class<T> serviceInterface,
String serviceClass)
Gets a service client for the specified service interface.
|
<T> T |
getServiceClient(ServiceDescriptor serviceDescriptor)
Gets a service client for the specified service interface.
|
ServiceDescriptor |
getServiceDescriptor(String serviceClass)
Gets a
ServiceDescriptor for the specified service class. |
void |
registerService(ServiceDescriptor serviceDescriptor)
Register the specified
ServiceDescriptor with the registry servers. |
void |
registerServices(List<ServiceDescriptor> serviceDescriptors)
Register the specified
ServiceDescriptors with the registry servers. |
void |
unregisterService(ServiceDescriptor serviceDescriptor)
Register the specified
ServiceDescriptor with the registry-server. |
void |
unregisterServices(List<ServiceDescriptor> serviceDescriptors)
Register the specified
ServiceDescriptors with the registry-server. |
public static ServiceLookup create() throws com.airepublic.microverse.core.common.ServiceException
ServiceLookup.com.airepublic.microverse.core.common.ServiceExceptionpublic void registerServices(List<ServiceDescriptor> serviceDescriptors) throws com.airepublic.microverse.core.common.ServiceException
ServiceDescriptors with the registry servers.serviceDescriptors - the ServiceDescriptorscom.airepublic.microverse.core.common.ServiceExceptionpublic void registerService(ServiceDescriptor serviceDescriptor) throws com.airepublic.microverse.core.common.ServiceException
ServiceDescriptor with the registry servers.serviceDescriptors - the ServiceDescriptorcom.airepublic.microverse.core.common.ServiceExceptionpublic void unregisterServices(List<ServiceDescriptor> serviceDescriptors) throws com.airepublic.microverse.core.common.ServiceException
ServiceDescriptors with the registry-server.serviceDescriptors - the ServiceDescriptorscom.airepublic.microverse.core.common.ServiceExceptionpublic void unregisterService(ServiceDescriptor serviceDescriptor) throws com.airepublic.microverse.core.common.ServiceException
ServiceDescriptor with the registry-server.serviceDescriptors - the ServiceDescriptorcom.airepublic.microverse.core.common.ServiceExceptionpublic final ServiceDescriptor getServiceDescriptor(String serviceClass) throws com.airepublic.microverse.core.common.ServiceException
ServiceDescriptor for the specified service class.serviceClass - the service-classExceptioncom.airepublic.microverse.core.common.ServiceExceptionpublic final <T> T getServiceClient(Class<T> serviceInterface, String serviceClass) throws com.airepublic.microverse.core.common.ServiceException
serviceInterface - the service-interface providing the service functionalityserviceClass - the underlying service-class for the service-interfaceExceptioncom.airepublic.microverse.core.common.ServiceExceptionpublic final <T> T getServiceClient(ServiceDescriptor serviceDescriptor) throws com.airepublic.microverse.core.common.ServiceException
serviceInterface - the service-interface providing the service functionalityserviceClass - the underlying service-class for the service-interfaceExceptioncom.airepublic.microverse.core.common.ServiceExceptionprotected final <T> T createServiceClient(ServiceDescriptor serviceDescriptor) throws com.airepublic.microverse.core.common.ServiceException
serviceDescriptor - the ServiceDescriptorClassNotFoundExceptioncom.airepublic.microverse.core.common.ServiceExceptionpublic RegistryCache getRegistryCache()
RegistryCache of the RegistryDiscovererConfiguration.RegistryCachepublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2016. All rights reserved.