DUBBO-19 <dubbo:protocol>增加register="false"属性,表示该协议不注册到注册中心。
git-svn-id: http://code.alibabatech.com/svn/dubbo/trunk@146 1a56cb94-b969-4eaa-88fa-be21384802f2
This commit is contained in:
parent
edfaee1e89
commit
94e72bead9
|
|
@ -100,6 +100,9 @@ public class ProtocolConfig extends AbstractConfig {
|
|||
// status检查
|
||||
private String status;
|
||||
|
||||
// 是否注册
|
||||
private Boolean register;
|
||||
|
||||
// 参数
|
||||
private Map<String, String> parameters;
|
||||
|
||||
|
|
@ -295,6 +298,14 @@ public class ProtocolConfig extends AbstractConfig {
|
|||
this.status = status;
|
||||
}
|
||||
|
||||
public Boolean getRegister() {
|
||||
return register;
|
||||
}
|
||||
|
||||
public void setRegister(Boolean register) {
|
||||
this.register = register;
|
||||
}
|
||||
|
||||
public String getTransporter() {
|
||||
return transporter;
|
||||
}
|
||||
|
|
@ -333,5 +344,5 @@ public class ProtocolConfig extends AbstractConfig {
|
|||
ExtensionLoader.getExtensionLoader(Protocol.class).getExtension(protocol).destroy();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -67,6 +67,9 @@ public class ServiceConfig<T> extends AbstractServiceConfig {
|
|||
|
||||
// 服务名称
|
||||
private String path;
|
||||
|
||||
// 是否注册
|
||||
private Boolean register;
|
||||
|
||||
// 方法配置
|
||||
private List<MethodConfig> methods;
|
||||
|
|
@ -432,7 +435,8 @@ public class ServiceConfig<T> extends AbstractServiceConfig {
|
|||
if (logger.isInfoEnabled()) {
|
||||
logger.info("Export dubbo service " + interfaceClass.getName() + " to url " + url);
|
||||
}
|
||||
if (registryURLs != null && registryURLs.size() > 0) {
|
||||
if (registryURLs != null && registryURLs.size() > 0
|
||||
&& url.getParameter("register", true)) {
|
||||
for (URL registryURL : registryURLs) {
|
||||
URL monitorUrl = loadMonitor(registryURL);
|
||||
if (monitorUrl != null) {
|
||||
|
|
@ -529,6 +533,17 @@ public class ServiceConfig<T> extends AbstractServiceConfig {
|
|||
this.path = path;
|
||||
}
|
||||
|
||||
public Boolean getRegister() {
|
||||
return register;
|
||||
}
|
||||
|
||||
public void setRegister(Boolean register) {
|
||||
this.register = register;
|
||||
if (Boolean.FALSE.equals(register)) {
|
||||
setRegistry(new RegistryConfig(RegistryConfig.NO_AVAILABLE));
|
||||
}
|
||||
}
|
||||
|
||||
public List<MethodConfig> getMethods() {
|
||||
return methods;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -652,6 +652,11 @@
|
|||
<xsd:documentation><![CDATA[ The protocol context path. ]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="register" type="xsd:string" use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[ The protocol can be register to registry. ]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
|
||||
|
|
@ -874,6 +879,11 @@
|
|||
<xsd:documentation><![CDATA[ The service path. ]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="register" type="xsd:string" use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[ The service can be register to registry. ]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="provider" type="xsd:string" use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[ Deprecated. Replace to protocol. ]]></xsd:documentation>
|
||||
|
|
|
|||
Loading…
Reference in New Issue