use of cn.taketoday.http.client.InterceptingClientHttpRequestFactory in project today-framework by TAKETODAY.
the class InterceptingHttpAccessor method getRequestFactory.
/**
* Overridden to expose an {@link InterceptingClientHttpRequestFactory}
* if necessary.
*
* @see #getInterceptors()
*/
@Override
public ClientHttpRequestFactory getRequestFactory() {
if (!interceptors.isEmpty()) {
ClientHttpRequestFactory factory = this.interceptingRequestFactory;
if (factory == null) {
synchronized (this) {
factory = this.interceptingRequestFactory;
if (factory == null) {
factory = new InterceptingClientHttpRequestFactory(super.getRequestFactory(), interceptors);
this.interceptingRequestFactory = factory;
}
}
}
return factory;
} else {
return super.getRequestFactory();
}
}
use of cn.taketoday.http.client.InterceptingClientHttpRequestFactory in project today-infrastructure by TAKETODAY.
the class InterceptingHttpAccessor method getRequestFactory.
/**
* Overridden to expose an {@link InterceptingClientHttpRequestFactory}
* if necessary.
*
* @see #getInterceptors()
*/
@Override
public ClientHttpRequestFactory getRequestFactory() {
if (!interceptors.isEmpty()) {
ClientHttpRequestFactory factory = this.interceptingRequestFactory;
if (factory == null) {
synchronized (this) {
factory = this.interceptingRequestFactory;
if (factory == null) {
factory = new InterceptingClientHttpRequestFactory(super.getRequestFactory(), interceptors);
this.interceptingRequestFactory = factory;
}
}
}
return factory;
} else {
return super.getRequestFactory();
}
}
Aggregations