1. 延迟发布
hsf.publish.delayed配置标记是否延迟发布
public HSFApiProviderBean() {
//...
boolean delayPublish = this.config.getBoolean("hsf.publish.delayed");
this.metadata.setReadyToPublish(!delayPublish);
//...
}
在DelayPublishProtocolInterceptor中根据isReadyToPublish设置registryPub属性,后续会根据registryPub属性来判断是否发布服务
public class DelayPublishProtocolInterceptor extends AbstractDelegateProtocolInterceptor {
public DelayPublishProtocolInterceptor() {
}
public List<ServiceURL> export(ServiceMetadata serviceMetadata, InvocationHandler invocationHandler) {
if (!serviceMetadata.isReadyToPublish()) {
if (!serviceMetadata.getApplicationModel().isBiz()) {
return null;
}
serviceMetadata.setRegistryPub(false);
}
return this.protocol.export(serviceMetadata, invocationHandler);
}
}
2. ApplicationModelFactory的LOADER_2_APPLICATION
ApplicationModel在可以不同ClassLoader初始化的情况下初始化多次
3.ContainerInfo接口
根据JM.CONTAINER.ID参数获取容器支持信息
4.MachineGroupService接口
获取当前ip所在的机器组
5.RuleParser接口
使用xml解析服务相关不同的配置规则
配置文件