类 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

      public SDKContext​(com.tencent.polaris.api.config.Configuration configuration, Manager plugins, ValueContext valueContext)
      构造器
      参数:
      configuration - 配置
      plugins - 插件工厂
      valueContext - 上下文
  • 方法详细资料

    • initContext

      public static SDKContext initContext() throws PolarisException
      通过默认配置初始化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_COMPOSITE
      • DefaultPlugins.SERVER_CONNECTOR_GRPC
      • DefaultPlugins.SERVER_CONNECTOR_CONSUL
      参数:
      configuration -
      返回:
    • init

      public void init() throws PolarisException
      抛出:
      PolarisException
    • getExtensions

      public Extensions getExtensions()
    • getConfig

      public com.tencent.polaris.api.config.Configuration getConfig()
      指定者:
      getConfig 在接口中 InitContext
    • getPlugins

      public Supplier getPlugins()
      指定者:
      getPlugins 在接口中 InitContext
    • getValueContext

      public ValueContext getValueContext()
      指定者:
      getValueContext 在接口中 InitContext
    • getServerServices

      public java.util.Collection<ServerServiceInfo> getServerServices()
      指定者:
      getServerServices 在接口中 InitContext
    • registerDestroyHook

      public void registerDestroyHook​(Destroyable destroyable)
    • close

      public void close()
      指定者:
      close 在接口中 java.lang.AutoCloseable
      指定者:
      close 在接口中 java.io.Closeable