@Singleton public class ServiceRegistryLookup extends Object implements Serializable, Closeable
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
static ServiceRegistryLookup |
create()
Creates a new
ServiceRegistryLookup for the specified
RegistryDescriptor. |
protected <T> T |
createServiceClient(ServiceDescriptor serviceDescriptor)
Create a service client which proxies the calls to the service server.
|
RegistryCache |
getRegistryCache() |
<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 |
init() |
void |
registerService(ServiceDescriptor serviceDescriptor)
Register the specified
ServiceDescriptor with the registry
server. |
void |
registerServices(List<ServiceDescriptor> serviceDescriptors)
Register the specified
ServiceDescriptors with the registry
server. |
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. |
@PostConstruct public void init()
public static ServiceRegistryLookup create() throws ServiceException
ServiceRegistryLookup for the specified
RegistryDescriptor.registryDescriptor - the RegistryDescriptorServiceExceptionpublic void registerServices(List<ServiceDescriptor> serviceDescriptors) throws ServiceException
ServiceDescriptors with the registry
server.serviceDescriptors - the ServiceDescriptorsServiceExceptionpublic void registerService(ServiceDescriptor serviceDescriptor) throws ServiceException
ServiceDescriptor with the registry
server.serviceDescriptors - the ServiceDescriptorServiceExceptionpublic void unregisterServices(List<ServiceDescriptor> serviceDescriptors) throws ServiceException
ServiceDescriptors with the
registry-server.serviceDescriptors - the ServiceDescriptorsServiceExceptionpublic void unregisterService(ServiceDescriptor serviceDescriptor) throws ServiceException
ServiceDescriptor with the
registry-server.serviceDescriptors - the ServiceDescriptorServiceExceptionpublic final ServiceDescriptor getServiceDescriptor(String serviceClass) throws ServiceException
ServiceDescriptor for the specified service class.serviceClass - the service-classExceptionServiceExceptionpublic final <T> T getServiceClient(Class<T> serviceInterface, String serviceClass) throws ServiceException
serviceInterface - the service-interface providing the service
functionalityserviceClass - the underlying service-class for the
service-interfaceExceptionServiceExceptionpublic final <T> T getServiceClient(ServiceDescriptor serviceDescriptor) throws ServiceException
serviceInterface - the service-interface providing the service
functionalityserviceClass - the underlying service-class for the
service-interfaceExceptionServiceExceptionprotected final <T> T createServiceClient(ServiceDescriptor serviceDescriptor) throws ServiceException
serviceDescriptor - the ServiceDescriptorClassNotFoundExceptionServiceExceptionpublic RegistryCache getRegistryCache()
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2016. All rights reserved.