Class FileCachingHttpClientFactoryBean

All Implemented Interfaces:
DisposableBean, FactoryBean<org.apache.http.client.HttpClient>

public class FileCachingHttpClientFactoryBean extends FileCachingHttpClientBuilder implements FactoryBean<org.apache.http.client.HttpClient>, DisposableBean
Factory bean version of FileCachingHttpClientBuilder.

This is different than the other factories in order to limit non-singleton use and implement init/destroy. This can't handle prototypes but that makes no sense when you consider a shared cache in one directory wouldn't work anyway.

  • Field Details

    • singletonInstance

      @Nullable private org.apache.http.client.HttpClient singletonInstance
      Our captive client in singleton cases.
  • Constructor Details

    • FileCachingHttpClientFactoryBean

      public FileCachingHttpClientFactoryBean()
  • Method Details

    • isSingleton

      public boolean isSingleton()
      Specified by:
      isSingleton in interface FactoryBean<org.apache.http.client.HttpClient>
    • getObjectType

      public Class<org.apache.http.client.HttpClient> getObjectType()
      Specified by:
      getObjectType in interface FactoryBean<org.apache.http.client.HttpClient>
    • destroy

      public void destroy()
      Specified by:
      destroy in interface DisposableBean
    • getObject

      public org.apache.http.client.HttpClient getObject() throws Exception
      Specified by:
      getObject in interface FactoryBean<org.apache.http.client.HttpClient>