类 HttpClientBeanHolder


  • public final class HttpClientBeanHolder
    extends java.lang.Object
    Create a rest template to ensure that each custom client config and rest template are in one-to-one correspondence.
    作者:
    mai.jh
    • 字段详细资料

      • LOGGER

        private static final org.slf4j.Logger LOGGER
      • SINGLETON_REST

        private static final java.util.Map<java.lang.String,​NacosRestTemplate> SINGLETON_REST
      • SINGLETON_ASYNC_REST

        private static final java.util.Map<java.lang.String,​NacosAsyncRestTemplate> SINGLETON_ASYNC_REST
      • ALREADY_SHUTDOWN

        private static final java.util.concurrent.atomic.AtomicBoolean ALREADY_SHUTDOWN
    • 构造器详细资料

      • HttpClientBeanHolder

        public HttpClientBeanHolder()
    • 方法详细资料

      • getNacosRestTemplate

        public static NacosRestTemplate getNacosRestTemplate​(org.slf4j.Logger logger)
      • getNacosAsyncRestTemplate

        public static NacosAsyncRestTemplate getNacosAsyncRestTemplate​(org.slf4j.Logger logger)
      • shutdown

        private static void shutdown()
        Shutdown common http client.
      • shutdown

        public static void shutdown​(java.lang.String className)
                             throws java.lang.Exception
        Shutdown http client holder and close remove template.
        参数:
        className - HttpClientFactory implement class name
        抛出:
        java.lang.Exception - ex
      • shutdownNacostSyncRest

        public static void shutdownNacostSyncRest​(java.lang.String className)
                                           throws java.lang.Exception
        Shutdown sync http client holder and remove template.
        参数:
        className - HttpClientFactory implement class name
        抛出:
        java.lang.Exception - ex
      • shutdownNacosAsyncRest

        public static void shutdownNacosAsyncRest​(java.lang.String className)
                                           throws java.lang.Exception
        Shutdown async http client holder and remove template.
        参数:
        className - HttpClientFactory implement class name
        抛出:
        java.lang.Exception - ex