类 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
  • 构造器详细资料

    • ElasticSearchRuntimeHolder

      public ElasticSearchRuntimeHolder()
  • 方法详细资料

    • temporary

      public static DataRuntime temporary(Object client, String database, DriverAdapter adapter) throws Exception
      注册数据源 子类覆盖 生成简单的DataRuntime不注册到spring
      参数:
      client - 数据源, 如DruidDataSource, MongoClient, es.RestClient
      database - 数据库, jdbc类型数据源不需要
      adapter - 如果确认数据库类型可以提供如 new MySQLAdapter(), 如果不提供则根据ds检测
      返回:
      DataRuntime
      抛出:
      Exception - 异常 Exception
    • callTemporary

      public DataRuntime callTemporary(Object datasource, String database, DriverAdapter adapter) throws Exception
      指定者:
      callTemporary 在类中 RuntimeHolder
      抛出:
      Exception
    • reg

      public static void reg(String key)
      注册运行环境
      参数:
      key - 数据源前缀
    • reg

      public static ElasticSearchRuntime reg(String datasource, org.elasticsearch.client.RestClient client, DriverAdapter adapter)
      注册运行环境
      参数:
      datasource - 数据源前缀
      client - RestClient
      adapter - adapter 可以为空 第一次执行时补齐
    • destroy

      public static void destroy(String key)
    • callDestroy

      public void callDestroy(String key)
      指定者:
      callDestroy 在类中 RuntimeHolder