类 DefaultServiceInstance
- java.lang.Object
-
- org.apache.dubbo.registry.client.DefaultServiceInstance
-
- 所有已实现的接口:
Serializable,ServiceInstance
public class DefaultServiceInstance extends Object implements ServiceInstance
The default implementation ofServiceInstance.- 从以下版本开始:
- 2.7.5
- 另请参阅:
- 序列化表格
-
-
嵌套类概要
嵌套类 修饰符和类型 类 说明 static classDefaultServiceInstance.Endpoint
-
构造器概要
构造器 构造器 说明 DefaultServiceInstance()DefaultServiceInstance(String serviceName)DefaultServiceInstance(String serviceName, String host, Integer port)DefaultServiceInstance(DefaultServiceInstance other)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 DefaultServiceInstancecopy(DefaultServiceInstance.Endpoint endpoint)booleanequals(Object o)StringgetAddress()Map<String,String>getAllParams()List<DefaultServiceInstance.Endpoint>getEndpoints()Map<String,String>getExtendParams()StringgetHost()The hostname of the registered service instance.Map<String,String>getMetadata()The key / value pair metadata associated with the service instance.intgetPort()The port of the registered service instance.StringgetRegistryCluster()MetadataInfogetServiceMetadata()StringgetServiceName()The name of service that current instance belongs to.SortedMap<String,String>getSortedMetadata()inthashCode()booleanisEnabled()The enable status of the registered service instance.booleanisHealthy()The registered service instance is health or not.voidsetEnabled(boolean enabled)voidsetHealthy(boolean healthy)voidsetHost(String host)voidsetMetadata(Map<String,String> metadata)voidsetPort(int port)voidsetRawAddress(String rawAddress)voidsetRegistryCluster(String registryCluster)voidsetServiceMetadata(MetadataInfo serviceMetadata)voidsetServiceName(String serviceName)StringtoFullString()StringtoString()InstanceAddressURLtoURL()-
从接口继承的方法 org.apache.dubbo.registry.client.ServiceInstance
getMetadata, getMetadata
-
-
-
-
构造器详细资料
-
DefaultServiceInstance
public DefaultServiceInstance()
-
DefaultServiceInstance
public DefaultServiceInstance(DefaultServiceInstance other)
-
DefaultServiceInstance
public DefaultServiceInstance(String serviceName, String host, Integer port)
-
DefaultServiceInstance
public DefaultServiceInstance(String serviceName)
-
-
方法详细资料
-
setRawAddress
public void setRawAddress(String rawAddress)
-
setServiceName
public void setServiceName(String serviceName)
-
setHost
public void setHost(String host)
-
getServiceName
public String getServiceName()
从接口复制的说明:ServiceInstanceThe name of service that current instance belongs to.- 指定者:
getServiceName在接口中ServiceInstance- 返回:
- non-null
-
getHost
public String getHost()
从接口复制的说明:ServiceInstanceThe hostname of the registered service instance.- 指定者:
getHost在接口中ServiceInstance- 返回:
- non-null
-
setPort
public void setPort(int port)
-
getPort
public int getPort()
从接口复制的说明:ServiceInstanceThe port of the registered service instance.- 指定者:
getPort在接口中ServiceInstance- 返回:
- the positive integer if present
-
getAddress
public String getAddress()
- 指定者:
getAddress在接口中ServiceInstance
-
isEnabled
public boolean isEnabled()
从接口复制的说明:ServiceInstanceThe enable status of the registered service instance.- 指定者:
isEnabled在接口中ServiceInstance- 返回:
- if
true, indicates current instance is enabled, or disable, the client should remove this one. The default value istrue
-
setEnabled
public void setEnabled(boolean enabled)
-
isHealthy
public boolean isHealthy()
从接口复制的说明:ServiceInstanceThe registered service instance is health or not.- 指定者:
isHealthy在接口中ServiceInstance- 返回:
- if
true, indicates current instance is enabled, or disable, the client may ignore this one. The default value istrue
-
setHealthy
public void setHealthy(boolean healthy)
-
getMetadata
public Map<String,String> getMetadata()
从接口复制的说明:ServiceInstanceThe key / value pair metadata associated with the service instance.- 指定者:
getMetadata在接口中ServiceInstance- 返回:
- non-null, mutable and unsorted
Map
-
getSortedMetadata
public SortedMap<String,String> getSortedMetadata()
- 指定者:
getSortedMetadata在接口中ServiceInstance
-
getRegistryCluster
public String getRegistryCluster()
- 指定者:
getRegistryCluster在接口中ServiceInstance
-
setRegistryCluster
public void setRegistryCluster(String registryCluster)
- 指定者:
setRegistryCluster在接口中ServiceInstance
-
getExtendParams
public Map<String,String> getExtendParams()
- 指定者:
getExtendParams在接口中ServiceInstance
-
getEndpoints
public List<DefaultServiceInstance.Endpoint> getEndpoints()
-
copy
public DefaultServiceInstance copy(DefaultServiceInstance.Endpoint endpoint)
-
getAllParams
public Map<String,String> getAllParams()
- 指定者:
getAllParams在接口中ServiceInstance
-
getServiceMetadata
public MetadataInfo getServiceMetadata()
-
setServiceMetadata
public void setServiceMetadata(MetadataInfo serviceMetadata)
-
toURL
public InstanceAddressURL toURL()
- 指定者:
toURL在接口中ServiceInstance
-
equals
public boolean equals(Object o)
- 指定者:
equals在接口中ServiceInstance- 覆盖:
equals在类中Object- 参数:
o- anotherServiceInstance- 返回:
- if equals , return
true, orfalse
-
hashCode
public int hashCode()
- 指定者:
hashCode在接口中ServiceInstance- 覆盖:
hashCode在类中Object- 返回:
- the hash code of current instance.
-
toFullString
public String toFullString()
-
-