public class ServiceClientImpl extends Object implements ServiceClient
| Constructor and Description |
|---|
ServiceClientImpl(SofaRuntimeContext sofaRuntimeContext,
BindingConverterFactory bindingConverterFactory,
BindingAdapterFactory bindingAdapterFactory) |
| Modifier and Type | Method and Description |
|---|---|
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:
|
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 in interface 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 in interface 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 in interface 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 © 2021. All rights reserved.