类 SDKContext
java.lang.Object
com.tencent.polaris.api.control.Destroyable
com.tencent.polaris.client.api.SDKContext
- 所有已实现的接口:
InitContext,java.io.Closeable,java.lang.AutoCloseable
public class SDKContext extends Destroyable implements InitContext, java.lang.AutoCloseable, java.io.Closeable
SDK初始化相关的上下文信息
- 作者:
- andrewshan, Haotian Zhang
-
构造器概要
构造器 构造器 说明 SDKContext(com.tencent.polaris.api.config.Configuration configuration, Manager plugins, ValueContext valueContext)构造器 -
方法概要
修饰符和类型 方法 说明 voidclose()com.tencent.polaris.api.config.ConfigurationgetConfig()ExtensionsgetExtensions()SuppliergetPlugins()java.util.Collection<ServerServiceInfo>getServerServices()ValueContextgetValueContext()voidinit()static SDKContextinitContext()通过默认配置初始化SDKContextstatic SDKContextinitContextByConfig(com.tencent.polaris.api.config.Configuration config)通过配置对象初始化SDK上下文static java.lang.StringparseHost(com.tencent.polaris.api.config.Configuration configuration)static java.lang.StringparseServerConnectorProtocol(com.tencent.polaris.api.config.Configuration configuration)Get protocol of server connector, such as:DefaultPlugins.SERVER_CONNECTOR_COMPOSITEDefaultPlugins.SERVER_CONNECTOR_GRPCDefaultPlugins.SERVER_CONNECTOR_CONSULvoidregisterDestroyHook(Destroyable destroyable)从类继承的方法 com.tencent.polaris.api.control.Destroyable
destroy, getName, isDestroyed从类继承的方法 java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
构造器详细资料
-
SDKContext
public SDKContext(com.tencent.polaris.api.config.Configuration configuration, Manager plugins, ValueContext valueContext)构造器- 参数:
configuration- 配置plugins- 插件工厂valueContext- 上下文
-
-
方法详细资料
-
initContext
通过默认配置初始化SDKContext- 返回:
- SDKContext对象
- 抛出:
PolarisException- 初始化异常
-
initContextByConfig
public static SDKContext initContextByConfig(com.tencent.polaris.api.config.Configuration config) throws PolarisException通过配置对象初始化SDK上下文- 参数:
config- 配置对象- 返回:
- SDK上下文
- 抛出:
PolarisException- 初始化过程的异常
-
parseHost
public static java.lang.String parseHost(com.tencent.polaris.api.config.Configuration configuration) -
parseServerConnectorProtocol
public static java.lang.String parseServerConnectorProtocol(com.tencent.polaris.api.config.Configuration configuration)Get protocol of server connector, such as:DefaultPlugins.SERVER_CONNECTOR_COMPOSITEDefaultPlugins.SERVER_CONNECTOR_GRPCDefaultPlugins.SERVER_CONNECTOR_CONSUL
- 参数:
configuration-- 返回:
-
init
- 抛出:
PolarisException
-
getExtensions
-
getConfig
public com.tencent.polaris.api.config.Configuration getConfig()- 指定者:
getConfig在接口中InitContext
-
getPlugins
- 指定者:
getPlugins在接口中InitContext
-
getValueContext
- 指定者:
getValueContext在接口中InitContext
-
getServerServices
- 指定者:
getServerServices在接口中InitContext
-
registerDestroyHook
-
close
public void close()- 指定者:
close在接口中java.lang.AutoCloseable- 指定者:
close在接口中java.io.Closeable
-