InstancePreRegisteredEvent and InstanceRegisteredEvent modify Registration info

pull/609/head
小魏,小魏,我们要去哪里呀 2 years ago committed by GitHub
parent e0086e44cc
commit bf73735a31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -19,7 +19,6 @@
package com.tencent.cloud.polaris.registry; package com.tencent.cloud.polaris.registry;
import java.net.URI; import java.net.URI;
import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@ -37,7 +36,7 @@ import org.springframework.util.CollectionUtils;
/** /**
* Registration object of Polaris. * Registration object of Polaris.
* *
* @author Haotian Zhang, Andrew Shan, Jie Cheng, Palmer.Xu * @author Haotian Zhang, Andrew Shan, Jie Cheng, Palmer.Xu, changjin wei()
*/ */
public class PolarisRegistration implements Registration { public class PolarisRegistration implements Registration {
@ -55,7 +54,7 @@ public class PolarisRegistration implements Registration {
private Map<String, String> metadata; private Map<String, String> metadata;
private final String host; private String host;
public PolarisRegistration( public PolarisRegistration(
PolarisDiscoveryProperties polarisDiscoveryProperties, PolarisDiscoveryProperties polarisDiscoveryProperties,
@ -79,6 +78,10 @@ public class PolarisRegistration implements Registration {
return host; return host;
} }
public void setHost(String host) {
this.host = host;
}
@Override @Override
public int getPort() { public int getPort() {
return polarisDiscoveryProperties.getPort(); return polarisDiscoveryProperties.getPort();
@ -109,7 +112,7 @@ public class PolarisRegistration implements Registration {
instanceMetadata.putAll(staticMetadataManager.getMergedStaticMetadata()); instanceMetadata.putAll(staticMetadataManager.getMergedStaticMetadata());
this.metadata = Collections.unmodifiableMap(instanceMetadata); this.metadata = instanceMetadata;
} }
return metadata; return metadata;
} }

Loading…
Cancel
Save