类 ElasticSearchRuntimeHolder
java.lang.Object
org.anyline.data.runtime.RuntimeHolder
org.anyline.data.elasticsearch.runtime.ElasticSearchRuntimeHolder
@Component("anyline.data.runtime.holder.elasticsearch")
public class ElasticSearchRuntimeHolder
extends RuntimeHolder
-
字段概要
从类继承的字段 org.anyline.data.runtime.RuntimeHolder
factory, log, runtimes -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidcallDestroy(String key) callTemporary(Object datasource, String database, DriverAdapter adapter) static voidstatic void注册运行环境static ElasticSearchRuntimereg(String datasource, org.elasticsearch.client.RestClient client, DriverAdapter adapter) 注册运行环境static DataRuntimetemporary(Object client, String database, DriverAdapter adapter) 注册数据源 子类覆盖 生成简单的DataRuntime不注册到spring
-
构造器详细资料
-
ElasticSearchRuntimeHolder
public ElasticSearchRuntimeHolder()
-
-
方法详细资料
-
temporary
public static DataRuntime temporary(Object client, String database, DriverAdapter adapter) throws Exception 注册数据源 子类覆盖 生成简单的DataRuntime不注册到spring- 参数:
client- 数据源, 如DruidDataSource, MongoClient, es.RestClientdatabase- 数据库, jdbc类型数据源不需要adapter- 如果确认数据库类型可以提供如 new MySQLAdapter(), 如果不提供则根据ds检测- 返回:
- DataRuntime
- 抛出:
Exception- 异常 Exception
-
callTemporary
public DataRuntime callTemporary(Object datasource, String database, DriverAdapter adapter) throws Exception - 指定者:
callTemporary在类中RuntimeHolder- 抛出:
Exception
-
reg
注册运行环境- 参数:
key- 数据源前缀
-
reg
public static ElasticSearchRuntime reg(String datasource, org.elasticsearch.client.RestClient client, DriverAdapter adapter) 注册运行环境- 参数:
datasource- 数据源前缀client- RestClientadapter- adapter 可以为空 第一次执行时补齐
-
destroy
-
callDestroy
- 指定者:
callDestroy在类中RuntimeHolder
-