类 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 class
DefaultServiceInstance.Endpoint
-
构造器概要
构造器 构造器 说明 DefaultServiceInstance()
DefaultServiceInstance(String serviceName)
DefaultServiceInstance(String serviceName, String host, Integer port)
DefaultServiceInstance(DefaultServiceInstance other)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 DefaultServiceInstance
copy(DefaultServiceInstance.Endpoint endpoint)
boolean
equals(Object o)
String
getAddress()
Map<String,String>
getAllParams()
List<DefaultServiceInstance.Endpoint>
getEndpoints()
Map<String,String>
getExtendParams()
String
getHost()
The hostname of the registered service instance.Map<String,String>
getMetadata()
The key / value pair metadata associated with the service instance.int
getPort()
The port of the registered service instance.String
getRegistryCluster()
MetadataInfo
getServiceMetadata()
String
getServiceName()
The name of service that current instance belongs to.SortedMap<String,String>
getSortedMetadata()
int
hashCode()
boolean
isEnabled()
The enable status of the registered service instance.boolean
isHealthy()
The registered service instance is health or not.void
setEnabled(boolean enabled)
void
setHealthy(boolean healthy)
void
setHost(String host)
void
setMetadata(Map<String,String> metadata)
void
setPort(int port)
void
setRawAddress(String rawAddress)
void
setRegistryCluster(String registryCluster)
void
setServiceMetadata(MetadataInfo serviceMetadata)
void
setServiceName(String serviceName)
String
toFullString()
String
toString()
InstanceAddressURL
toURL()
-
从接口继承的方法 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()
从接口复制的说明:ServiceInstance
The name of service that current instance belongs to.- 指定者:
getServiceName
在接口中ServiceInstance
- 返回:
- non-null
-
getHost
public String getHost()
从接口复制的说明:ServiceInstance
The hostname of the registered service instance.- 指定者:
getHost
在接口中ServiceInstance
- 返回:
- non-null
-
setPort
public void setPort(int port)
-
getPort
public int getPort()
从接口复制的说明:ServiceInstance
The port of the registered service instance.- 指定者:
getPort
在接口中ServiceInstance
- 返回:
- the positive integer if present
-
getAddress
public String getAddress()
- 指定者:
getAddress
在接口中ServiceInstance
-
isEnabled
public boolean isEnabled()
从接口复制的说明:ServiceInstance
The 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()
从接口复制的说明:ServiceInstance
The 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()
从接口复制的说明:ServiceInstance
The 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()
-
-