@Component(value="anyline.data.runtime.holder.elasticsearch") public class ElasticSearchRuntimeHolder extends RuntimeHolder
factory, log, runtimes| 构造器和说明 |
|---|
ElasticSearchRuntimeHolder() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
callDestroy(String key) |
DataRuntime |
callTemporary(Object datasource,
String database,
DriverAdapter adapter) |
static void |
destroy(String key) |
static void |
reg(String key)
注册运行环境
|
static ElasticSearchRuntime |
reg(String datasource,
org.elasticsearch.client.RestClient client,
DriverAdapter adapter)
注册运行环境
|
static DataRuntime |
temporary(Object client,
String database,
DriverAdapter adapter)
注册数据源 子类覆盖 生成简单的DataRuntime不注册到spring
|
public static DataRuntime temporary(Object client, String database, DriverAdapter adapter) throws Exception
client - 数据源, 如DruidDataSource, MongoClient, es.RestClientdatabase - 数据库, jdbc类型数据源不需要adapter - 如果确认数据库类型可以提供如 new MySQLAdapter(), 如果不提供则根据ds检测Exception - 异常 Exceptionpublic DataRuntime callTemporary(Object datasource, String database, DriverAdapter adapter) throws Exception
callTemporary 在类中 RuntimeHolderExceptionpublic static void reg(String key)
key - 数据源前缀public static ElasticSearchRuntime reg(String datasource, org.elasticsearch.client.RestClient client, DriverAdapter adapter)
datasource - 数据源前缀client - RestClientadapter - adapter 可以为空 第一次执行时补齐public static void destroy(String key)
public void callDestroy(String key)
callDestroy 在类中 RuntimeHolderCopyright © 2024. All rights reserved.