public class SDKContext extends Destroyable implements InitContext, AutoCloseable, Closeable
| Constructor and Description |
|---|
SDKContext(com.tencent.polaris.api.config.Configuration configuration,
Manager plugins,
ValueContext valueContext)
构造器
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
com.tencent.polaris.api.config.Configuration |
getConfig() |
Extensions |
getExtensions() |
<T extends AbstractFlow> |
getOrInitFlow(Class<T> clazz) |
Supplier |
getPlugins() |
Collection<ServerServiceInfo> |
getServerServices() |
ValueContext |
getValueContext() |
void |
init() |
static SDKContext |
initContext()
通过默认配置初始化SDKContext
|
static SDKContext |
initContextByConfig(com.tencent.polaris.api.config.Configuration config)
通过配置对象初始化SDK上下文
|
static String |
parseHost(com.tencent.polaris.api.config.Configuration configuration) |
static 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
|
void |
registerDestroyHook(Destroyable destroyable) |
destroy, getName, isDestroyedpublic SDKContext(com.tencent.polaris.api.config.Configuration configuration,
Manager plugins,
ValueContext valueContext)
configuration - 配置plugins - 插件工厂valueContext - 上下文public static SDKContext initContext() throws PolarisException
PolarisException - 初始化异常public static SDKContext initContextByConfig(com.tencent.polaris.api.config.Configuration config) throws PolarisException
config - 配置对象PolarisException - 初始化过程的异常public static String parseHost(com.tencent.polaris.api.config.Configuration configuration)
public static String parseServerConnectorProtocol(com.tencent.polaris.api.config.Configuration configuration)
DefaultPlugins.SERVER_CONNECTOR_COMPOSITEDefaultPlugins.SERVER_CONNECTOR_GRPCDefaultPlugins.SERVER_CONNECTOR_CONSULconfiguration - public void init()
throws PolarisException
PolarisExceptionpublic Extensions getExtensions()
public com.tencent.polaris.api.config.Configuration getConfig()
getConfig in interface InitContextpublic Supplier getPlugins()
getPlugins in interface InitContextpublic ValueContext getValueContext()
getValueContext in interface InitContextpublic Collection<ServerServiceInfo> getServerServices()
getServerServices in interface InitContextpublic void registerDestroyHook(Destroyable destroyable)
public void close()
close in interface Closeableclose in interface AutoCloseablepublic <T extends AbstractFlow> T getOrInitFlow(Class<T> clazz)
Copyright © 2023. All rights reserved.