类 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
- 另请参阅:
- 序列化表格
-
-
构造器概要
构造器 构造器 说明 DefaultServiceInstance()DefaultServiceInstance(String serviceName, String host, Integer port)DefaultServiceInstance(String id, String serviceName, String host, Integer port)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 booleanequals(Object o)StringgetAddress()Map<String,String>getAllParams()Map<String,String>getExtendParams()StringgetHost()The hostname of the registered service instance.StringgetId()The id of the registered service instance.Map<String,String>getMetadata()The key / value pair metadata associated with the service instance.IntegergetPort()The port of the registered service instance.MetadataInfogetServiceMetadata()StringgetServiceName()The name of service that current instance belongs to.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)voidsetId(String id)voidsetMetadata(Map<String,String> metadata)voidsetPort(Integer port)voidsetServiceMetadata(MetadataInfo serviceMetadata)voidsetServiceName(String serviceName)StringtoString()InstanceAddressURLtoURL()-
从接口继承的方法 org.apache.dubbo.registry.client.ServiceInstance
getMetadata, getMetadata
-
-
-
-
方法详细资料
-
setId
public void setId(String id)
-
setServiceName
public void setServiceName(String serviceName)
-
setHost
public void setHost(String host)
-
getId
public String getId()
从接口复制的说明:ServiceInstanceThe id of the registered service instance.- 指定者:
getId在接口中ServiceInstance- 返回:
- nullable
-
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(Integer port)
-
getPort
public Integer 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
-
getExtendParams
public Map<String,String> getExtendParams()
- 指定者:
getExtendParams在接口中ServiceInstance
-
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.
-
-