类 JdkHttpClientResourceFactory

java.lang.Object
cn.taketoday.http.client.reactive.JdkHttpClientResourceFactory
所有已实现的接口:
cn.taketoday.beans.factory.DisposableBean, cn.taketoday.beans.factory.InitializingBean

public class JdkHttpClientResourceFactory extends Object implements cn.taketoday.beans.factory.InitializingBean, cn.taketoday.beans.factory.DisposableBean
Factory to manage JDK HttpClient resources such as a shared Executor within the lifecycle of a Infra ApplicationContext.

This factory implements InitializingBean and DisposableBean and is expected typically to be declared as a Infra-managed bean.

从以下版本开始:
4.0
作者:
Rossen Stoyanchev
另请参阅:
  • 字段详细资料

    • executor

      @Nullable private Executor executor
    • threadPrefix

      private String threadPrefix
  • 构造器详细资料

    • JdkHttpClientResourceFactory

      public JdkHttpClientResourceFactory()
  • 方法详细资料

    • setExecutor

      public void setExecutor(@Nullable Executor executor)
      Configure the Executor to use for HttpClient exchanges. The given executor is started and stopped via InitializingBean and DisposableBean.

      By default, this is set to Executors.newCachedThreadPool(ThreadFactory), which mirrors HttpClient.Builder.executor(Executor).

      参数:
      executor - the executor to use
    • getExecutor

      @Nullable public Executor getExecutor()
      Return the configured Executor.
    • setThreadPrefix

      public void setThreadPrefix(String threadPrefix)
      Configure the thread prefix to initialize QueuedThreadPool executor with. This is used only when a Executor instance isn't provided.

      By default set to "jetty-http".

      参数:
      threadPrefix - the thread prefix to use
    • afterPropertiesSet

      public void afterPropertiesSet() throws Exception
      指定者:
      afterPropertiesSet 在接口中 cn.taketoday.beans.factory.InitializingBean
      抛出:
      Exception
    • destroy

      public void destroy() throws Exception
      指定者:
      destroy 在接口中 cn.taketoday.beans.factory.DisposableBean
      抛出:
      Exception