public class RegistrationManager extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
RegistrationManager.AfterServiceInstanceRegistryHandler |
| Modifier and Type | Field and Description |
|---|---|
static RegistrationManager |
INSTANCE |
static String |
PUBLISH_ADDRESS |
| Modifier and Type | Method and Description |
|---|---|
void |
addBasePath(Collection<BasePath> basePaths) |
void |
addEndpoint(String endpoint) |
void |
addSchema(String schemaId,
String content) |
void |
destroy() |
String |
getAppId() |
Microservice |
getMicroservice() |
MicroserviceInstance |
getMicroserviceInstance() |
static String |
getPublishAddress() |
static String |
getPublishAddress(String schema,
String address)
In the case that listening address configured as 0.0.0.0, the publish address will be determined
by the query result for the net interfaces.
|
static String |
getPublishHostName() |
SwaggerLoader |
getSwaggerLoader() |
String |
info() |
void |
init() |
void |
registerMicroserviceMapping(String microserviceName,
String version,
List<MicroserviceInstance> instances,
Class<?> schemaIntfCls)
Register a third party service if not registered before, and set it's instances into
StaticMicroserviceVersions.
|
void |
registerMicroserviceMappingByEndpoints(String microserviceName,
String version,
List<String> endpoints,
Class<?> schemaIntfCls) |
void |
run() |
void |
updateMicroserviceInstanceStatus(MicroserviceInstanceStatus status) |
public static final String PUBLISH_ADDRESS
public static RegistrationManager INSTANCE
public MicroserviceInstance getMicroserviceInstance()
public Microservice getMicroservice()
public String getAppId()
public SwaggerLoader getSwaggerLoader()
public void updateMicroserviceInstanceStatus(MicroserviceInstanceStatus status)
public void addEndpoint(String endpoint)
public void addBasePath(Collection<BasePath> basePaths)
public void destroy()
public void run()
public void init()
public void registerMicroserviceMapping(String microserviceName, String version, List<MicroserviceInstance> instances, Class<?> schemaIntfCls)
Register a third party service if not registered before, and set it's instances into StaticMicroserviceVersions.
The registered third party service has the same appId and environment as this microservice instance has,
and there is only one schema represented by schemaIntfCls, whose name is the same as microserviceName.
microserviceName - name of the 3rd party service, and this param also specifies the schemaIdversion - version of this 3rd party serviceinstances - the instances of this 3rd party service. Users only need to specify the endpoint information, other
necessary information will be generate and set in the implementation of this method.schemaIntfCls - the producer interface of the service. This interface is used to generate swagger schema and
can also be used for the proxy interface of RPC style invocation.public void registerMicroserviceMappingByEndpoints(String microserviceName, String version, List<String> endpoints, Class<?> schemaIntfCls)
endpoints - the endpoints of 3rd party service. Each of endpoints will be treated as a separated instance.
Format of the endpoints is the same as the endpoints that ServiceComb microservices register in service-center,
like rest://127.0.0.1:8080registerMicroserviceMapping(String, String, List, Class)public static String getPublishAddress()
public static String getPublishHostName()
public static String getPublishAddress(String schema, String address)
null if the param address is null.public String info()
Copyright © 2017–2021 The Apache Software Foundation. All rights reserved.