com.alibaba.csp.ahas.sentinel.acm.SentinelSdkInitServiceManager Maven / Gradle / Ivy
package com.alibaba.csp.ahas.sentinel.acm;
import com.taobao.csp.ahas.service.api.client.ClientInfoService;
import com.taobao.csp.ahas.service.api.constant.AppConstants;
import com.taobao.csp.ahas.service.component.AgwComponentType;
/**
* @Author: yunyin
* @Date: 2020/8/24
*/
public class SentinelSdkInitServiceManager {
public static final String type;
static {
type = System.getProperty(AppConstants.AHAS_AGW_COMPONENT_TYPE, String.valueOf(AgwComponentType.PUBLIC_CLOUD.getType()));
}
public static SentinelSdkInitService getInitService(ClientInfoService clientInfoService){
SentinelSdkInitService service;
if(String.valueOf(AgwComponentType.PRIVATE_CLOUD.getType()).equals(type)){
service = new ApsaraSdkInitService(clientInfoService);
}else{
service = new DefaultSdkInitService(clientInfoService);
}
return service;
}
}