Class HttpClientFactoryBean

java.lang.Object
net.shibboleth.utilities.java.support.httpclient.HttpClientBuilder
net.shibboleth.ext.spring.factory.HttpClientFactoryBean
All Implemented Interfaces:
FactoryBean<org.apache.http.client.HttpClient>

public class HttpClientFactoryBean extends HttpClientBuilder implements FactoryBean<org.apache.http.client.HttpClient>
Factory bean version of HttpClientBuilder.
  • Field Details

    • singleton

      private boolean singleton
      Singleton flag.
    • singletonInstance

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

    • HttpClientFactoryBean

      public HttpClientFactoryBean()
      Constructor.
  • Method Details

    • setSingleton

      public void setSingleton(boolean flag)
      Set if a singleton should be created, or a new object on each request otherwise. Default is true (a singleton).
      Parameters:
      flag - flag to set
    • 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>
    • getObject

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