public class ServiceClientImpl extends Object implements ServiceClient
| 构造器和说明 |
|---|
ServiceClientImpl(SofaRuntimeContext sofaRuntimeContext,
BindingConverterFactory bindingConverterFactory,
BindingAdapterFactory bindingAdapterFactory) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
removeService(Class<?> interfaceClass,
int millisecondsToDelay)
Equivalent to
ServiceClient.removeService(Class, String, int) except that the uniqueId parameter is
default to an empty string. |
void |
removeService(Class<?> interfaceClass,
String uniqueId,
int millisecondsToDelay)
Remove a service component from SOFA runtime.
|
void |
service(ServiceParam serviceParam)
Creating a SOFA service, sample usage:
ServiceParam serviceParam = new ServiceParam();
SampleService sampleService = new SampleServiceImpl();
serviceParam.setInstance(sampleService);
serviceClient.service(serviceParam);
|
public ServiceClientImpl(SofaRuntimeContext sofaRuntimeContext, BindingConverterFactory bindingConverterFactory, BindingAdapterFactory bindingAdapterFactory)
public void service(ServiceParam serviceParam)
ServiceClientServiceParam serviceParam = new ServiceParam(); SampleService sampleService = new SampleServiceImpl(); serviceParam.setInstance(sampleService); serviceClient.service(serviceParam);
service 在接口中 ServiceClientserviceParam - The service parameter used to create a SOFA service.public void removeService(Class<?> interfaceClass, int millisecondsToDelay)
ServiceClientServiceClient.removeService(Class, String, int) except that the uniqueId parameter is
default to an empty string.removeService 在接口中 ServiceClientinterfaceClass - the interface type to be removedmillisecondsToDelay - after the specified time, then service would be removedpublic void removeService(Class<?> interfaceClass, String uniqueId, int millisecondsToDelay)
ServiceClientremoveService 在接口中 ServiceClientinterfaceClass - the interface type of the service componentuniqueId - the uniqueId of the service componentmillisecondsToDelay - milliseconds to delay while remove a service component, only non-negative value is
accepted. it is useful when remove a RPC service component since remove registry info from config server is a
async-procedureCopyright © 2018 Pivotal Software, Inc.. All rights reserved.